BackendHTTP APIConnections

Get connection & credentials

Requires an API key with one of: environment:connections:read or environment:connections:read_credentials. Learn more about API key scopes.

The response content depends on the API authentication type (e.g: OAuth 2, OAuth 1, API key, etc.).

If you do not want to deal with collecting & injecting credentials in requests for multiple authentication types, use the Proxy.

Every time you fetch the connection with this API endpoint, Tenklo will check if the access token has expired. If it has, it will refresh it.

We recommend you always fetch the token just before you use it to make sure it is fresh!

GET
/connections/{connectionId}

Returns a specific connection with credentials

Authorization

bearerAuth
headerAuthorizationBearer <token>

An Environment API key from your Tenklo environment, or an Account API key for account-level endpoints.

Path Parameters

connectionId*string

The connection ID used to create the connection.

Query Parameters

provider_config_key*string

The integration ID used to create the connection (aka Unique Key).

force_refresh?boolean

If true, Tenklo will attempt to refresh the access access token regardless of its expiration status (false by default).

refresh_token?boolean

If true, return the refresh token as part of the response (false by default).

refresh_github_app_jwt_token?boolean

If true, this will refresh the JWT token for GitHub App / Github App OAuth connections

Response Body

Successfully returned a connection

application/json
  1. response
id*integer
connection_id*string
provider_config_key*string
provider*string
errors*array<>
end_user?|nullDeprecated
metadata*
connection_config*
tags*

Connection tags (key/value strings). Keys are normalized to lowercase.

Propertiesproperties <= 10
created_at*string
updated_at*string
last_fetched_at*string
credentials*|||||||||||||
Example Request
curl -X GET 'https://api.tenklo.dev/connections/string?provider_config_key=string'
Example Response
{  "id": 0,  "connection_id": "string",  "provider_config_key": "string",  "provider": "string",  "errors": [    {      "type": "auth",      "log_id": "string"    }  ],  "end_user": {    "id": "string",    "email": "string",    "display_name": "string",    "tags": {},    "organization": {      "id": "string",      "display_name": "string"    }  },  "metadata": {},  "connection_config": {},  "tags": {    "property1": "string",    "property2": "string"  },  "created_at": "string",  "updated_at": "string",  "last_fetched_at": "string",  "credentials": {    "oauth_token": "string",    "oauth_token_secret": "string",    "type": "OAUTH1",    "raw": {}  }}