---
title: "Update user role"
method: PATCH
path: "/v3/users/{userId}"
tags: ["Users"]
---

# Update user role

`PATCH /v3/users/{userId}`

Updates a user's role in the organization or profile. Requires admin role. You cannot change your own role or demote the last admin.

## Path parameters

- `userId` string, required

## Headers

- `Idempotency-Key` string
- `x-profile-id` string, uuid

## Request body

- SentDmServicesEndpointsCustomerAPIv3RequestsUpdateUserRequest — Request to update a user's role
  - `sandbox` boolean — Sandbox flag - when true, the operation is simulated without side effects Useful for testing integrations without actual execution
  - `role` string — User role: admin, billing, or developer (required)

## Response `200`

User role updated successfully

- SentDmServicesEndpointsCustomerAPIv3ResponsesApiResponseOfUserResponse — Standard API response envelope for all v3 endpoints
  - `success` boolean — Indicates whether the request was successful
  - `data` SentDmServicesEndpointsCustomerAPIv3ResponsesUserResponse — User response for v3 API
    - `id` string, uuid — User unique identifier
    - `email` string — User email address
    - `name` string — User full name
    - `role` string — User role in the organization: admin, billing, developer
    - `status` string — User status: active, invited, suspended, rejected
    - `invited_at` string, date-time, nullable — When the user was invited
    - `last_login_at` string, date-time, nullable — When the user last logged in
    - `created_at` string, date-time — When the user was added to the organization
    - `updated_at` string, date-time, nullable — When the user record was last updated
  - `error` SentDmServicesEndpointsCustomerAPIv3ResponsesApiError — Error information
    - `code` string — Machine-readable error code (e.g., "RESOURCE_001")
    - `message` string — Human-readable error message
    - `details` object, nullable — Additional validation error details (field-level errors)
    - `doc_url` string, nullable — URL to documentation about this error
  - `meta` SentDmServicesEndpointsCustomerAPIv3ResponsesApiMeta — Request and response metadata
    - `request_id` string — Unique identifier for this request (for tracing and support)
    - `timestamp` string, date-time — Server timestamp when the response was generated
    - `version` string — API version used for this request

## Other responses

- `400` — Invalid request parameters or cannot modify own role
- `401` — Unauthorized - Invalid API credentials
- `403` — Forbidden - User does not have admin access to this organization
- `404` — User not found
- `500` — Internal server error

---

[API](https://skmtc.net/sentdm/apis/sent-dm-api-v3.md) · [All operations](https://skmtc.net/sentdm/apis/sent-dm-api-v3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sentdm/sent-dm-api-v3/versions/c451eca46f1b/schema)
