Bind Studio identity to OAuth configuration session
const url = 'https://api-dev.mindflow.io/v1/oauth/session';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"bindToken":"JWAkeIV_31m0uH2d4Srpm2YuPIjgdePnsycFkksBZUs"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api-dev.mindflow.io/v1/oauth/session \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "bindToken": "JWAkeIV_31m0uH2d4Srpm2YuPIjgdePnsycFkksBZUs" }'Binds the signed-in user to the bind token from the authorize redirect (#bind=).
Send the identity JWT as Authorization: Bearer <token>. The body is only bindToken.
Finish this within 30 minutes of authorize. Returns the environments and flows the user may approve, plus the client name and redirect URI.
503 when there are too many environments or flows to list.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Bind token from the authorize redirect. The identity JWT goes in the Authorization header, not in the body.
Bind token from the authorize redirect. The identity JWT goes in the Authorization header, not in the body.
object
Opaque bind token from the authorize redirect fragment (#bind=). It expires 30 minutes after authorize.
Example
{ "bindToken": "JWAkeIV_31m0uH2d4Srpm2YuPIjgdePnsycFkksBZUs"}Responses
Section titled “Responses”Consent metadata for Studio (OAuthConsent).
Consent metadata returned after the signed-in user’s identity JWT is bound to the OAuth session.
Environment fields use the unprefixed / environment* names used elsewhere in the Platform API; flow fields
use the flow* prefix.
object
True when the signed-in user holds organization admin on this org and may opt into org-admin elevation.
Display name of the OAuth client requesting access.
Registered OAuth redirect URI for the client (authorization code is returned here after configure).
Host portion of redirectUri (derived for clients that prefer a host label over the full URI).
Host of the client’s metadata document URL when client_id is a URL. Studio shows it next to clientName, which the document declares.
RFC 9207 issuer to send as iss on every client redirect, including cancel. Present only when the sign-in started on the MCP host.
OAuth state value that Studio must round-trip to the client redirect.
Environment roles the user may grant as the connection ceiling when environment scope is all
(environmentAuditor, environmentOperator, environmentOwner).
Flow roles the user may grant as the connection ceiling when flow scope is all
(flowAuditor, flowEditor, flowOwner).
Environments in the organization with whether the signed-in user can include each one in the grant.
One environment the consent form can offer. accessible is false when the user cannot include it.
object
Opaque id of the environment. Pass it unchanged.
Human-readable environment name shown in Studio.
True when the user holds any environment role on this environment and may include it.
Strongest environment role the user currently holds on this environment. Used to cap the per-environment
role picker; omitted when accessible is false.
Flows in the organization with whether the signed-in user can include each one in the grant.
One flow the consent form can offer. accessible is false when the user cannot include it.
object
Opaque id of the flow. Pass it unchanged.
Human-readable flow name shown in Studio.
True when the user holds any flow role on this flow and may include it.
Strongest flow role the user currently holds on this flow. Used to cap the per-flow role picker;
omitted when accessible is false.
Previous approval for this user and client, when one can be reused. The consent form is prefilled from it.
Fields include includeOrganizationAdmin, environments, and flows. Absent when there is nothing to reuse.
object
Example
{ "environmentRows": [ { "environmentId": "$CURRENT_ENVIRONMENT_ID" } ], "flowRows": [ { "flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19" } ]}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
The request was invalid. Common causes include:
- Invalid timestamp format.
- Using
cursorwithbeforeorafter. - Missing
limitwhen usingbeforeorafter. - Invalid field names in the
fieldsparameter.
See the error response for specific details about what went wrong.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always BAD_REQUEST on this response. Read detail for which value to change, then send a corrected request.
Example
{ "type": "about:blank", "title": "Bad Request", "status": 400, "detail": "The request body or query is invalid.", "code": "BAD_REQUEST"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Authentication failed. The request lacks valid credentials or the provided credentials are invalid.
Ensure you have:
- A valid API key or token.
- Proper authentication headers.
- Required permissions.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always MISSING_OR_INVALID_TOKEN on this response. Branch on this value, not on detail.
Example
{ "type": "about:blank", "title": "Unauthorized", "status": 401, "detail": "The bearer token is missing or invalid.", "code": "MISSING_OR_INVALID_TOKEN"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Forbidden. The server understood the request but refuses to authorize it.
For connector APIs, this often indicates insufficient permissions on the remote system (for example SFTP write access denied).
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always FORBIDDEN on this response. The token was accepted and the action is not allowed.
Example
{ "type": "about:blank", "title": "Forbidden", "status": 403, "detail": "You cannot perform this action.", "code": "FORBIDDEN"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Too many requests. The request rate limit has been exceeded.
Please wait until the rate limit window resets before making additional requests.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always RATE_LIMIT_EXCEEDED on this response. Wait Retry-After seconds before retrying.
Example
{ "type": "about:blank", "title": "Too Many Requests", "status": 429, "detail": "The request rate limit has been exceeded.", "code": "RATE_LIMIT_EXCEEDED"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.
Internal server error. The server encountered an unexpected condition that prevented it from fulfilling the request.
Please try again later or contact support if the problem persists.
object
URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.
Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).
HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).
Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).
URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).
Always INTERNAL_ERROR on this response. Retry later. Do not retry a create in a tight loop.
Example
{ "type": "about:blank", "title": "Internal Server Error", "status": 500, "detail": "The request could not be completed.", "code": "INTERNAL_ERROR"}Headers
Section titled “Headers”Example
1000Maximum number of requests allowed in the current window. Present when this response is rate limited.
Example
42Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.
Example
2026-03-20T15:31:00.000ZTime when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.
Example
30HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.
Example
*CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.