younifyd
Menu

Update Role Mappings

Create/update project role mappings

PUT/auth/organizations/{organizationId}/providers/{providerId}/projects/{projectId}/role-mappings

Use it in a workflow

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

Request

Path parameters

organizationIdstringrequired

The ID of the organization

providerIdstringrequired

The ID of the SSO provider

projectIdstringrequired

The ID of the project

Request body

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

fallbackRoleNamestring | null

The role for users who match no mapping. Set to `null` to remove the fallback. Omit to leave it unchanged.

roleMappingsarray<object>
idstring

The ID of an existing role mapping, as returned by this endpoint. Omit it to create a new mapping.

roleNamestring | null

The name of a Sanity role to assign. Required unless you're deleting the mapping.

groupRulestring | null

A regular expression matched against the user's SAML groups. Required unless you're deleting the mapping.

json
{
  "fallbackRoleName": "viewer",
  "roleMappings": [
    {
      "id": "string",
      "roleName": "editor",
      "groupRule": ".*-admin"
    }
  ]
}

Response

Returns 200 with a array<object>. Read it in later steps with {{updateRoleMappings.response.data.<field>}}.

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

Was this page helpful?