Skip to content

Docs

POST /set_recurrence

https://heyeveryone.ai/api/v1/set_recurrence

Operation

{
  "post": {
    "description": "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`.\n\nA human confirms the result in heyeveryone's Updates unless a workspace owner put this agent on Autopilot for the post's channel (see whoami).",
    "operationId": "set_recurrence",
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "workspaceId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "type": "string"
              },
              "pieceId": {
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                "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",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                        "type": "string"
                      },
                      "endsOn": {
                        "anyOf": [
                          {
                            "format": "date",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                            "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"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "additionalProperties": false,
              "properties": {
                "recurrence": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                          "type": "string"
                        },
                        "pieceId": {
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                          "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",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                              "type": "string"
                            },
                            "endsOn": {
                              "anyOf": [
                                {
                                  "format": "date",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$",
                                  "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",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "occursAt": {
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                                  "type": "string"
                                }
                              },
                              "required": [
                                "pieceId",
                                "occursAt"
                              ],
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "next": {
                          "items": {
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "occurrenceCount": {
                          "maximum": 9007199254740991,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "lastOccurrenceAt": {
                          "anyOf": [
                            {
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "lastError": {
                          "anyOf": [
                            {
                              "additionalProperties": false,
                              "properties": {
                                "code": {
                                  "type": "string"
                                },
                                "message": {
                                  "type": "string"
                                },
                                "at": {
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
                                  "type": "string"
                                },
                                "occurrencePieceId": {
                                  "anyOf": [
                                    {
                                      "format": "uuid",
                                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                                      "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",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "required": [
                "recurrence",
                "canceledPostIds"
              ],
              "type": "object"
            }
          }
        },
        "description": "Success"
      },
      "400": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "invalid_input: the body does not match the schema"
      },
      "401": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "unauthenticated: missing, invalid, expired or revoked token"
      },
      "403": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "forbidden: the agent may not do this (for example, another workspace)"
      },
      "404": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "not_found"
      },
      "409": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "conflict"
      },
      "422": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Service-specific errors: is_occurrence, no_channel_versions"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      },
      "500": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "internal_error"
      }
    },
    "summary": "Repeat content",
    "tags": [
      "workspace"
    ],
    "x-heyeveryone-kind": "mutation",
    "x-heyeveryone-requires-confirmation": true
  }
}

Referenced definitions

{
  "schemas": {
    "Error": {
      "properties": {
        "error": {
          "description": "A stable error code, for example forbidden.",
          "type": "string"
        },
        "message": {
          "description": "What went wrong, in plain words.",
          "type": "string"
        }
      },
      "required": [
        "error",
        "message"
      ],
      "type": "object"
    }
  },
  "responses": {
    "RateLimited": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "rate_limited: too many requests from this agent, account or address (docs/setup/agents.md, Rate limits); wait the Retry-After seconds, then retry",
      "headers": {
        "Retry-After": {
          "description": "Seconds to wait before retrying.",
          "schema": {
            "minimum": 1,
            "type": "integer"
          }
        }
      }
    }
  }
}

Authentication

{
  "bearer": {
    "description": "Personal access token (hey_pat_...)",
    "scheme": "bearer",
    "type": "http"
  },
  "oauth": {
    "flows": {
      "authorizationCode": {
        "authorizationUrl": "https://heyeveryone.ai/oauth/authorize",
        "refreshUrl": "https://heyeveryone.ai/oauth/token",
        "scopes": {
          "agent": "Act as your agent in the workspaces you choose"
        },
        "tokenUrl": "https://heyeveryone.ai/oauth/token"
      }
    },
    "type": "oauth2"
  }
}

Security requirements

[
  {
    "bearer": []
  },
  {
    "oauth": [
      "agent"
    ]
  }
]