POST
/
link
/
oauth2
/
token
curl --request POST \
  --url https://api.sequin.io/link/oauth2/token \
  --header 'Content-Type: application/json' \
  --data '{
    "code": "BTNsQNebVfaVDUwme85dAO9PgUcvxvXkEAY",
    "client_id": "8ff58ef0-d376-4ae8-b2e2-9f0206aa65b8",
    "client_secret": "12345678901234567890123456789012"
  }'
{
  "credential": {
    "oauth_app_id": "8ff58ef0-d376-4ae8-b2e2-9f0206aa65b8",
    "properties": {
      "kind": "linear_oauth2",
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "scope": "read write issues:create",
      "linear_org_id": "abc123",
      "linear_org_name": "Arrakis Inc."
    }
  },
  "state": "ZTA5N2UxYzctMDRjZi00OTQwLThkODUtMTY0MTNhMTU4YmE4"
}
code
string
required

The code you received at the end of the OAuth flow.

client_id
string
required

The Sequin ID of the OAuth app you want to use for this connection. You can find this ID in the Sequin console.

Note that this is not the client_id corresponding to the OAuth app.

client_secret
string
required

The client_secret corresponding to the OAuth app you want to use for this connection. This is the client_secret the API provider gave you when you registered your OAuth app.

curl --request POST \
  --url https://api.sequin.io/link/oauth2/token \
  --header 'Content-Type: application/json' \
  --data '{
    "code": "BTNsQNebVfaVDUwme85dAO9PgUcvxvXkEAY",
    "client_id": "8ff58ef0-d376-4ae8-b2e2-9f0206aa65b8",
    "client_secret": "12345678901234567890123456789012"
  }'
{
  "credential": {
    "oauth_app_id": "8ff58ef0-d376-4ae8-b2e2-9f0206aa65b8",
    "properties": {
      "kind": "linear_oauth2",
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
      "scope": "read write issues:create",
      "linear_org_id": "abc123",
      "linear_org_name": "Arrakis Inc."
    }
  },
  "state": "ZTA5N2UxYzctMDRjZi00OTQwLThkODUtMTY0MTNhMTU4YmE4"
}
credential
object

The user’s credentials. You can pass this full object directly to the create credential endpoint or the create sync endpoint.

See credential properties for a list of possible properties for each provider.

state
string

The state you passed Sequin at the start of the flow.