Suspend a managed user or service account
DELETE/organizations/:organization_id/users/:user_id
Suspends the account. The record is kept and listed by GET .../users with isLocked: true, suspensionKind and lockMessage.
kind: temporary: the account keeps its API tokens and its identity-provider access, but every call it makes (REST, GraphQL and MCP tools) is answered402 PaymentRequiredwithmessageas the body'smessageanderror.data.kind: "temporary". Reactivating restores access with the same tokens. Use it for an unpaid or exhausted subscription.kind: permanent(default): a service account's tokens are revoked and a human is deactivated in the identity provider. Every call is answered401. A revoked token gets the genericUnauthorizedanswer, which does not carrymessage. Use it to terminate access.
reason is kept for your audit trail only. message is returned verbatim to a temporarily suspended user, so write it for them (who to contact, what to do). On a permanent suspension it is kept on the account (lockMessage) but a service account never sees it. Suspending an account that is already suspended answers 200 and replaces kind, reason and message (an omitted message clears it). A permanently suspended account cannot be switched to temporary without being reactivated first (409, error.name USER_SUSPENSION_PERMANENT).
Requires user:write, an enterprise organization, and at least the org-admin role.
Request
Responses
- 200
- 400
- 401
- 402
- 404
- 409
- 422
The suspended user, with suspensionKind and lockMessage set
An ID is not a valid integer
Caller lacks permission to suspend users in this organization
Payment required. Either the caller's account is temporarily suspended by its organization (error.name is PaymentRequired, error.data.kind is temporary, message is the organization's own text), or the caller's organization has no prepaid credit left for a metered call (no error.data). Or a sponsored read was refused because the sponsor's monthly quota for the caller's subscription is used up, or the sponsor suspended the subscription: message is the text to show (the sponsor's quotaMessage at the quota or suspensionMessage under suspension, or the default). The refusal is free and carries no cost envelope. A request that is refused in full is a 402 carrying the first refusal's message. A permanently suspended account gets 401 with error.name LOCKED and error.data.kind permanent instead.
Organization not found, or user not found in this organization
The user is permanently suspended and kind is temporary (error.name is USER_SUSPENSION_PERMANENT), reactivate the user first
Validation failed