Mint Mcu Access Token
const url = 'https://example.com/api/auth/mcu/token';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"organization_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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://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.
Authorizations
Section titled “ Authorizations ”Request Bodyrequired
Section titled “ Request Bodyrequired ”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.
Example generated
{ "organization_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Responses
Section titled “ Responses ”Successful Response
Response body for POST /api/auth/mcu/token.
object
Example
{ "token_type": "bearer"}Validation Error
object
object
object
Example generated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}