younifyd
Menu

Create Organization Grant

Create an organization grant

POST/organizations/{organizationId}/grants

Use it in a workflow

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

Request

Path parameters

organizationIdstringrequired

The ID of the organization

Request body

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

roleNamestringrequired

The name of a custom role

permissionNamestringrequired

The name of a permission defined by the permission resource's schema

permissionResourceIdstring

The ID of the permission resource. Send this or `permissionResourceName`, not both.

permissionResourceNamestring

The name of the permission resource. Send this or `permissionResourceId`, not both.

paramsobject

Parameters for the permission, as defined by the permission resource schema. For example, `mode`, `dataset`, or `tagName`. On project grants, you can't set both `dataset` and `tagName`; organization grants ignore `dataset` and `tagName`.

Default {}

json
{
  "roleName": "translator",
  "permissionName": "read",
  "permissionResourceId": "res-k2d8fj3a",
  "permissionResourceName": "articles",
  "params": {}
}

Response

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

roleNamestring

The name of the role

permissionNamestring

The name of the permission

permissionResourceTypestring

The name of the permission resource schema

permissionResourceIdstring

The ID of the permission resource

paramsobject

The permission parameters

tagIdstring | null

Only returned when you remove a project grant. The ID of the tag the grant applied to, if any.

datasetIdstring | null

Only returned when you remove a project grant. The ID of the dataset the grant applied to, if any.

json
{
  "roleName": "translator",
  "permissionName": "read",
  "permissionResourceType": "sanity.document.filter",
  "permissionResourceId": "res-k2d8fj3a",
  "params": {},
  "tagId": "string",
  "datasetId": "string"
}

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