Disable a user (admin or SOC)
const url = 'https://example.com/api/admin/users/example/disable';const options = { method: 'PATCH', headers: { 'X-Ssoossh-Key-Secret': '<X-Ssoossh-Key-Secret>', 'Content-Type': 'application/json' }, body: '{"reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”User ID
Request Bodyrequired
Section titled “Request Bodyrequired”Disable reason (required)
Disable reason (required)
object
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.
Example generated
{ "reason": "example"}Responses
Section titled “Responses”Consequences of disabling
object
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.
Example generated
{ "service_enrollment_count": 1}Not authenticated
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
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.
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
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
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.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}User not found
object
Data is always null on an error response.
Error is a human-readable message. Branch on the HTTP status rather than this string; it is for humans and logs.
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.
Example
{ "error": "certificate request \"9f1c…\" not found", "error_code": "not_found"}