Admin

Create a custom role

POST
/api/v1/roles

Defines a merchant-scoped role from an explicit permission set. Every code is validated against the permission catalogue, and a creator can never grant a permission they do not hold themselves.

Authorization

HTTPBearer
AuthorizationBearer <token>

JWT access token

In: header

Query Parameters

merchant_id?|

Optional merchant to act on. Must be one you are a member of.

Formatuuid

Header Parameters

X-Merchant-ID?string|null

Request Body

application/json

A merchant-defined role.

permissions is validated against the Permission enum server-side, and a creator can never grant a permission they do not themselves hold.

description?string
Lengthlength <= 500
Default""
name*string
Match^[A-Za-z][A-Za-z0-9 _-]*$
Length2 <= length <= 32
permissions*array<string>
Items1 <= items

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/roles" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "permissions": [      "string"    ]  }'
{  "data": {    "description": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "is_custom": false,    "name": "string",    "permissions": [      "string"    ]  },  "meta": {},  "success": true}