Skip to content

Load Platform OAuth grant editor consent

POST
/organizations/{organizationId}/oauth/grants/{grantId}/session
curl --request POST \
--url https://api-dev.mindflow.io/v1/organizations/ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742/oauth/grants/2b08e096f6f48c7e918a5f238d254ce7/session \
--header 'Authorization: Bearer <token>'

Returns the same consent JSON as POST /oauth/session, prefilled from the active grant, so Studio can reuse the consent form to update ceilings. The grant owner may call this; organization and root administrators may edit grants in that organization. Lists environments and flows for the grant owner (not the administrator). Send the identity JWT as Authorization: Bearer <token>.

organizationId
required
Organization id

Opaque id of the organization that owns the resource. In a playbook step this can be filled from the current organization when the caller leaves it unset.

string
default: $CURRENT_ORGANIZATION_ID >= 1 characters <= 128 characters /^[^\p{C}]+$/

Organization the grant belongs to.

Example
ORGA-57b858ed-ec60-4507-b2ef-ea58244ac742
grantId
required
string
<= 128 characters /^[^\x00-\x1F\x7F]+$/
Example
2b08e096f6f48c7e918a5f238d254ce7

Consent payload for the grant editor.

Media typeapplication/json
object
canIncludeOrganizationAdmin
required

True when the signed-in user holds organization admin on this org and may opt into org-admin elevation.

boolean
clientName
required

Display name of the OAuth client requesting access.

string
<= 256 characters
redirectUri
required

Registered OAuth redirect URI for the client (authorization code is returned here after configure).

string format: uri
<= 2048 characters
redirectHost
required

Host portion of redirectUri (derived for clients that prefer a host label over the full URI).

string
<= 256 characters
clientHost

Host of the client’s metadata document URL when client_id is a URL. Studio shows it next to clientName, which the document declares.

string
<= 256 characters /^[^\x00-\x1F\x7F]+$/
issuer

RFC 9207 issuer to send as iss on every client redirect, including cancel. Present only when the sign-in started on the MCP host.

string format: uri
<= 2048 characters
oauthState
required

OAuth state value that Studio must round-trip to the client redirect.

string
<= 512 characters
maximumRoleOptions
required

Environment roles the user may grant as the connection ceiling when environment scope is all (environmentAuditor, environmentOperator, environmentOwner).

Array<string>
<= 8 items
flowMaximumRoleOptions
required

Flow roles the user may grant as the connection ceiling when flow scope is all (flowAuditor, flowEditor, flowOwner).

Array<string>
<= 8 items
environmentRows
required

Environments in the organization with whether the signed-in user can include each one in the grant.

Array<object>
<= 256 items

One environment the consent form can offer. accessible is false when the user cannot include it.

object
environmentId
required

Opaque id of the environment. Pass it unchanged.

string
default: $CURRENT_ENVIRONMENT_ID >= 1 characters <= 128 characters /^[^\p{C}]+$/
name
required

Human-readable environment name shown in Studio.

string
<= 256 characters
accessible
required

True when the user holds any environment role on this environment and may include it.

boolean
heldRole

Strongest environment role the user currently holds on this environment. Used to cap the per-environment role picker; omitted when accessible is false.

string
<= 64 characters
flowRows
required

Flows in the organization with whether the signed-in user can include each one in the grant.

Array<object>
<= 256 items

One flow the consent form can offer. accessible is false when the user cannot include it.

object
flowId
required

Opaque id of the flow. Pass it unchanged.

string
>= 1 characters <= 128 characters /^[^\p{C}]+$/
name
required

Human-readable flow name shown in Studio.

string
<= 256 characters
accessible
required

True when the user holds any flow role on this flow and may include it.

boolean
heldRole

Strongest flow role the user currently holds on this flow. Used to cap the per-flow role picker; omitted when accessible is false.

string
<= 64 characters
existingConnection
required

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
key
additional properties
any
existingConnection
required

Current grant ceilings used to prefill the editor form.

object
grantId
required
string
<= 128 characters
organizationId
required
Organization id

Opaque id of the organization that owns the resource. In a playbook step this can be filled from the current organization when the caller leaves it unset.

string
default: $CURRENT_ORGANIZATION_ID >= 1 characters <= 128 characters /^[^\p{C}]+$/
Example
{
"environmentRows": [
{
"environmentId": "$CURRENT_ENVIRONMENT_ID"
}
],
"flowRows": [
{
"flowId": "PLAY-17a64601-40bb-4304-90f8-08ebf6ae3c19"
}
],
"organizationId": "$CURRENT_ORGANIZATION_ID"
}
X-RateLimit-Limit
integer format: int32
>= 1 <= 1000
Example
1000

Maximum number of requests allowed in the current window. Present when this response is rate limited.

