Create a role

​

Create a custom role for your organization. Permissions must come from the permission catalog. Reuse the Idempotency-Key and identical body when retrying the same creation.

Headers

  • Unique for seven days. Reuse with the same body returns the original response.

Body

required
application/json

Responses

  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/external/v2/roles
curl https://sales-api.artemis.solar/external/v2/roles \
  --request POST \
  --header 'Idempotency-Key: project-coordinator-role-1' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: YOUR_SECRET_TOKEN' \
  --data '{
  "name": "Project coordinator",
  "description": "Coordinates assigned projects",
  "permissions": [
    "project:view_team",
    "project:edit_details"
  ]
}'
Custom role created
{
  "data": {
    "id": "da7c1b2e-39f4-4c95-a816-8e27b4d1f530",
    "name": "Project coordinator",
    "description": "Coordinates assigned projects",
    "permissions": [
      "project:view_team",
      "project:edit_details"
    ],
    "createdAt": "2026-09-05T12:00:00.000Z",
    "updatedAt": "2026-09-05T12:00:00.000Z"
  }
}