Skip to content
Docs

Get a Connect token

POSThttps://api.vercel.com/v1/connect/token/{connector}
Get an access token for a connector identified by the path parameter and scoped to the requester.
https://api.vercel.com/v1/connect/token/{connector}
const response = await fetch('https://api.vercel.com/v1/connect/token/connector', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"subject": {
"type": "app"
},
"installationId": "example_id",
"audience": [],
"scopes": [],
"resources": [],
"authorizationDetails": [
{
"type": "string"
}
],
"validityBufferMs": "123"
}),
});
const data = await response.json();
console.log(data);
Response
{
"authorizationId": "example_id",
"claims": "value",
"connector": {
"id": "icfg_1234567890",
"type": "string",
"uid": "example_id"
},
"expiresAt": "123",
"externalSubject": "string",
"installationId": "example_id",
"metadata": "value",
"name": "Example Name",
"tenantId": "example_id",
"token": "string",
"tokenGroupId": "example_id",
"tokenId": "example_id"
}
AuthorizationbearerToken

Default authentication mechanism

connectorstringRequired
application/json
subjectobjectOptional5 variants
installationIdstringOptional
audiencearrayOptional
scopesarrayOptional
resourcesarrayOptional
authorizationDetailsarrayOptional
validityBufferMsnumberOptional
200Success
authorizationIdstringOptional
Stable id correlating all tokens (including refreshes) back to the original authorization.
claimsobjectOptional
Claims extracted from the provider's tokens per the connector's ForwardedClaims allow-list. Currently sourced from the OIDC id_token only.
connectorobjectRequired
expiresAtnumberRequired
externalSubjectstringOptional
installationIdstringOptional
metadataobjectOptional
Driver-specific metadata (e.g., botUserId for Slack).
namestringOptional
tenantIdstringOptional
tokenstringRequired
tokenGroupIdstringOptional
Stable id that groups all tokens with the same parameters across refreshes.
tokenIdstringRequired
400One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
409Error
410Error
422Error
429Error