Skip to main content

Update a custom role

PUT/v1/roles/{roleId}Try it
View request and response examples ↓

Updates a custom role in the authenticated organization. Requires an API Key with the OrganizationAdmin role and a RequestId header.

A non-blank roleName, a description, or a non-empty permissions array is required. Only supplied fields are updated. To clear the description, provide an empty or whitespace-only string. A non-empty permissions array replaces all custom role permissions. Updating a built-in role returns 400 InvalidParameter.

Authorization

X-API-Keystring · headerrequired

API key for /v1 requests.

Path parameters

roleIdstringrequired

Built-in or custom role identifier.

Examplerole1786692493123456

Headers

RequestIdstringrequired

Idempotency key for write requests.

Use a globally unique UUID or similar token for each logical write request. Never reuse a RequestId across different operations or payloads. You can safely retry the same RequestId only when the method, path, path parameters, query string, and request body are identical.

Minimum length1
Example8f6b0c2e-6a9a-4f2e-9c4c-0a1f9a2b7d31

Request body

application/jsonrequired

Custom role fields to update. A non-blank roleName, a description, or a non-empty permissions array is required. An empty or whitespace-only description clears the existing value. A non-empty permissions array replaces all custom role permissions.

roleNamestring

Updated custom role display name. Leading and trailing whitespace is removed.

Minimum length1
Maximum length30
Exampleanalytics-viewer

Updated custom role description. Provide an empty or whitespace-only string to clear the existing description.

Maximum length200
ExampleRead-only access for analytics users.
permissionsobject[]

Replacement Warehouse permission set for the custom role.

Minimum items1
Item fields
warehouseIdstringrequired

Warehouse ID in the authenticated organization.

Examplewh-123
actionintegerrequired

Valid values are 1 (Warehouse View), 2 (Warehouse Management), and 3 (Public warehouse access).

Allowed values123
Example1

Response

Custom role updated successfully.

application/json
successbooleanrequired

Indicates whether the request succeeded.

Exampletrue
requestIdstringrequired

Request ID returned by the server for tracing.

Examplereq-20260402-001
dataobjectrequired
Child fields
roleIdstringrequired

Stable role identifier.

Examplerole1786692493123456
roleNamestringrequired

Role display name.

Exampleanalytics-reader
descriptionstringrequired

Role description.

ExampleRead-only access for the analytics team.
builtInbooleanrequired

Whether the role is a read-only built-in role.

Examplefalse
permissionsobject[]required

Warehouse permissions effective for the role.

Item fields

Stored permission identifier for custom roles, when available.

Exampleorg-123_wh-123_1
warehouseIdstringrequired

Warehouse ID.

Examplewh-123

Warehouse display name, when available.

Exampleanalytics
actionintegerrequired

Valid values are 1 (Warehouse View), 2 (Warehouse Management), and 3 (Public warehouse access).

Allowed values123
Example1
createdAtstring · date-time

Creation timestamp for a custom role. Omitted for built-in roles.

Example2026-08-14T08:30:00Z
updatedAtstring · date-time

Last updated timestamp for a custom role. Omitted for built-in roles.

Example2026-08-14T08:30:00Z

Enter to send · Shift+Enter for a new line