Update user roles
Updates the roles of a user in Parchment
Integration Notes
- Role Management: This endpoint specifically handles user role assignments within an organization.
- Complete Replacement: The
access_rolesarray completely replaces the user’s current roles. - Role Validation: Invalid roles (not in the allowed list) will cause the request to fail with a 400 error.
- Authorization: Requires
update:userscope to modify user roles. - Request ID: Always log the
requestIdfor debugging support requests.
Request
Update User Roles
Assign Single Role
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
access_roles | string[] | Yes | Array of roles to assign to the user |
Valid Roles
The following roles can be assigned via this API:| Role | Description |
|---|---|
admin | Administrator with extensive permissions |
provider | Healthcare provider/prescriber |
receptionist | Manage Patients (no script access) |
rx_reader | Read-only access to prescriptions (needs to be combined with receptionist) |
rx_queue_manager | Manage prescription queues coming soon |
Validation Rules
- Required Field:
access_rolesis required and must be an array - Non-Empty Array:
access_rolesmust contain at least one role (cannot be empty) - Valid Roles: All roles must be from the supported roles list
Response
Success Response (200 OK)
Bad Request (400 Bad Request)
Invalid Roles
Empty After Filtering
User Not Found (404 Not Found)
Response Fields
Success Response Data
| Field | Type | Description |
|---|---|---|
user_id | string | Parchment’s unique user identifier |
access_roles | string[] | Updated array of roles assigned to user |
Common Response Fields
All responses include these standard fields:| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the request was successful |
statusCode | number | HTTP status code |
timestamp | string | ISO 8601 timestamp of the response |
requestId | string | Unique identifier for debugging |
Status Codes
| Code | Status | Description |
|---|---|---|
200 | OK | User roles successfully updated |
400 | Bad Request | Invalid request format or invalid parameters |
401 | Unauthorized | Authentication required or token invalid |
403 | Forbidden | Insufficient permissions (missing update:user scope) |
404 | Not Found | User not found |
409 | Conflict | Role update conflict |
422 | Unprocessable Entity | Request validation failed |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Unexpected server error |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Organization secret for authentication - provided by Parchment
Path Parameters
Organization ID
User ID
Body
User roles data to update in Parchment
User roles update request
Array of roles to assign to the user
Valid user roles. Note: owner, support, and member roles cannot be assigned via API.
admin, provider, receptionist, rx_reader, rx_queue_manager ["admin", "provider"]Response
User roles updated successfully
Indicates if the request was successful
true
HTTP status code
200
Human-readable success message
"User roles updated successfully"
User roles update response data
ISO 8601 timestamp of the response
"2024-01-15T10:30:00.000Z"
Unique identifier for request tracing
"req_1705312200000_abc123"
Pagination information for list operations

