treg.to Connections API
The Connections API from treg.to — 6 operation(s) for connections.
The Connections API from treg.to — 6 operation(s) for connections.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/treg-to:treg-to-connections-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: treg Connections API
version: 0.0.1
tags:
- name: Connections
paths:
/connections:
get:
summary: List Connections
description: Every OAuth credential in the org, with health AND expiry. Metadata only — no token material.
operationId: list_connections_connections_get
parameters:
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: array
items:
type: object
additionalProperties: true
title: Response List Connections Connections Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
/connections/{secret_id}/resources:
get:
summary: Connection Resources
description: 'What this connection can act on — GSC sites, and later GA properties / Ads accounts.
Live-fetched rather than stored: the answer changes when the user gains or loses access
upstream, and a stale picker is worse than no picker.'
operationId: connection_resources_connections__secret_id__resources_get
parameters:
- name: secret_id
in: path
required: true
schema:
type: integer
title: Secret Id
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Connection Resources Connections Secret Id Resources Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
/connections/{secret_id}/resource:
post:
summary: Set Connection Resource
operationId: set_connection_resource_connections__secret_id__resource_post
parameters:
- name: secret_id
in: path
required: true
schema:
type: integer
title: Secret Id
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ResourceRefIn'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Set Connection Resource Connections Secret Id Resource Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
/connections/token:
post:
summary: Connect With Token
description: 'Connect a provider the user brings a pasted credential for — a bot token (Slack) or an API
key (Apollo, TikHub, Semrush, …).
The credential is VERIFIED against the provider''s probe before anything is stored. Saving an
unverified credential just moves the failure to the first real call, by which point the user
has left the setup screen and has no idea which of the steps they got wrong.'
operationId: connect_with_token_connections_token_post
parameters:
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TokenConnectIn'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Connect With Token Connections Token Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
/connections/{secret_id}/extra-credential:
post:
summary: Set Extra Credential
description: 'Supply the second credential a provider needs, and finish building its tool.
Google Ads takes the user''s OAuth bearer AND a developer-token header from an approved manager
account. treg can''t invent the latter, so the connect deliberately stops short of a tool. This
is the other half: store the extra credential and provision the tool with BOTH bindings, so the
connection goes from "connected but uncallable" to actually usable.'
operationId: set_extra_credential_connections__secret_id__extra_credential_post
parameters:
- name: secret_id
in: path
required: true
schema:
type: integer
title: Secret Id
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ExtraCredentialIn'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Set Extra Credential Connections Secret Id Extra Credential Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
/connections/{secret_id}:
patch:
summary: Rename Connection
description: 'Rename a connected account. The name is the tool name an agent calls, so with several
accounts on one provider this is how `instagram-2` becomes `instagram-acme`.'
operationId: rename_connection_connections__secret_id__patch
parameters:
- name: secret_id
in: path
required: true
schema:
type: integer
title: Secret Id
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectionRenameIn'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Rename Connection Connections Secret Id Patch
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
delete:
summary: Revoke Connection
description: 'Disconnect, and take the provider''s own tool with it.
A tool left bound to a deleted credential isn''t "still configured" — it''s broken, and it says so
only at call time with "a bound secret is missing". We remove the tool treg auto-provisioned for
this provider (that''s treg''s creation, not the user''s) and drop the dead binding from any tool
the user built themselves, leaving their other bindings intact.'
operationId: revoke_connection_connections__secret_id__delete
parameters:
- name: secret_id
in: path
required: true
schema:
type: integer
title: Secret Id
- name: x-treg-token
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Token
- name: x-treg-org
in: header
required: false
schema:
type: string
default: ''
title: X-Treg-Org
- name: treg_session
in: cookie
required: false
schema:
type: string
default: ''
title: Treg Session
responses:
'200':
description: Successful Response
content:
application/json:
schema:
type: object
additionalProperties: true
title: Response Revoke Connection Connections Secret Id Delete
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Connections
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
ResourceRefIn:
properties:
resource_ref:
type: string
title: Resource Ref
resource_name:
type: string
title: Resource Name
default: ''
type: object
required:
- resource_ref
title: ResourceRefIn
ExtraCredentialIn:
properties:
value:
type: string
title: Value
type: object
required:
- value
title: ExtraCredentialIn
ConnectionRenameIn:
properties:
name:
type: string
title: Name
type: object
required:
- name
title: ConnectionRenameIn
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
TokenConnectIn:
properties:
provider:
type: string
title: Provider
token:
type: string
title: Token
type: object
required:
- provider
- token
title: TokenConnectIn