Post API v1 role

Changed on
post/api/v1/role/

Request

  • The document declares no server URL.
  • Auth: HTTP bearer

Request body

$schemastring uri

A URL to the JSON Schema for this object.

namestring required

Name of the role

Example request

{
  "$schema": "https://example.com/schemas/CreateRoleRequest.json",
  "name": "moderator",
  "permissions": [
    {
      "action": "create",
      "resource": "sport"
    }
  ]
}

Response

OK

$schemastring uri

A URL to the JSON Schema for this object.

idstring required

ID of the role

namestring required

Name of the role

Example response

{
  "$schema": "https://example.com/schemas/RoleResponse.json",
  "id": "1",
  "name": "admin",
  "permissions": [
    {
      "$schema": "https://example.com/schemas/PermissionResponse.json",
      "action": "create",
      "id": "1",
      "resource": "user"
    }
  ]
}

Changes