Roles

delete

Deletes a role.

Authorizations
Path parameters
namestringRequired
Responses
delete
DELETE /api/v1/roles/{name} HTTP/1.1
Host: api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

patch

Updates a role.

Authorizations
Path parameters
namestringRequired
Body

Updates a role. Absent fields are left untouched.

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
application/json
objectOptional

Bundles a list of permission statements with a name.

patch
PATCH /api/v1/roles/{name} HTTP/1.1
Host: api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 145

{
  "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-04-23T12:34:13.214Z",
  "policy": [
    {
      "action": "kafka:ListTopics",
      "resource": "text",
      "effect": "allow"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
get

Returns a specific role.

Authorizations
Path parameters
namestringRequired
Responses
application/json
objectOptional

Bundles a list of permission statements with a name.

get
GET /api/v1/roles/{name} HTTP/1.1
Host: api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "name": "text",
  "display_name": "text",
  "lrn": "text",
  "id": "text",
  "created_at": "2025-04-23T12:34:13.214Z",
  "policy": [
    {
      "action": "kafka:ListTopics",
      "resource": "text",
      "effect": "allow"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
post

Creates a new role.

Authorizations
Body

Contains the fields needed to create a role.

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
application/json
objectOptional

Bundles a list of permission statements with a name.

post
POST /api/v1/roles HTTP/1.1
Host: api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 159

{
  "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-04-23T12:34:13.214Z",
  "policy": [
    {
      "action": "kafka:ListTopics",
      "resource": "text",
      "effect": "allow"
    }
  ],
  "metadata": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
get

Returns all roles.

Authorizations
Responses
application/json
objectOptional

Contains a list of CompactRoles.

get
GET /api/v1/roles HTTP/1.1
Host: api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "name": "text",
      "display_name": "text",
      "lrn": "text",
      "id": "text",
      "created_at": "2025-04-23T12:34:13.214Z",
      "policy_length": 1,
      "metadata": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      }
    }
  ]
}

Last updated

Was this helpful?