Roles

get

Returns all roles.

Authorizations
Responses
curl -L \
  --url 'https://api.example.com/api/v1/roles' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "items": [
    {
      "name": "text",
      "display_name": "text",
      "lrn": "text",
      "id": "text",
      "created_at": "2025-03-26T04:09:54.246Z",
      "policy_length": 1,
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      }
    }
  ]
}
post

Creates a new role.

Authorizations
Body
namestring · hq-resource-name · min: 1 · max: 63required

Sets the unique name of the new role. It must be a valid HQ resource name: it can only contain lowercase alphanumeric characters or hyphens; hyphens cannot appear at the end or start; the length is 63 characters at most.

display_namestring · min: 1 · max: 150optional

Sets the display name of the new role. If not provided, the value of "name" will be used.

policyobject[]required

Contains a list of permission statements.

metadataobjectoptional

Allows attaching custom string key/values to resources. The following maxima apply:

  • 50 keys/values;
  • 40 bytes key length;
  • 500 bytes value length.

Responses
curl -L \
  --request POST \
  --url 'https://api.example.com/api/v1/roles' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "text",
    "display_name": "text",
    "policy": [
      {
        "action": "kafka:ListTopics",
        "resource": "text",
        "effect": "allow"
      }
    ],
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    }
  }'
{
  "name": "text",
  "display_name": "text",
  "lrn": "text",
  "id": "text",
  "created_at": "2025-03-26T04:09:54.246Z",
  "policy": [
    {
      "action": "kafka:ListTopics",
      "resource": "text",
      "effect": "allow"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
get

Returns a specific role.

Authorizations
Path parameters
namestringrequired
Responses
curl -L \
  --url 'https://api.example.com/api/v1/roles/{name}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
  "name": "text",
  "display_name": "text",
  "lrn": "text",
  "id": "text",
  "created_at": "2025-03-26T04:09:54.246Z",
  "policy": [
    {
      "action": "kafka:ListTopics",
      "resource": "text",
      "effect": "allow"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
patch

Updates a role.

Authorizations
Path parameters
namestringrequired
Body
display_namestring · min: 1 · max: 150optional

Updates the display name of the role.

policyobject[]optional

Sets, if specififed, the new permission statements.

metadataobjectoptional

Patches metadata. It has the following semantics:

  • Absent keys are left untouched;
  • Null values are deleted;
  • Non-null values are replaced.

Responses
curl -L \
  --request PATCH \
  --url 'https://api.example.com/api/v1/roles/{name}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "display_name": "text",
    "policy": [
      {
        "action": "kafka:ListTopics",
        "resource": "text",
        "effect": "allow"
      }
    ],
    "metadata": {
      "ANY_ADDITIONAL_PROPERTY": "text"
    }
  }'
{
  "name": "text",
  "display_name": "text",
  "lrn": "text",
  "id": "text",
  "created_at": "2025-03-26T04:09:54.246Z",
  "policy": [
    {
      "action": "kafka:ListTopics",
      "resource": "text",
      "effect": "allow"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
delete

Deletes a role.

Authorizations
Path parameters
namestringrequired
Responses
curl -L \
  --request DELETE \
  --url 'https://api.example.com/api/v1/roles/{name}' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'

No body

Last updated

Was this helpful?