younifyd
Menu

Get Role

Retrieve a Role

GET/roles/{id}

Use it in a workflow

  1. Add a step and choose the Directus connector.
  2. Pick the Get Role action (under Roles).
  3. Fill in the fields below, then reference the result from later steps as {{getRole.response.data}}.

Request

Path parameters

idstringrequired

Unique identifier for the object.

Query parameters

fieldsarray<string>

Control what fields are being returned in the object.

metastring

What metadata to return in the response.

Response

Returns 200 with an object. Read it in later steps with {{getRole.response.data.<field>}}.

dataobject
idstring (uuid)

Unique identifier for the role.

namestring

Name of the role.

iconstring

The role's icon.

descriptionstring

Description of the role.

parentstring (uuid)

Optional parent role that this role inherits permissions from. Many-to-one to roles.

childrenarray<oneOf>

Nested child roles that inherit this roles permissions. One-to-many to roles. One-to-many to roles.

policiesarray<oneOf>

The policies in this role. Many-to-many to roles.

usersarray<oneOf>

The users in this role. One-to-many to users.

json
{
  "data": {
    "id": "2f24211d-d928-469a-aea3-3c8f53d4e426",
    "name": "Administrator",
    "icon": "verified_user",
    "description": "Admins have access to all managed data within the system by default",
    "parent": "00000000-0000-0000-0000-000000000000",
    "children": [
      null
    ],
    "policies": [
      null
    ],
    "users": [
      null
    ]
  }
}

Need more? See the Directus guide for connection setup and behaviour shared by every action.

Was this page helpful?