younifyd
Menu

Replace Roles For User

Replace the role set for a user.

PUT/v2025-07-11/access/{resourceType}/{resourceId}/users/{sanityUserId}/roles

Use it in a workflow

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

Request

Path parameters

resourceTypestringrequired

The resource type to scope the access requests to.

One oforganizationprojectmedia-librarycanvasdashboardviewknowledge-base

resourceIdstringrequired

The resource ID to scope the access request to. Must be a valid ID for the resource type.

sanityUserIdstringrequired

The User ID

Request body

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

roleNamesarray<string>required
json
{
  "roleNames": [
    "string"
  ]
}

Response

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

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