younifyd
Menu

Create Role Access Api

Create a role

POST/v2025-07-11/access/{resourceType}/{resourceId}/roles

Use it in a workflow

  1. Add a step and choose the Sanity connector.
  2. Pick the Create Role Access Api action (under Access).
  3. Fill in the fields below, then reference the result from later steps as {{createRoleAccessApi.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.

Response

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

namestring
titlestring
descriptionstring
isCustomboolean
resourceTypestring
resourceIdstring
appliesToUsersboolean
appliesToRobotsboolean
permissionsarray<object>
typestring

The resource for the permission.

One ofsanity.blueprintssanity.canvassanity.canvas.commentsanity.canvas.documentsanity.canvas.supportsanity.context.mcpsanity.dashboard.configuration.mesanity.dashboard.configuration.organizationsanity.dashboard.favoritessanity.dashboard.historysanity.dashboard.intentssanity.dashboard.statesanity.document.filtersanity.document.filter.modesanity.knowledge-basesanity.knowledge-base.entriessanity.knowledge-base.issuessanity.knowledge-base.instructionssanity.media-librarysanity.media-library.aspectssanity.media-library.asset-instancessanity.media-library.asset-managementsanity.media-library.assetssanity.media-library.memberssanity.media-library.signed-urlsanity.media-library.hierarchysanity.media-library.rolessanity.media-library.document.filtersanity.organizationsanity.organization.legalsanity.organization.memberssanity.organization.notification-settingssanity.organization.sessionssanity.organization.projectssanity.organization.rolessanity.organization.ssosanity.organization.tokenssanity.organization.user-attributessanity.organization.viewssanity.project

actiononeOf
namestring

The name of the permission.

paramsobject

The parameters for the permission. This is a key-value map of the permission's configuration.

json
{
  "name": "administrator",
  "title": "Administrator",
  "resourceType": "organization",
  "resourceId": "or0Bc1hcJ",
  "appliesToUsers": true,
  "appliesToRobots": true,
  "permissions": [
    {
      "type": "sanity.document.filter.mode",
      "action": null,
      "name": "legal-documents",
      "params": {
        "dataset": "development"
      }
    }
  ],
  "description": "Administrators can manage billing details, legal contacts, organization users, and manage project ownership.",
  "isCustom": false
}

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

Was this page helpful?