Skip to main content
POST
Create a custom API connector

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Custom API connector request

access_token
string
required

Credential sent to the provider. Stored encrypted and never returned by the API.

Example:

"sk-live-..."

base_api_url
string
required

Base URL of the provider API. Gateway paths are appended to it when a sprite calls the connector.

Example:

"https://api.acme.example"

name
string
required

Connector name. This is the connector's unique identity within the organization: creating a second custom API connector with the same name updates the existing connector in place rather than creating another one.

Example:

"acme-api"

access_policy
object

Initial access policy. Empty or missing policies deny sprite use until updated.

Example:
auth_custom_header_name
string

Header that carries the credential when auth_method is custom_header. Defaults to X-Api-Key. Reserved hop-by-hop and identity headers are rejected.

Example:

"X-Api-Key"

auth_header_prefix
string

Prefix for the Authorization header value when auth_method is header. Defaults to Bearer. An empty string sends the bare credential.

Example:

"Bearer"

auth_method
enum<string>

Where the credential is placed on provider requests. header sends an Authorization header prefixed by auth_header_prefix; url_path substitutes it into auth_url_path_template; query_param adds it as the auth_query_param_name query parameter; custom_header sends it as the auth_custom_header_name header. Defaults to header.

Available options:
header,
url_path,
query_param,
custom_header
Example:

"header"

auth_query_param_name
string

Query parameter that carries the credential when auth_method is query_param. Defaults to api_key.

Example:

"api_key"

auth_url_path_template
string

Path segment inserted between base_api_url and the requested path when auth_method is url_path. {token} is replaced with the credential.

Example:

"/bot{token}"

description
string

Free-form description shown in the dashboard.

Example:

"Acme production account"

refresh_token
string

Optional refresh token stored alongside the credential. Stored encrypted and never returned.

Example:

"rt-..."

test_url
string

URL the connector test fetches with the credential attached. For auth_method url_path give a path relative to base_api_url (such as /me), because the test joins base_api_url, the token path and this value; for every other method give an absolute URL. Stored for later tests; creating a connector does not run the test.

Example:

"https://api.acme.example/me"

Response

Created

Connector response

connection
object
required

Sanitized connector. Secrets and encrypted token fields are never returned.

Example: