Skip to the content

DoRoutes API · version 1

Roles

GET/v1/admin/permissions

Every permission

Any signed-in staff member.

Response 200 · object

Done.

  • permissionsarray of Permission, required
    • namestring, required
    • descriptionstring, required
Example response 200
{
  "permissions": [
    {
      "name": "string",
      "description": "string"
    }
  ]
}

Response 401 · Error

No tenant key, or no valid session.

  • errorobject, required
    • codestring, required

      A short machine-readable name, such as not_found.

    • messagestring, required

      What went wrong, for people.

  • request_idstring, required

    Matches the X-Request-ID response header.

Example response 401
{
  "error": {
    "code": "string",
    "message": "string"
  },
  "request_id": "string"
}

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

GET/v1/admin/me/permissions

The permissions the signed-in staff member holds

Any signed-in staff member.

Response 200 · object

Done.

  • permissionsarray of string, required
Example response 200
{
  "permissions": [
    "string"
  ]
}

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

GET/v1/admin/roles

The business's roles

Any signed-in staff member.

Response 200 · object

Done.

  • rolesarray of Role, required
    • idinteger (int64), required
    • namestring, required
    • protectedboolean, required

      Only the Owner role; it holds every permission and cannot be changed.

    • permissionsarray of string or null
Example response 200
{
  "roles": [
    {
      "id": 0,
      "name": "string",
      "protected": true,
      "permissions": [
        "string"
      ]
    }
  ]
}

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

POST/v1/admin/roles

Create a role

Needs the roles.manage permission.

Request body · object

  • namestring, required
  • permissionsarray of string
Example request
{
  "name": "string",
  "permissions": [
    "string"
  ]
}

Response 200 · object

Done.

  • roleRole, required
    • idinteger (int64), required
    • namestring, required
    • protectedboolean, required

      Only the Owner role; it holds every permission and cannot be changed.

    • permissionsarray of string or null
Example response 200
{
  "role": {
    "id": 0,
    "name": "string",
    "protected": true,
    "permissions": [
      "string"
    ]
  }
}

Response 400 · Error

The request is not valid.

Fields as in Every permission

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 404 · Error

Not found, or not yours.

Fields as in Every permission

Response 409 · Error

It clashes with what is stored.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

PUT/v1/admin/roles/{id}

Change a role

Needs the roles.manage permission.

Parameters

  • idstring, in the path, required

Request body · object

  • namestring, required
  • permissionsarray of string
Example request
{
  "name": "string",
  "permissions": [
    "string"
  ]
}

Response 200 · object

Done.

  • roleRole, required
    • idinteger (int64), required
    • namestring, required
    • protectedboolean, required

      Only the Owner role; it holds every permission and cannot be changed.

    • permissionsarray of string or null
Example response 200
{
  "role": {
    "id": 0,
    "name": "string",
    "protected": true,
    "permissions": [
      "string"
    ]
  }
}

Response 400 · Error

The request is not valid.

Fields as in Every permission

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 404 · Error

Not found, or not yours.

Fields as in Every permission

Response 409 · Error

It clashes with what is stored.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

DELETE/v1/admin/roles/{id}

Delete a role

Needs the roles.manage permission.

Parameters

  • idstring, in the path, required

Response 200 · Message

Done.

  • messagestring, required
Example response 200
{
  "message": "string"
}

Response 400 · Error

The request is not valid.

Fields as in Every permission

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 404 · Error

Not found, or not yours.

Fields as in Every permission

Response 409 · Error

It clashes with what is stored.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

GET/v1/admin/user/{user_id}/roles

A staff member's roles

Any signed-in staff member.

Parameters

  • user_idstring, in the path, required

Response 200 · object

Done.

  • rolesarray of Role, required
    • idinteger (int64), required
    • namestring, required
    • protectedboolean, required

      Only the Owner role; it holds every permission and cannot be changed.

    • permissionsarray of string or null
Example response 200
{
  "roles": [
    {
      "id": 0,
      "name": "string",
      "protected": true,
      "permissions": [
        "string"
      ]
    }
  ]
}

Response 400 · Error

The request is not valid.

Fields as in Every permission

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 404 · Error

Not found, or not yours.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission

PUT/v1/admin/user/{user_id}/roles

Set a staff member's roles

Needs the staff.manage permission.

Parameters

  • user_idstring, in the path, required

Request body · object

  • role_idsarray of integer (int64), required
Example request
{
  "role_ids": [
    0
  ]
}

Response 200 · Message

Done.

Fields as in Delete a role

Response 400 · Error

The request is not valid.

Fields as in Every permission

Response 401 · Error

No tenant key, or no valid session.

Fields as in Every permission

Response 403 · Error

The session may not do this.

Fields as in Every permission

Response 404 · Error

Not found, or not yours.

Fields as in Every permission

Response 409 · Error

It clashes with what is stored.

Fields as in Every permission

Response 500 · Error

Something failed on our side.

Fields as in Every permission