Skip to content

Disable a user (admin or SOC)

PATCH
/api/admin/users/{id}/disable
curl --request PATCH \
--url https://example.com/api/admin/users/example/disable \
--header 'Content-Type: application/json' \
--header 'X-Ssoossh-Key-Secret: <X-Ssoossh-Key-Secret>' \
--data '{ "reason": "example" }'

Marks a user as disabled, preventing authentication. Service enrollments they approved are unaffected. The operation is idempotent. A caller cannot disable their own account.

id
required
string

User ID

Disable reason (required)

Media typeapplication/json

Disable reason (required)

object
reason
required

Reason explains why the user is being disabled. Required and server-validated (non-empty, length-capped): the next admin opening this account needs to learn why it was disabled, and an optional field does not get filled.

string

Example generated

{
"reason": "example"
}

Consequences of disabling

Media typeapplication/json
object
service_enrollment_count
required

ServiceEnrollmentCount is how many live enrollments this user approved. They are unaffected — reported so the dialog can say so with a number, which is the reassurance an admin disabling a colleague actually needs.

integer

Example generated

{
"service_enrollment_count": 1
}

Not authenticated

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

Not authorized as admin or SOC, or the target is the caller’s own account

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}

User not found

Media typeapplication/json
object
data

Data is always null on an error response.

error
required

Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.

string
error_code
required

ErrorCode is a machine-readable error classifier. One of the error_code constants from internal/apitypes; use this to decide whether to retry or branch on the failure mode.

string

Example

{
"error": "certificate request \"9f1c…\" not found",
"error_code": "not_found"
}