Assign Role to Client

POST /v1/endpoints/{uuid}/rbac/memberships

Grant a role to an RBAC client. Memberships are the join table between clients and roles — one client can have many roles, one role can be held by many clients.

To remove a membership, use DELETE .../rbac/memberships. To list all memberships use GET .../rbac/memberships.

Not idempotent — granting a role the client already holds returns 409 Conflict. Plan-gated: requires the rbac entitlement on your plan.

Path parameters

uuid string (uuid) Req
The endpoint's uuid from /endpoints.

Request body

client_uuid string (uuid) Req
The RBAC client's uuid. Resolved under this endpoint only.
role_uuid string (uuid) Req
The uuid of the role to assign. Resolved under this endpoint only.

Deprecated: client_id and role_id (integers) are still accepted until the sunset. Send client_uuid and role_uuid; sending both forms for different objects is a 400 id_uuid_mismatch.

Response (200 OK)

Returns the full updated memberships array for the endpoint (same shape as List Role Memberships), not just the new pairing.

Deprecated: until the sunset this response also carries the legacy integer id, client_id, role_id and assigned_by fields. Don't use them; read the *_uuid fields.

Errors

400 Bad Request
Missing client_uuid or role_uuid (client_uuid and role_uuid are required), a malformed uuid (client_uuid must be a uuid), both forms naming different objects (id_uuid_mismatch), an integer after the sunset (integer_id_unsupported), unknown fields, or invalid JSON.
401 Unauthorized
Missing auth.
403 Forbidden
Caller lacks endpoints:write, or the plan doesn't include the rbac entitlement.
404 Not Found
Endpoint doesn't belong to the calling account, or the referenced client / role isn't one of this endpoint's (client_uuid not found / role_uuid not found).
409 Conflict
The client already holds this role.
Request
curl -X POST "https://api.ngris.com/v1/endpoints/019bb1e4-e785-77d2-9966-c3cff31d0a0e/rbac/memberships" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{"client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee", "role_uuid": "019b6243-8510-7cbb-a69c-6e29c89b0d65"}'
Python
from ngris import Ngris client = Ngris(api_key="<your_api_key>") client.endpoint_rbac.create_membership("019bb1e4-e785-77d2-9966-c3cff31d0a0e", { "client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee", "role_uuid": "019b6243-8510-7cbb-a69c-6e29c89b0d65", })
Response — 200 OK
[ {"client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee", "role_uuid": "019b5fc1-0eb5-7dd8-a0e9-a575428f890d", "assigned_by_uuid": "019a52c2-ca1e-78ba-ab5c-50362cc29134", "created_at": "2026-04-01T00:00:00Z", "updated_at": "2026-04-01T00:00:00Z"}, {"client_uuid": "019b4b9d-d300-736b-8601-153b3d9f70ee", "role_uuid": "019b6243-8510-7cbb-a69c-6e29c89b0d65", "assigned_by_uuid": "019a52c2-ca1e-78ba-ab5c-50362cc29134", "created_at": "2026-04-29T13:00:00Z", "updated_at": "2026-04-29T13:00:00Z"} ]
Was this helpful?
On this page
Assign Role to Client
Was this helpful?