oCoreoCore Docs
API Reference

Roles

List all available permissions

Returns all permission definitions that can be assigned to roles. Requires manage:roles permission.

GET
/permissions

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

curl -X GET "//api.ocore.dev/api/permissions" \
  -H "Authorization: <token>"

OK

{
  "permissions": [
    null
  ]
}

List organization roles

Returns all roles for the current organization including permissions and member counts.

GET
/roles

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

curl -X GET "//api.ocore.dev/api/roles" \
  -H "Authorization: <token>"

OK

{
  "roles": [
    null
  ]
}

Create a custom role

Creates a new custom role with the specified permissions. Requires manage:roles permission.

POST
/roles

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Request Body

application/jsonRequired

Role details

descriptionstring
namestring
permissionIdsarray<string>
curl -X POST "//api.ocore.dev/api/roles" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "string",
    "name": "string",
    "permissionIds": [
      "string"
    ]
  }'

Created

{
  "description": "string",
  "id": "string",
  "isSystem": true,
  "name": "string"
}

Delete a role

Deletes a role. Cannot delete the Owner role or roles with assigned members. Requires manage:roles permission.

DELETE
/roles/{id}

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Path Parameters

idRequiredstring

Role UUID

curl -X DELETE "//api.ocore.dev/api/roles/<string>" \
  -H "Authorization: <token>"

OK

{
  "message": "string"
}

Update a role

Updates a role's name, description, and permissions. Requires manage:roles permission.

PUT
/roles/{id}

Authorization

Authorization<token>

JWT Bearer token (format: Bearer {token})

In: header

Request Body

application/jsonRequired

Updated role details

descriptionstring
namestring
permissionIdsarray<string>

Path Parameters

idRequiredstring

Role UUID

curl -X PUT "//api.ocore.dev/api/roles/<string>" \
  -H "Authorization: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "string",
    "name": "string",
    "permissionIds": [
      "string"
    ]
  }'

OK

{
  "description": "string",
  "id": "string",
  "name": "string"
}

Was this page helpful?