Skip to main content

Create a custom role

POST/v1/rolesTry it
View request and response examples ↓

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

Authorization

X-API-Keystring · headerrequired

API key for /v1 requests.

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 metadata and its required Warehouse permission set.

roleNamestringrequired

Custom role display name. Leading and trailing whitespace is removed.

Minimum length1
Maximum length30
Exampleanalytics-reader

Optional custom role description.

Maximum length200
ExampleRead-only access for the analytics team.
permissionsobject[]required

Warehouse permissions assigned to 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 created 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