Contract
- shape
- entity
- authority
- act
- evidence
- none
- subscription
- false
- permission
- any one of: staff.break_glass (staff.ops held in the Internal org, tradehq_role.staff_role, by a person the TRA-318 adoption logged as break-glass in tradehq_role.staff_role_log: Sage and Sonja only); a deactivated caller is refused first
- idempotency
- keyed
- emits
- session.impersonated
- MCP tool
- none
- decision_set
- approve, reject
- REST
- POST https://api.containertradehq.com/v1/cap/impersonate_user
Idempotency: keyed by the caller's Idempotency-Key, which is required: the same key and inputs replay the first result, the same key with other inputs is 409 idempotency_key_reused
Inputs
| name | type | required | validation |
|---|---|---|---|
| org_id | org_id | required | tradehq-org-id; 1 to 20 characters The org the caller holds an act grant to, and the user is a member of. |
| user_id | user_id | required | tradehq-user-id; 1 to 20 characters The member to sign in as. |
| reason | text | required | 1 to 500 characters Why, recorded with every act the session makes. |
| minutes | integer | optional | 5 to 240; default 30 How long the impersonated session may last: thirty minutes unless said. |
Response
impersonation_id· string · The impersonation.org_id· string · The org it is in.user_id· string · Who is impersonated.grant_id· string · The act grant that allows it.status· string · pending until the link is issued, then ready; failed, expired or ended.sign_in_url· stringnull · The one-time sign-in link, while status is ready: answered by get_impersonation alone, never by impersonate_user. Open it in a private window.token_expires_at· stringnull · When the link stops working.session_expires_at· string · When the impersonated session ends.failed· stringnull · Why the link could not be issued, when it could not.
Full JSON Schema
{
"type": "object",
"properties": {
"impersonation_id": {
"type": "string",
"pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$",
"format": "uuid",
"description": "The impersonation.",
"x-data-class": "operational"
},
"org_id": {
"type": "string",
"minLength": 1,
"maxLength": 20,
"pattern": "^[A-Za-z0-9_-]{1,20}$",
"format": "tradehq-org-id",
"description": "The org it is in.",
"x-data-class": "operational"
},
"user_id": {
"type": "string",
"minLength": 1,
"maxLength": 20,
"pattern": "^[A-Za-z0-9_-]{1,20}$",
"format": "tradehq-user-id",
"description": "Who is impersonated.",
"x-data-class": "operational"
},
"grant_id": {
"type": "string",
"pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$",
"format": "uuid",
"description": "The act grant that allows it.",
"x-data-class": "operational"
},
"status": {
"type": "string",
"enum": [
"pending",
"ready",
"failed",
"expired",
"ended"
],
"description": "pending until the link is issued, then ready; failed, expired or ended.",
"x-data-class": "operational"
},
"sign_in_url": {
"type": [
"string",
"null"
],
"description": "The one-time sign-in link, while status is ready: answered by get_impersonation alone, never by impersonate_user. Open it in a private window.",
"x-data-class": "operational"
},
"token_expires_at": {
"type": [
"string",
"null"
],
"format": "date-time",
"description": "When the link stops working.",
"x-data-class": "operational"
},
"session_expires_at": {
"type": "string",
"format": "date-time",
"description": "When the impersonated session ends.",
"x-data-class": "operational"
},
"failed": {
"type": [
"string",
"null"
],
"description": "Why the link could not be issued, when it could not.",
"x-data-class": "operational"
}
},
"required": [
"impersonation_id",
"org_id",
"user_id",
"grant_id",
"status",
"sign_in_url",
"token_expires_at",
"session_expires_at",
"failed"
],
"additionalProperties": false
} Refusals
idempotency_key_reused· 409 · the Idempotency-Key was sent before with other inputsretry_key_mismatch· 409 · the Idempotency-Key was already used with a different requestretry_key_in_flight· 409 · a request with this Idempotency-Key is still runningretry_key_lost· 409 · another request took over this Idempotency-Key first; nothing was appliedimpersonation_needs_an_act_grant· 422 · signing in as a member needs an active act grant to the orguser_not_impersonable· 422 · only a live member of the org who holds no staff role, and not the caller, can be signed in as
The platform refusals apply to every call: version, authentication, authority, validation and rate limits, each in the same envelope.
Surfaces
- Mobile: D6: the impersonated session opens in a browser on a desktop
- MCP: the answer carries a one-time sign-in link, which is never handed to an agent
- Voice: degraded: authority
- OneBox: no document originates an impersonation
- Outbound: crosses to no counterparty
Events
session.impersonatedaudit_only
Related
break_glass_access, grant_unit_role, list_sessions, list_unit_access, request_staff_grant, revoke_sessions, revoke_unit_role, set_member_role, suspend_org