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"
}
Auth
Exchange code for token
At the end of a Sequin-managed OAuth flow, Sequin redirects the user back to your app with a code. You can use that code to retrieve their credentials from this endpoint.
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"
}
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.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"
}
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.

