---
search:
  tags:
    - Automations
    - POST
seo:
  description: >-
    Starts a rule that repeats a post that is scheduled, publishing or went out…
    Reference for the POST /api/v1/automations/recycling endpoint in the Peal
    API.
sidebar:
  label: Start repeating a post
  badge: POST
title: Start repeating a post
type: openapi-operation
---
Starts a rule that repeats a post that is scheduled, publishing or went out (deleted from a platform since or not): `every` 1 to 365 days, 1 to 52 weeks or 1 to 12 months, until `count` posts in all (2 to 100, the source counted) or until the day `until`, and never more than 100; with up to 10 text `variants`, each checked as the source saying it would be, and optionally on a queue. Each post a rule makes is a new post, copied from the source with what the workspace still has (its channels still connected, its media, the options on them, its tags; never a signature or a default added since), and sent as any post is: the same checks, the approval policy, the month's room in the plan, its own job, outcome and notices. It says the source's text, then each variant in turn, then the source's again. The next post is made once the latest one's time has passed, one interval after the one before at the same wall-clock time in the source's zone (a month shorter than the day takes its last day), or on the queue's first free slot from then; a time missed while nothing ran is skipped, never made up for. Each acts as whoever started the rule, with what they may do when it is made: a member removed, a key revoked or an application whose grant no longer publishes ends it. A post has one rule going on at a time, and a workspace 100 active or paused. It publishes again, in public, without anyone being asked each time, unless the approval policy holds the starter's posts: then each waits for an approval. Needs post:schedule, or post:create where posts wait for an approval; never staff acting as a member.

`POST /api/v1/automations/recycling`

**Request body** (`application/json`, required)

- `count` (integer)
- `every` (RecyclingInterval, required)
- `postId` (string, required)
- `queueId` (string)
- `until` (CalendarDay)
- `variants` (RecyclingVariant[])

Request body example:

```json
{
  "count": 2,
  "every": {
    "count": 1,
    "unit": "days"
  },
  "postId": "string",
  "queueId": "string",
  "until": "string",
  "variants": [
    {
      "overrides": [
        {
          "channelId": "string",
          "media": [
            {
              "altText": "string",
              "mediaId": "string"
            }
          ],
          "text": "string"
        }
      ],
      "text": "string"
    }
  ]
}
```

**Responses**

- `201` — RecyclingRule
- `400` — The request names no workspace, and its credential belongs to none: send the workspace's id in the \`Peal-Workspace\` header. Nothing was done.
- `401` — Sign in, or send an API key as a bearer token: the request has no valid credentials.
- `403` — The credentials are valid but do not allow this request. \`reason\` says why: the OAuth client was not given the scope the request takes (\`missingScope\`, with \`scope\` and \`permission\`: the user connects the client again and allows it), the member's role or the API key lacks a permission (\`missingPermission\`, with \`permission\`: an owner or an admin changes the role, or creates a key with it), only a person in their own session may do it (\`personRequired\`), the key or token belongs to another workspace (\`wrongWorkspace\`), the account is suspended (\`suspended\`), a browser sent the cookie from another site (\`untrustedOrigin\`), or the workspace requires two-step verification and the member's account does not have it on (\`twoStepRequired\`: they turn it on in the web app's account settings, and their sessions, applications and command line work again at once; API keys are never refused for it).
- `404` — The workspace has no post with this id. | The workspace has no queue with this id, or of this name where a request names one; or, where a post is added to its default queue, the workspace has no default queue. | No workspace with this id is open to the caller.
- `409` — The post cannot repeat, for \`reason\`: it is a draft, waits for an approval or was cancelled; another rule repeats it already (stop that one first); a rule made it; or none of its channels is connected any more. | The workspace keeps \`allowed\` recycling rules active or paused, the most it may: stop one before starting another. Nothing was started.
- `422` — The rule's ending leaves no post to make: its \`until\` date comes before the next post is due (\`firstDueAt\`), or its \`count\` is already reached. Nothing was changed. | What the source post would say with some of the text variants breaks the rules of its channels' platforms: \`variants\` names each by its place, from 1, with every violation, as scheduling the post would answer them. Nothing was saved.
- `429` — This credential sent more than \`limit\` requests in \`windowSeconds\` seconds: nothing was done. Wait \`retryAfterSeconds\` seconds, as the \`Retry-After\` header says, then send the request again. Every answer to a key or a token carries the \`RateLimit-Policy\` and \`RateLimit\` headers, which say how many requests are left. \`policy\` says which limit applied: on a server that bills, a billing account without a payment method sends fewer (\`free\`), and \`withPaymentMethod\` is what a payment method gives.

Response example, 201:

```json
{
  "anchorAt": "string",
  "coming": [
    {
      "at": "string",
      "occurrence": -9007199254740991,
      "variant": -9007199254740991
    }
  ],
  "count": -9007199254740991,
  "createdAt": "string",
  "endedReason": "completed",
  "every": {
    "count": 1,
    "unit": "days"
  },
  "id": "string",
  "lastDueAt": "string",
  "made": -9007199254740991,
  "nextDueAt": "string",
  "queueId": "string",
  "sourcePostId": "string",
  "startedBy": "string",
  "startedVia": {
    "id": "string",
    "name": "string",
    "via": "web"
  },
  "status": "active",
  "timeZone": "string",
  "until": "string",
  "variants": [
    {
      "overrides": [
        {
          "channelId": "string",
          "media": [
            {
              "altText": "string",
              "mediaId": "string"
            }
          ],
          "text": "string"
        }
      ],
      "text": "string"
    }
  ]
}
```
