younifyd
Menu

Get Role

Get a role

GET/projects/{projectId}/roles/{roleName}

Use it in a workflow

  1. Add a step and choose the Sanity 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

projectIdstringrequired

The ID of the project

roleNamestringrequired

The name of the role

Response

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

namestring

The role name

titlestring

The role title

descriptionstring

A description of the role's permissions. An empty string if the role has no description.

isCustomboolean

Whether this is a custom role

projectIdstring

The ID of the project this role belongs to

appliesToUsersboolean

Whether the role can be given to users

appliesToRobotsboolean

Whether the role can be given to robots

grantsobject

Grants grouped by permission resource schema name, such as `sanity.project` or `sanity.document.filter.mode`.

json
{
  "name": "administrator",
  "title": "Administrator",
  "description": "Read and write access to all datasets, with full access to all project settings.",
  "isCustom": false,
  "projectId": "3do82whm",
  "appliesToUsers": true,
  "appliesToRobots": false,
  "grants": {}
}

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