Users

Update a user

Edits a user's `name` and/or account `role` (Site Crew ⇄ Admin) and returns the updated user. The key is tenant-Admin-equivalent: it can't change its own acting admin's role, nor demote the **last** admin (either is `403`). Email and password are not editable here — use `POST /users/{id}/reset-password` for the password. Provide at least one of `name`/`role` (an empty body is `422`).

PATCH
/users/{id}

Edits a user's name and/or account role (Site Crew ⇄ Admin) and returns the updated user. The key is tenant-Admin-equivalent: it can't change its own acting admin's role, nor demote the last admin (either is 403). Email and password are not editable here — use POST /users/{id}/reset-password for the password. Provide at least one of name/role (an empty body is 422).

Authorization

x-api-key<token>

The per-tenant API key, copied from Settings → API & integrations. Sent as the x-api-key request header. The key is tenant-scoped and acts with Admin-equivalent, tenant-wide access.

In: header

Path Parameters

id*string

Resource id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/users/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "email": "user@example.com",  "role": "admin",  "status": "active",  "projectIds": [    "b2d9859a-b2e9-4f49-b393-9a25d0eff2f8"  ]}
{  "error": {    "code": "unauthorized",    "message": "Missing or invalid API key."  }}
{  "error": {    "code": "read_only",    "message": "Your subscription is inactive. This action is read-only."  }}
{  "error": {    "code": "not_found",    "message": "Not found."  }}
{  "error": {    "code": "validation",    "message": "One or more inputs are invalid.",    "fields": {      "fieldName": "A message explaining what's wrong with this field."    }  }}