younifyd
Menu

Update Schedule

Update schedule

PATCH/schedules/{projectId}/{dataset}/{scheduleId}

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired

Project ID

datasetstringrequired

Dataset name

scheduleIdstringrequired

Schedule ID. To get several schedules in one request, separate the IDs with commas.

Request body

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

descriptionstring

A custom description for the schedule. It helps understand the purpose of the schedule

documentsarray<object>

Array of documents to be published or unpublished

documentIdstringrequired

The ID of the document to be published or unpublished. Must be a published (non-draft) document ID. Draft IDs, which start with `drafts.`, are rejected.

ifRevisionIdstring

Optional revision ID that must match the document's _rev value in order to proceed with the publish or unpublish action

executeAtstring (date-time)

When the schedule should execute. Must be in the future. Must be in UTC format with Z suffix

namestring

A custom name for the schedule. Make it human-readable and understandable

statestring

The target state of the schedule. Can only be set to 'cancelled'

One ofcancelled

json
{
  "description": "string",
  "documents": [
    {
      "documentId": "f28fe6ce-0454-42c2-8a9a-c469fbf79281",
      "ifRevisionId": "string"
    }
  ],
  "executeAt": "2077-01-01T12:00:00.000Z",
  "name": "string",
  "state": "cancelled"
}

Response

Returns 200 with a any. Read it in later steps with {{updateSchedule.response.data.<field>}}.

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