POST
/
v1
/
credentials
/
exchange-code
curl --request POST \
  --url https://api.sequin.io/v1/credentials/exchange-code \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "code": "BTNsQNebVfaVDUwme85dAO9PgUcvxvXkEAY"
  }'
{
  "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": {
    "user_id": "4e6be1b3-5bc4-4336-b97d-e243a5507dc0"
  }
}

See the Start OAuth endpoint for a description of the Sequin-managed OAuth flow.

At the end of the Sequin-managed OAuth flow, you can use this endpoint to retrieve the details of the user’s credentials. Then, you can use the create credential endpoint to create a credential or the create sync endpoint to create a sync.

code
string
required

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

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
any

The state you passed to the start OAuth endpoint.