younifyd
Menu

Create Request

Create a new Request

POST/v2024-07-01/access/{resourceType}/{resourceId}/requests

Use it in a workflow

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

Request body

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

notestring
requestUrlstring

Optional URL to redirect the user to after their request has been accepted. Do not include PII or other confidential information.

requestedRolestring

Optional role requested by the user. The approver can assign a different role, but this is just a suggestion. If the role does not exist, the request will still be created and no validation on the role will be done.

typestring

The type of request.

One ofaccessrole

json
{
  "note": "Text describing the reason of the request",
  "requestUrl": "https://sanity-studio.mycompany.io/doc/1234567890",
  "requestedRole": "editor",
  "type": "access"
}

Response

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

idstring
statusstring
resourceIdstring
resourceTypestring
createdAtstring (date-time)
updatedAtstring (date-time)
updatedByUserIdstring
requestedByUserIdstring
notestring
requestedByUserProfileobject
idstringrequired
displayNamestringrequired
emailstringrequired
familyNamestring
givenNamestring
middleNamestring | null
imageUrlstring (uri)
providerstringrequired
tosAcceptedAtstring (date-time)
createdAtstring (date-time)required
updatedAtstring (date-time)
isCurrentUserboolean
providerIdstring
typestring

The type of request.

One ofaccessrole

requestedRolestring
json
{
  "id": "request-id",
  "status": "pending",
  "resourceId": "project-id",
  "resourceType": "project",
  "createdAt": "2024-07-10T12:00:00Z",
  "requestedByUserId": "user-id",
  "updatedAt": "2024-07-10T12:00:00Z",
  "updatedByUserId": "admin-id",
  "note": "Text describing the reason of the request.",
  "requestedByUserProfile": {
    "id": "string",
    "displayName": "string",
    "email": "string",
    "provider": "string",
    "createdAt": "2025-01-01T00:00:00Z",
    "familyName": "string",
    "givenName": "string",
    "middleName": "string",
    "imageUrl": "string",
    "tosAcceptedAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-01T00:00:00Z",
    "isCurrentUser": false
  },
  "type": "access",
  "requestedRole": "editor"
}

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

Was this page helpful?
Create Request — Sanity — Documentation