Contract
- shape
- entity
- authority
- act
- evidence
- none
- subscription
- false
- permission
- any one of: staff.ops (the staff role staff_ops held in the Internal org, tradehq_role.staff_role); account.owner (account role owner or higher in at least one account; the call is scoped to those accounts); a deactivated caller is refused first
- idempotency
- natural
- emits
- account_role.changed
- MCP tool
- set_account_role
- decision_set
- approve, reject, escalate
- REST
- POST https://api.containertradehq.com/v1/cap/set_account_role
Through MCP this call returns an approval request first; see Approvals.
Idempotency: keyed by the contract's own inputs: the same inputs replay the first call's result
Inputs
| name | type | required | validation |
|---|---|---|---|
| account_id | account_id | required | tradehq-account-id The account. |
| user_id | user_id | required | tradehq-user-id; 1 to 20 characters The person, a member of one of the account's entities. |
| role | one_of | required | one of owner, member owner or member. |
Response
account_id· string · The account.user_id· string · The person.role· string · The role they now hold.previous_role· stringnull · The role they held before; null when they held none.
Full JSON Schema
{
"type": "object",
"properties": {
"account_id": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
"format": "tradehq-account-id",
"description": "The account.",
"x-data-class": "operational"
},
"user_id": {
"type": "string",
"minLength": 1,
"maxLength": 20,
"pattern": "^[A-Za-z0-9_-]{1,20}$",
"format": "tradehq-user-id",
"description": "The person.",
"x-data-class": "operational"
},
"role": {
"type": "string",
"enum": [
"owner",
"member"
],
"description": "The role they now hold.",
"x-data-class": "operational"
},
"previous_role": {
"type": [
"string",
"null"
],
"enum": [
"owner",
"member",
null
],
"description": "The role they held before; null when they held none.",
"x-data-class": "operational"
}
},
"required": [
"account_id",
"user_id",
"role",
"previous_role"
],
"additionalProperties": false
} Refusals
last_account_owner· 422 · the change would leave the account with no owneraccount_person_not_in_entity· 422 · the person is a member of none of the account's entitiesuser_deactivated· 422 · the person is deactivated, so they are neither added nor made an owner
The platform refusals apply to every call: version, authentication, authority, validation and rate limits, each in the same envelope.
Surfaces
- MCP: approval required
- Voice: degraded: confirmation
- OneBox: no document originates an account role change
- Outbound: crosses to no counterparty
Events
account_role.changedaudit_only
Related
None.