Activate or deactivate a user
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"}'const url = `${process.env.UNEEQ_API_URL}/external/v1/organization/${process.env.UNEEQ_ORG_ID}/users/{userID}/status`;const response = await fetch(url, { method: 'PUT', headers: { Authorization: `Bearer ${process.env.UNEEQ_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "status": "inactive" }),});console.log(response.status, await response.text());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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”ID of the organization the API key belongs to, for example org_HYPCX67vaupjhdTn.
Example
org_HYPCX67vaupjhdTnID of a member of the organization. Must be a lowercase hyphenated UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”object
New membership status.
Example
{ "status": "inactive"}Responses
Section titled “Responses”Status updated. No body.
userID is not a UUID, or status is missing or not active / inactive. Message “invalid request”,
no error_code.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
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.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}The user is not a member of the organization (message “not found”).
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}The account has been deleted. error_code is user_deleted.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
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.
The body of an error returned before the request reaches an endpoint (authentication and rate limiting).
object
Human-readable explanation of what went wrong.
Example generated
{ "error": "example"}Headers
Section titled “Headers”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.
The body of an error returned by an endpoint.
object
Human-readable explanation of what went wrong.
Stable machine-readable cause. Present only for errors that have one.
Example generated
{ "message": "example", "error_code": "example"}
