younifyd
Menu

Update Permission Resource

Update a permission resource

PUT/projects/{projectId}/permissionResources/{resourceId}

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired

The ID of the project

resourceIdstringrequired

The ID or name of the permission resource

Request body

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

titlestring

The title of the resource

descriptionstring

A description of the resource

configobject

Configuration that matches the permission resource schema's `config`. Replaces the existing configuration.

json
{
  "title": "string",
  "description": "string",
  "config": {}
}

Response

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

idstring

The ID of the permission resource

namestring

The name of the permission resource

titlestring

The title of the permission resource

descriptionstring

A description of the permission resource

configobject

The resource configuration. For `sanity.document.filter` resources, `filter` is a GROQ filter.

isCustomboolean

Whether the resource was created by a user rather than by Sanity

permissionResourceTypestring

The name of the permission resource schema the resource is based on

json
{
  "id": "res-k2d8fj3a",
  "name": "articles",
  "title": "Articles",
  "description": "Documents of type article",
  "config": {
    "filter": "_type == \"article\""
  },
  "isCustom": true,
  "permissionResourceType": "sanity.document.filter"
}

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

Was this page helpful?