Skip to content

Mint Mcu Access Token

POST
/api/auth/mcu/token
curl --request POST \
--url https://example.com/api/auth/mcu/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "organization_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Mint a short-lived mcu_access ES256 token for the caller.

The caller must be an actual OrganizationMember of the target organization — deliberately NOT extending this backend’s usual superuser-bypasses-membership-checks convention (see app.core.deps.OrganizationAccess) here: a superuser with no membership row has no SoC role to federate, and MCU-Server’s MapSocRole() has no entry for “no role at all” beyond its own default-to-read_only, which would silently under- or over-grant rather than fail loudly.

Media type application/json
MCUAccessTokenRequest

Request body for POST /api/auth/mcu/token.

organization_id is optional — omit it to federate into the caller’s primary (first-created) organization membership, the same default app.core.auth_helpers.get_primary_organization_id uses for the native login JWT’s org_id claim. Pass it explicitly to federate into a different organization the caller is a member of.

object
organization_id
Any of:
string format: uuid
Example generated
{
"organization_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Successful Response

Media type application/json
MCUAccessTokenResponse

Response body for POST /api/auth/mcu/token.

object
expires_in
required
Expires In
integer
mcu_access_token
required
Mcu Access Token
string
organization_id
required
Organization Id
string format: uuid
token_type
Token Type
string
default: bearer
Example
{
"token_type": "bearer"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}