Update user role
Updates a user's role in the organization or profile. Requires admin role. You cannot change your own role or demote the last admin.
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://api.sent.dm/v3/users/string" \ -H "Idempotency-Key: req_abc123_retry1" \ -H "Content-Type: application/json" \ -d '{ "role": "billing", "sandbox": false }'{
"success": true,
"data": {
"id": "aa0e8400-e29b-41d4-a716-446655440005",
"email": "user@example.com",
"name": "User Name",
"role": "billing",
"status": "active",
"invited_at": "2026-02-28T15:21:52.054139+00:00",
"last_login_at": "2026-03-31T10:21:52.0541416+00:00",
"created_at": "2026-02-28T15:21:52.054142+00:00",
"updated_at": "2026-03-31T15:21:52.0541421+00:00"
},
"error": null,
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0541425+00:00",
"version": "v3"
}
}{
"success": false,
"data": null,
"error": {
"code": "VALIDATION_001",
"message": "Request validation failed",
"details": {
"role": [
"Role must be one of: admin, billing, developer"
]
},
"doc_url": "https://docs.sent.dm/docs/reference/api/error-catalog"
},
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0541454+00:00",
"version": "v3"
}
}{
"success": false,
"data": null,
"error": {
"code": "AUTH_004",
"message": "You do not have admin access to this organization or profile",
"details": null,
"doc_url": "https://docs.sent.dm/docs/reference/api/authentication"
},
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0541459+00:00",
"version": "v3"
}
}{
"success": false,
"data": null,
"error": {
"code": "RESOURCE_006",
"message": "User not found",
"details": null,
"doc_url": "https://docs.sent.dm/docs/reference/api/error-catalog"
},
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0541463+00:00",
"version": "v3"
}
}{
"success": false,
"data": null,
"error": {
"code": "INTERNAL_001",
"message": "An unexpected error occurred. Please contact support with request ID: req_7X9zKp2jDw",
"details": null,
"doc_url": "https://docs.sent.dm/docs/reference/api/error-catalog"
},
"meta": {
"request_id": "req_7X9zKp2jDw",
"timestamp": "2026-03-31T15:21:52.0541479+00:00",
"version": "v3"
}
}Invite a user POST
Sends an invitation to a user to join the organization or profile with a specific role. Requires admin role. The user will receive an invitation email with a token to accept. Invitation tokens expire after 7 days.
Remove user DELETE
Removes a user's access to an organization or profile. Requires admin role. You cannot remove yourself or remove the last admin.