Create connect session

createConnectSession(projectReference: ID!, name: String!, input: CreateConnectSessionInput!): ConnectSession!

Arguments

ArgumentTypeRequiredDescription
projectReferenceID!YesProject ID or slug. A missing or inaccessible project, including a denied scope-dependent project access check, returns not_found.
nameString!YesIntegration name, for example github.
inputCreateConnectSessionInput!Yes

Input fields

input

CreateConnectSessionInput

FieldTypeRequiredDescription
scopeConnectionScope!YesConnection owner. Project scope needs the editor role; user scope connects your own account and needs viewer access to the project. API keys also need the integrations write scope. Verified user-session or API-key credentials are required; MCP OAuth grants and runtime credentials are refused.
redirectUriString!YesTrusted web or native URI the browser returns to after consent.

Response

Returns ConnectSession!. Open the type for its fields and nested types.

FieldTypeDescription
sessionTokenString!One-time connect session token, embedded in connectUrl.
connectUrlString!URL to open in a browser; it starts provider consent through GET /oauth/connect/{integration}.
expiresAtDateTime!Time after which connectUrl no longer starts consent.

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation CreateConnectSession($projectReference: ID!, $name: String!, $input: CreateConnectSessionInput!) {
  createConnectSession(projectReference: $projectReference, name: $name, input: $input) {
    connectUrl
    expiresAt
    sessionToken
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "name": "github",
  "input": {
    "scope": "user",
    "redirectUri": "veryfront://auth/integrations"
  }
}