Skip to content
UneeqUneeqUneeq Docs

Activate or deactivate a user

PUT
/external/v1/organization/{organizationID}/users/{userID}/status
curl --request PUT \
--url "$UNEEQ_API_URL/external/v1/organization/$UNEEQ_ORG_ID/users/{userID}/status" \
--header "Authorization: Bearer $UNEEQ_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"status": "inactive"
}'

Sets a member’s status in the organization to active or inactive. Deactivating removes the person’s sign-in access to the organization; activating restores it. A person who has never signed in only has their status changed.

Setting the status the member already has is allowed and re-applies the matching sign-in access, which can repair access that has drifted out of step. A deleted account cannot have its status changed; add the person to the organization again instead.

organizationID
required
string

ID of the organization the API key belongs to, for example org_HYPCX67vaupjhdTn.

Example

org_HYPCX67vaupjhdTn
userID
required
string format: uuid

ID of a member of the organization. Must be a lowercase hyphenated UUID.

Media typeapplication/json
object
status
required

New membership status.

string
Allowed values: active inactive

Example

{
"status": "inactive"
}

Status updated. No body.

userID is not a UUID, or status is missing or not active / inactive. Message “invalid request”, no error_code.

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}

The Authorization header is missing, or the API key is not valid for this organization. A key check that fails on the server is also reported as 401.

Media typeapplication/json

The body of an error returned before the request reaches an endpoint (authentication and rate limiting).

object
error
required

Human-readable explanation of what went wrong.

string

Example generated

{
"error": "example"
}

The user is not a member of the organization (message “not found”).

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}

The account has been deleted. error_code is user_deleted.

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}

The API key has sent too many requests. Wait for the number of seconds in Retry-After, then retry.

Media typeapplication/json

The body of an error returned before the request reaches an endpoint (authentication and rate limiting).

object
error
required

Human-readable explanation of what went wrong.

string

Example generated

{
"error": "example"
}
Retry-After
integer
>= 1

Seconds to wait before retrying.

The body is not valid JSON (“unable to decode request body”), or the status or sign-in access could not be updated. When sign-in access cannot be updated the status change is rolled back.

Media typeapplication/json

The body of an error returned by an endpoint.

object
message
required

Human-readable explanation of what went wrong.

string
error_code

Stable machine-readable cause. Present only for errors that have one.

string

Example generated

{
"message": "example",
"error_code": "example"
}