X-RateLimit-Remaining
integer format: int32
<= 1000
Example
42

Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.

X-RateLimit-Reset
string format: date-time
<= 29 characters
Example
2026-03-20T15:31:00.000Z

Time when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.

Retry-After
integer format: int32
>= 1 <= 3600
Example
30

HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.

Access-Control-Allow-Origin
string
Allowed values: *
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.
Media typeapplication/json
object
type

URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.

string format: uri-reference
default: about:blank <= 2048 characters
title
required

Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).

string
<= 256 characters /^[^\p{C}]+$/
status
required

HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).

integer format: int32
>= 100 <= 599
detail

Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).

string
<= 500 characters
instance

URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).

string format: uri-reference
<= 2048 characters
code

Always MISSING_OR_INVALID_TOKEN on this response. Branch on this value, not on detail.

string
Allowed values: MISSING_OR_INVALID_TOKEN
Example
{
"type": "about:blank",
"title": "Unauthorized",
"status": 401,
"detail": "The bearer token is missing or invalid.",
"code": "MISSING_OR_INVALID_TOKEN"
}
X-RateLimit-Limit
integer format: int32
>= 1 <= 1000
Example
1000

Maximum number of requests allowed in the current window. Present when this response is rate limited.

X-RateLimit-Remaining
integer format: int32
<= 1000
Example
42

Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.

X-RateLimit-Reset
string format: date-time
<= 29 characters
Example
2026-03-20T15:31:00.000Z

Time when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.

Retry-After
integer format: int32
>= 1 <= 3600
Example
30

HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.

Access-Control-Allow-Origin
string
Allowed values: *
Example
*

CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.

The requested resource was not found.

Media typeapplication/json
object
type

URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.

string format: uri-reference
default: about:blank <= 2048 characters
title
required

Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).

string
<= 256 characters /^[^\p{C}]+$/
status
required

HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).

integer format: int32
>= 100 <= 599
detail

Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).

string
<= 500 characters
instance

URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).

string format: uri-reference
<= 2048 characters
code

Always NOT_FOUND on this response. The resource is not available to this caller.

string
Allowed values: NOT_FOUND
Example
{
"type": "about:blank",
"title": "Not Found",
"status": 404,
"detail": "The resource was not found.",
"code": "NOT_FOUND"
}
X-RateLimit-Limit
integer format: int32
>= 1 <= 1000
Example
1000

Maximum number of requests allowed in the current window. Present when this response is rate limited.

X-RateLimit-Remaining
integer format: int32
<= 1000
Example
42

Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.

X-RateLimit-Reset
string format: date-time
<= 29 characters
Example
2026-03-20T15:31:00.000Z

Time when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.

Retry-After
integer format: int32
>= 1 <= 3600
Example
30

HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.

Access-Control-Allow-Origin
string
Allowed values: *
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.

Media typeapplication/json
object
type

URI reference identifying the problem type. When absent, “about:blank” per RFC 9457 Section 3.1.1.

string format: uri-reference
default: about:blank <= 2048 characters
title
required

Short, human-readable summary of the problem type (RFC 9457 Section 3.1.3).

string
<= 256 characters /^[^\p{C}]+$/
status
required

HTTP status code for this occurrence (advisory; same as response status) (RFC 9457 Section 3.1.2).

integer format: int32
>= 100 <= 599
detail

Human-readable explanation specific to this occurrence (RFC 9457 Section 3.1.4).

string
<= 500 characters
instance

URI reference identifying the specific occurrence (RFC 9457 Section 3.1.5).

string format: uri-reference
<= 2048 characters
code

Always INTERNAL_ERROR on this response. Retry later. Do not retry a create in a tight loop.

string
Allowed values: INTERNAL_ERROR
Example
{
"type": "about:blank",
"title": "Internal Server Error",
"status": 500,
"detail": "The request could not be completed.",
"code": "INTERNAL_ERROR"
}
X-RateLimit-Limit
integer format: int32
>= 1 <= 1000
Example
1000

Maximum number of requests allowed in the current window. Present when this response is rate limited.

X-RateLimit-Remaining
integer format: int32
<= 1000
Example
42

Number of requests still allowed in the current window. 0 means the next call can return 429 until the window resets.

X-RateLimit-Reset
string format: date-time
<= 29 characters
Example
2026-03-20T15:31:00.000Z

Time when the current window resets, as ISO 8601 UTC. After this time, X-RateLimit-Remaining starts over.

Retry-After
integer format: int32
>= 1 <= 3600
Example
30

HTTP Retry-After value in seconds. Wait at least this long before retrying a 429 response.

Access-Control-Allow-Origin
string
Allowed values: *
Example
*

CORS Access-Control-Allow-Origin value. Origin allowed to read this response from a browser. * means any origin may read it.