younifyd
Menu

Add Role Assignment

Add a role to a user

PUT/projects/{projectId}/acl/{projectUserId}

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired

The ID of the project

projectUserIdstringrequired

The project user ID, which starts with `p`

Request body

Enter the body as JSON in the step's Body field.

roleNamestring

The name of the role to assign

roleNamesarray<string>

The names of several roles to assign

deleteExistingRolesboolean

Remove the user's other roles in the project

Default false

json
{
  "roleName": "editor",
  "roleNames": [
    "editor",
    "translator"
  ],
  "deleteExistingRoles": false
}

Response

Returns 201 with a any. Read it in later steps with {{addRoleAssignment.response.data.<field>}}.

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