Get available roles for API key creation

​

Returns the list of roles that can be assigned to an API key.

Returns all roles at or below the acting credential's privilege level based on the role hierarchy. Also includes an "Inherit My Roles" option for sessions and inheriting keys; it is omitted when the caller is a role-scoped API key, which cannot mint an inheriting key.

Use ?sort=asc (default) for least privileged first (API key management page). Use ?sort=desc for most privileged first (user profile page).

Query Parameters

  • Sort order - asc for least privileged first, desc for most privileged first

Responses

  • application/json
  • application/json
Request Example for get/auth/api-keys/options/roles
curl 'https://api.gpcn.com/v1/auth/api-keys/options/roles?sort=asc' \
  --header 'X-API-Key: YOUR_SECRET_TOKEN'
{
  "success": true,
  "message": "string",
  "data": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "name": "string",
      "displayName": "string",
      "description": "string",
      "sortOrder": 1
    }
  ],
  "meta": null
}