younifyd
Menu

List Schedules

List schedules

GET/schedules/{projectId}/{dataset}

Use it in a workflow

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

Request

Path parameters

projectIdstringrequired

Project ID

datasetstringrequired

Dataset name

Query parameters

documentIdsarray<string>

List of document IDs to filter returned schedules by

statestring

Schedule state to filter by

One ofscheduledexecutingsucceededcancelled

actionstring

Schedule action to filter by

One ofpublishunpublish

offsetinteger

Offset to start the list from

limitinteger

Limit the number of schedules returned

authorstring

A single user ID to filter returned schedules by.

Response

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

schedulesarray<object>

Array of schedule objects

idstring

Unique identifier for the schedule

namestring

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

descriptionstring

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

projectIdstring

The ID of the project this schedule belongs to

datasetstring

The dataset this schedule operates on

authorstring

The ID of the user who created the schedule

actionstring

The action the schedule performs when it executes

One ofpublishunpublish

statestring

The current state of the schedule

One ofscheduledexecutingsucceededcancelled

stateReasonstring

Explanation of the current state

documentsarray<object>3 fields

List of documents to be published or unpublished

createdAtstring (date-time)

When the schedule was created

executeAtstring (date-time)

When the schedule is planned to execute

executedAtstring (date-time)

When the schedule was actually executed (if applicable)

transactionIdstring

ID of the transaction that executed the schedule (if applicable)

json
{
  "schedules": [
    {
      "id": "sch-28MRSuc1Ij4xtNa1rNbhTlMAszj",
      "name": "March update",
      "description": "string",
      "projectId": "hb6nr9ev",
      "dataset": "production",
      "author": "poLhU1V3X",
      "action": "publish",
      "state": "scheduled",
      "stateReason": "execution completed",
      "documents": [
        {
          "documentId": "f28fe6ce-0454-42c2-8a9a-c469fbf79281",
          "documentType": "article",
          "ifRevisionId": "string"
        }
      ],
      "createdAt": "2022-04-27T01:54:31.536236Z",
      "executeAt": "2022-04-27T01:55:00Z"
    }
  ]
}

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

Was this page helpful?