Access
Roles, grants and class-level access control.
9 endpoints · Plakar Control Plane v0.18 · Base URL, authentication and errors
List the grants
/api/v1/account/organizations/{id}/access
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s.
Query parameters
-
offsetintegerNumber of items to skip.Default: 0 -
limitintegerMaximum number of items to return.Default: 100 Min: 1 Max: 100 -
searchstringFree-text search on grants.
Response 200 OK application/json
-
itemsarray[object]-
created_atstring<date-time> -
idstring<uuid> -
roleobject-
categorystring -
display_namestring -
namestring
-
-
subjectobject-
emailstring nullable -
idstring<uuid> -
is_serviceboolean nullable -
member_countinteger nullable -
namestring -
typestring
-
-
-
totalinteger
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl 'https://pcp.example.com/api/v1/account/organizations/{id}/access' \
-H 'Authorization: Bearer <badge>'Response 200
{
"items": [
{
"created_at": "2026-01-01T00:00:00Z",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"role": {
"category": "string",
"display_name": "string",
"name": "string"
},
"subject": {
"email": "string",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"is_service": true,
"member_count": 0,
"name": "string",
"type": "string"
}
}
],
"total": 0
}Create a grant
/api/v1/account/organizations/{id}/access
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s.
Request body application/json required
-
role_namestring required -
subject_idstring<uuid> -
subject_typestring required
Response 200 OK application/json
-
created_atstring<date-time> -
idstring<uuid> -
roleobject-
categorystring -
display_namestring -
namestring
-
-
subjectobject-
emailstring nullable -
idstring<uuid> -
is_serviceboolean nullable -
member_countinteger nullable -
namestring -
typestring
-
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X POST 'https://pcp.example.com/api/v1/account/organizations/{id}/access' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"role_name": "string",
"subject_id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"subject_type": "string"
}'Response 200
{
"created_at": "2026-01-01T00:00:00Z",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"role": {
"category": "string",
"display_name": "string",
"name": "string"
},
"subject": {
"email": "string",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"is_service": true,
"member_count": 0,
"name": "string",
"type": "string"
}
}Get a grant
/api/v1/account/organizations/{id}/access/{grant_id}
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s. -
grant_idstring required
Response 200 OK application/json
-
created_atstring<date-time> -
idstring<uuid> -
roleobject-
categorystring -
display_namestring -
namestring
-
-
subjectobject-
emailstring nullable -
idstring<uuid> -
is_serviceboolean nullable -
member_countinteger nullable -
namestring -
typestring
-
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl 'https://pcp.example.com/api/v1/account/organizations/{id}/access/{grant_id}' \
-H 'Authorization: Bearer <badge>'Response 200
{
"created_at": "2026-01-01T00:00:00Z",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"role": {
"category": "string",
"display_name": "string",
"name": "string"
},
"subject": {
"email": "string",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"is_service": true,
"member_count": 0,
"name": "string",
"type": "string"
}
}Update a grant
/api/v1/account/organizations/{id}/access/{grant_id}
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s. -
grant_idstring required
Request body application/json required
-
role_namestring required -
subject_idstring<uuid> -
subject_typestring nullable
Response 200 OK application/json
-
created_atstring<date-time> -
idstring<uuid> -
roleobject-
categorystring -
display_namestring -
namestring
-
-
subjectobject-
emailstring nullable -
idstring<uuid> -
is_serviceboolean nullable -
member_countinteger nullable -
namestring -
typestring
-
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X PUT 'https://pcp.example.com/api/v1/account/organizations/{id}/access/{grant_id}' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"role_name": "string",
"subject_id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"subject_type": "string"
}'Response 200
{
"created_at": "2026-01-01T00:00:00Z",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"role": {
"category": "string",
"display_name": "string",
"name": "string"
},
"subject": {
"email": "string",
"id": "3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90",
"is_service": true,
"member_count": 0,
"name": "string",
"type": "string"
}
}Revoke a grant
/api/v1/account/organizations/{id}/access/{grant_id}
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s. -
grant_idstring required
Response 200 OK application/json
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X DELETE 'https://pcp.example.com/api/v1/account/organizations/{id}/access/{grant_id}' \
-H 'Authorization: Bearer <badge>'Response 200
{}Get the access control of a class
/api/v1/account/organizations/{id}/classes/{subject}/access
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s. -
subjectstring required
Response 200 OK application/json
-
can_executearray[string] -
can_ownarray[string] -
can_readarray[string] -
can_writearray[string]
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl 'https://pcp.example.com/api/v1/account/organizations/{id}/classes/{subject}/access' \
-H 'Authorization: Bearer <badge>'Response 200
{
"can_execute": [
"string"
],
"can_own": [
"string"
],
"can_read": [
"string"
],
"can_write": [
"string"
]
}Set the access control of a class
/api/v1/account/organizations/{id}/classes/{subject}/access
Path parameters
-
idstring<uuid> requiredOrganization ID, at or below the caller’s. -
subjectstring required
Request body application/json required
-
assignmentsarray[object]-
group_idsarray[string<uuid>] required -
rolestring required
-
-
confirm_widenboolean
Response 200 OK application/json
-
can_executearray[string] -
can_ownarray[string] -
can_readarray[string] -
can_writearray[string]
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl -X PUT 'https://pcp.example.com/api/v1/account/organizations/{id}/classes/{subject}/access' \
-H 'Authorization: Bearer <badge>' \
-H 'Content-Type: application/json' \
-d '{
"assignments": [
{
"group_ids": [
"3f1e4a2c-9b7d-4e0f-8a11-2c5d6e7f8a90"
],
"role": "string"
}
],
"confirm_widen": true
}'Response 200
{
"can_execute": [
"string"
],
"can_own": [
"string"
],
"can_read": [
"string"
],
"can_write": [
"string"
]
}List the roles
/api/v1/roles
Query parameters
-
categorystringOnly roles of this category.Allowed: standard, advanced
Response 200 OK application/json
-
builtinboolean -
categorystring -
conflicts_witharray[object] nullable-
reasonstring nullable -
rolestring
-
-
descriptionstring -
display_namestring -
grantsarray[object]-
accessobject-
can_authorboolean -
can_deleteboolean -
can_executeboolean -
can_viewboolean
-
-
resource_typestring
-
-
namestring -
rolls_up_tostring nullable
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl 'https://pcp.example.com/api/v1/roles' \
-H 'Authorization: Bearer <badge>'Response 200
[
{
"builtin": true,
"category": "string",
"conflicts_with": [
{
"reason": "string",
"role": "string"
}
],
"description": "string",
"display_name": "string",
"grants": [
{
"access": {
"can_author": true,
"can_delete": true,
"can_execute": true,
"can_view": true
},
"resource_type": "string"
}
],
"name": "string",
"rolls_up_to": "string"
}
]Get a role
/api/v1/roles/{role_name}
Path parameters
-
role_namestring required
Response 200 OK application/json
-
builtinboolean -
categorystring -
conflicts_witharray[object] nullable-
reasonstring nullable -
rolestring
-
-
descriptionstring -
display_namestring -
grantsarray[object]-
accessobject-
can_authorboolean -
can_deleteboolean -
can_executeboolean -
can_viewboolean
-
-
resource_typestring
-
-
namestring -
rolls_up_tostring nullable
Errors
- 400 Bad Request (validation or deserialization error)
- 401 Missing, invalid or expired credentials
- 403 The caller may not do this
- 500 Internal Server Error (panics)
Every error returns the standard error body.
Request
curl 'https://pcp.example.com/api/v1/roles/{role_name}' \
-H 'Authorization: Bearer <badge>'Response 200
{
"builtin": true,
"category": "string",
"conflicts_with": [
{
"reason": "string",
"role": "string"
}
],
"description": "string",
"display_name": "string",
"grants": [
{
"access": {
"can_author": true,
"can_delete": true,
"can_execute": true,
"can_view": true
},
"resource_type": "string"
}
],
"name": "string",
"rolls_up_to": "string"
}