Skip to content

Docs

set_recurrence

Make a content item repeat, change how, or stop it (`repeat: null`). The item is the series template: before each occurrence a copy becomes a new content item scheduled at that time (next occurrence only), so editing the template changes later occurrences and editing a copy changes that one. Each copy goes through confirmation like request_schedule: a person confirms it in Updates unless you are an agent allowed to publish on your own. `repeat`: frequency daily|weekly|monthly, `every` N (1–12), `weekdays` (weekly, 0 = Monday), `time` HH:MM and `startsOn` YYYY-MM-DD in the workspace's time zone, optional `endsOn` or `count`. Stopping takes the upcoming copy off the schedule unless `cancelUpcoming: false`.

Make a content item repeat, change how, or stop it (repeat: null). The item is the series template: before each occurrence a copy becomes a new content item scheduled at that time (next occurrence only), so editing the template changes later occurrences and editing a copy changes that one. Each copy goes through confirmation like request_schedule: a person confirms it in Updates unless you are an agent allowed to publish on your own. repeat: frequency daily|weekly|monthly, every N (1–12), weekdays (weekly, 0 = Monday), time HH:MM and startsOn YYYY-MM-DD in the workspace's time zone, optional endsOn or count. Stopping takes the upcoming copy off the schedule unless cancelUpcoming: false.

A human confirms the result in heyeveryone's Updates unless a workspace owner put this agent on Autopilot for the post's channel (see whoami).

Access and cost

  • Kind: mutation
  • Scope: workspace
  • Actors: member, agent
  • Credits: Free
  • Requires confirmation: true
  • Accepts idempotency key: false

Input schema

{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "pieceId": {
      "format": "uuid",
      "type": "string"
    },
    "repeat": {
      "anyOf": [
        {
          "properties": {
            "frequency": {
              "enum": [
                "daily",
                "weekly",
                "monthly"
              ],
              "type": "string"
            },
            "every": {
              "default": 1,
              "maximum": 12,
              "minimum": 1,
              "type": "integer"
            },
            "weekdays": {
              "items": {
                "maximum": 6,
                "minimum": 0,
                "type": "integer"
              },
              "maxItems": 7,
              "type": "array"
            },
            "time": {
              "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
              "type": "string"
            },
            "startsOn": {
              "format": "date",
              "type": "string"
            },
            "endsOn": {
              "anyOf": [
                {
                  "format": "date",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "count": {
              "anyOf": [
                {
                  "maximum": 1000,
                  "minimum": 1,
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "frequency",
            "time"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "cancelUpcoming": {
      "default": true,
      "type": "boolean"
    }
  },
  "required": [
    "workspaceId",
    "pieceId",
    "repeat"
  ],
  "type": "object"
}

Output schema

{
  "additionalProperties": false,
  "properties": {
    "recurrence": {
      "anyOf": [
        {
          "additionalProperties": false,
          "properties": {
            "id": {
              "format": "uuid",
              "type": "string"
            },
            "pieceId": {
              "format": "uuid",
              "type": "string"
            },
            "rule": {
              "additionalProperties": false,
              "properties": {
                "frequency": {
                  "enum": [
                    "daily",
                    "weekly",
                    "monthly"
                  ],
                  "type": "string"
                },
                "every": {
                  "maximum": 12,
                  "minimum": 1,
                  "type": "integer"
                },
                "weekdays": {
                  "items": {
                    "maximum": 6,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "type": "array"
                },
                "time": {
                  "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$",
                  "type": "string"
                },
                "startsOn": {
                  "format": "date",
                  "type": "string"
                },
                "endsOn": {
                  "anyOf": [
                    {
                      "format": "date",
                      "type": "string"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "count": {
                  "anyOf": [
                    {
                      "maximum": 1000,
                      "minimum": 1,
                      "type": "integer"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "frequency",
                "every",
                "weekdays",
                "time",
                "startsOn",
                "endsOn",
                "count"
              ],
              "type": "object"
            },
            "summary": {
              "type": "string"
            },
            "status": {
              "enum": [
                "active",
                "stopped",
                "ended"
              ],
              "type": "string"
            },
            "timeZone": {
              "type": "string"
            },
            "upcoming": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "properties": {
                    "pieceId": {
                      "anyOf": [
                        {
                          "format": "uuid",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "occursAt": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "required": [
                    "pieceId",
                    "occursAt"
                  ],
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            },
            "next": {
              "items": {
                "format": "date-time",
                "type": "string"
              },
              "type": "array"
            },
            "occurrenceCount": {
              "minimum": 0,
              "type": "integer"
            },
            "lastOccurrenceAt": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ]
            },
            "lastError": {
              "anyOf": [
                {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "occurrencePieceId": {
                      "anyOf": [
                        {
                          "format": "uuid",
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "at",
                    "occurrencePieceId"
                  ],
                  "type": "object"
                },
                {
                  "type": "null"
                }
              ]
            },
            "notes": {
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "id",
            "pieceId",
            "rule",
            "summary",
            "status",
            "timeZone",
            "upcoming",
            "next",
            "occurrenceCount",
            "lastOccurrenceAt",
            "lastError",
            "notes"
          ],
          "type": "object"
        },
        {
          "type": "null"
        }
      ]
    },
    "canceledPostIds": {
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "recurrence",
    "canceledPostIds"
  ],
  "type": "object"
}

Errors

[
  "is_occurrence",
  "no_channel_versions"
]

Annotations

{
  "destructiveHint": true,
  "idempotentHint": false,
  "openWorldHint": true,
  "readOnlyHint": false,
  "title": "Repeat content"
}