Start OAuth authorization
const url = 'https://api-dev.mindflow.io/v1/oauth/authorize?client_id=UJu3PB7RPORHyi0mXo8frl-NSQ58Tfh2mjjSj4xHlrY&redirect_uri=myapp%3A%2F%2Foauth%2Fcallback&state=af0ifjsldkj&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&response_type=code&resource=https%3A%2F%2Fmcp-dev.mindflow.io%2Fmcp&mcp_issuer=aB3_xY9zQpL2mN7kR4vW8sT1uH5jF0cD6eG';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api-dev.mindflow.io/v1/oauth/authorize?client_id=UJu3PB7RPORHyi0mXo8frl-NSQ58Tfh2mjjSj4xHlrY&redirect_uri=myapp%3A%2F%2Foauth%2Fcallback&state=af0ifjsldkj&code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&code_challenge_method=S256&response_type=code&resource=https%3A%2F%2Fmcp-dev.mindflow.io%2Fmcp&mcp_issuer=aB3_xY9zQpL2mN7kR4vW8sT1uH5jF0cD6eG'Starts Platform user-token OAuth and redirects to the configured Studio consent URL with a bind token in the URL fragment
(#bind=…). Send that token to POST /oauth/session within 30 minutes.
code_challenge_method must be S256. code_challenge is 43 unreserved characters.
client_id is a registered client id, or the HTTPS URL of a Client ID Metadata Document. The document must be public JSON
whose client_id equals that URL, whose redirect_uris list redirect_uri (any port on a loopback host), and that uses
no client authentication. Mindflow caches it for 5 minutes to 24 hours, following Cache-Control.
resource (RFC 8707) selects the API the access token is for. The accepted values are this tenant’s Platform API (https://api-{tenant}.mindflow.io/v1) and this tenant’s MCP resource (https://mcp-{tenant}.mindflow.io/mcp). Omit resource and the token is for the Platform API, unless the sign-in started on the MCP host, in which case it is for the MCP resource. Every access token carries that URL as aud and works only on that API.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Registered OAuth client identifier, or the HTTPS URL of the client’s Client ID Metadata Document.
Example
UJu3PB7RPORHyi0mXo8frl-NSQ58Tfh2mjjSj4xHlrYRegistered redirect URI for the client.
Example
myapp://oauth/callbackOpaque value echoed on redirect.
Example
af0ifjsldkjS256 PKCE challenge. Base64url SHA-256 of code_verifier, with no padding. Exactly 43 unreserved characters.
Example
E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cMPKCE method. The only accepted value is S256. Omit it, or send another value, and the call is 400.
Example
S256Authorization response type. The only accepted value is code.
Example
codeRFC 8707 resource indicator. Accepted values are this tenant’s Platform API URL (https://api-{tenant}.mindflow.io/v1) and MCP resource URL (https://mcp-{tenant}.mindflow.io/mcp). Omit it to use the default described above.
Scheme and host compare case-insensitively, and one trailing slash is ignored. Any other value redirects with error=invalid_target.
Example
https://mcp-dev.mindflow.io/mcpOne-time ticket id the MCP host adds when it forwards authorize here. The API host consumes the ticket and then binds
the grant to the MCP resource and returns the MCP-host issuer as iss (RFC 9207). Clients do not send it.
Example
aB3_xY9zQpL2mN7kR4vW8sT1uH5jF0cD6eGResponses
Section titled “Responses”Redirect to Studio consent. The Location header is https://{tenant}/mcp/connect#bind={bindToken} (configured Studio path; fragment carries the bind token).
Read bind from the fragment. Do not send the fragment to the client redirect URI.
When resource is not accepted, the redirect goes to redirect_uri with error=invalid_target and state (plus iss when the MCP host started the sign-in).
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.
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.