API Reference
API Reference

Create Role

Create a new role.

POST/api/v1/roles/

Authentication

Syllable-API-Keyrequired

Send Syllable-API-Key in the header.

Need a credential? Create or manage an API token in the Syllable Console.

Parameters

This endpoint has no declared parameters.

Request body

application/json

body RoleCreateRequest required
3 fields
namestringrequired

The name of the role.

descriptionstring | nulloptional

The description of the role.

permissionsstring[]required

The permissions associated with the role. Available permissions can be found by calling GET /permissions.

Item schema
itemsstringrequired
Request example
{
  "name": "string",
  "description": "string",
  "permissions": [
    "string"
  ]
}

Responses

200Successful Response

application/json

response RoleResponse required
8 fields
namestringrequired

The name of the role.

descriptionstring | nulloptional

The description of the role.

permissionsstring[]required

The permissions associated with the role. Available permissions can be found by calling GET /permissions.

Item schema
itemsstringrequired
idintegerrequired

The internal ID of the role.

last_updated_commentsstring | nulloptional

Comments for the most recent edit to the role.

is_system_rolebooleanrequired

Whether this is a built-in system role that cannot be updated or deleted

last_updatedstring (date-time)required

The timestamp of the most recent update to the role

last_updated_bystringrequired

The email of the user who last updated the role

Response example
{
  "name": "string",
  "description": "string",
  "permissions": [
    "string"
  ],
  "id": 0,
  "last_updated_comments": "string",
  "is_system_role": true,
  "last_updated": "string",
  "last_updated_by": "string"
}
422Validation Error

application/json

response HTTPValidationError required
1 field
detailValidationError[]optional
Item schema
itemsValidationErrorrequired
3 fields
locstring | integer[]required
Item schema
itemsstring | integerrequired
2 options
Option 1stringrequired
Option 2integerrequired
msgstringrequired
typestringrequired
Response example
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}