# Recurring

> For AI agents: the index of these docs is at https://indrava.forumulate.com/docs/llms.txt (every page it lists has a Markdown version like this one).

## List recurring series

**`GET http://localhost:4000/api/v1/posts/series`** — List recurring series

A series makes its next post when the one before is due.

### Responses

**200** — OK

#### Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |
| `organizationId` | string | yes |  |
| `authorId` | string | yes |  |
| `rule` |  | yes |  |
| `template` |  | yes |  |
| `timezone` | string | yes |  |
| `startAt` | string | yes |  |
| `lastOccurrenceAt` | string | yes |  |
| `endedAt` | string | yes |  |
| `createdAt` | string | yes |  |

```json
[
  {
    "id": "string",
    "organizationId": "string",
    "authorId": "string",
    "rule": {},
    "template": {},
    "timezone": "string",
    "startAt": "2024-01-01T00:00:00Z",
    "lastOccurrenceAt": "2024-01-01T00:00:00Z",
    "endedAt": "2024-01-01T00:00:00Z",
    "createdAt": "2024-01-01T00:00:00Z"
  }
]
```

### Code samples

**cURL**

```curl
curl -X GET "http://localhost:4000/api/v1/posts/series" \
  -H "Authorization: Bearer $API_KEY"
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/series', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer $API_KEY',
  },
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "GET",
    "http://localhost:4000/api/v1/posts/series",
    headers={
    "Authorization": "Bearer $API_KEY",
    },
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "http://localhost:4000/api/v1/posts/series", nil)
	req.Header.Set("Authorization", "Bearer $API_KEY")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/series');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY']);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/series')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/series"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Start a recurring series

**`POST http://localhost:4000/api/v1/posts/series`** — Start a recurring series

`rule` says how often, `startAt` is the first occurrence. Needs `posts:publish` as well: what this sets up can publish without a person looking.

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `parts` | object[] | yes |  |
| `parts.text` | string | yes |  |
| `parts.mediaIds` | string[] | no | Default: `[]`. |
| `parts.delaySeconds` | integer | no |  |
| `targets` | object[] | yes |  |
| `targets.channelId` | string | yes |  |
| `targets.parts` | object[] | no |  |
| `targets.parts.text` | string | yes |  |
| `targets.parts.mediaIds` | string[] | no | Default: `[]`. |
| `targets.parts.delaySeconds` | integer | no |  |
| `targets.settings` | object | no | Default: `{}`. |
| `rule` | object | yes |  |
| `rule.freq` | string | yes | One of: `daily` \| `weekly` \| `monthly` \| `interval`. |
| `rule.weekdays` | integer[] | no |  |
| `rule.monthDay` | integer | no |  |
| `rule.interval` | integer | no |  |
| `rule.until` | string | no |  |
| `rule.count` | integer | no |  |
| `tagIds` | string[] | no | Default: `[]`. |
| `startAt` | string | yes |  |

```json
{
  "parts": [
    {
      "text": "string",
      "mediaIds": [],
      "delaySeconds": 0
    }
  ],
  "targets": [
    {
      "channelId": "string",
      "parts": [
        {
          "text": "string",
          "mediaIds": [],
          "delaySeconds": 0
        }
      ],
      "settings": {}
    }
  ],
  "rule": {
    "freq": "daily",
    "weekdays": [
      0
    ],
    "monthDay": 0,
    "interval": 0,
    "until": "string",
    "count": 0
  },
  "tagIds": [],
  "startAt": "2024-01-01T00:00:00Z"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X POST "http://localhost:4000/api/v1/posts/series" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/series', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "POST",
    "http://localhost:4000/api/v1/posts/series",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"parts": [{"text": "string", "mediaIds": [], "delaySeconds": 0}], "targets": [{"channelId": "string", "parts": [{"text": "string", "mediaIds": [], "delaySeconds": 0}], "settings": {}}], "rule": {"freq": "daily", "weekdays": [0], "monthDay": 0, "interval": 0, "until": "string", "count": 0}, "tagIds": [], "startAt": "2024-01-01T00:00:00Z"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("POST", "http://localhost:4000/api/v1/posts/series", strings.NewReader(`{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/series');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/series')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/series"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("POST", BodyPublishers.ofString("{\"parts\":[{\"text\":\"string\",\"mediaIds\":[],\"delaySeconds\":0}],\"targets\":[{\"channelId\":\"string\",\"parts\":[{\"text\":\"string\",\"mediaIds\":[],\"delaySeconds\":0}],\"settings\":{}}],\"rule\":{\"freq\":\"daily\",\"weekdays\":[0],\"monthDay\":0,\"interval\":0,\"until\":\"string\",\"count\":0},\"tagIds\":[],\"startAt\":\"2024-01-01T00:00:00Z\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Change a series' rule and content

**`PUT http://localhost:4000/api/v1/posts/series/{id}`** — Change a series' rule and content

`scope: "all"` changes the series in place; `"following"` ends it and starts a new one from the pending occurrence. One occurrence alone is `POST /posts` on that post. Needs `posts:publish` as well: what this sets up can publish without a person looking.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `parts` | object[] | yes |  |
| `parts.text` | string | yes |  |
| `parts.mediaIds` | string[] | no | Default: `[]`. |
| `parts.delaySeconds` | integer | no |  |
| `targets` | object[] | yes |  |
| `targets.channelId` | string | yes |  |
| `targets.parts` | object[] | no |  |
| `targets.parts.text` | string | yes |  |
| `targets.parts.mediaIds` | string[] | no | Default: `[]`. |
| `targets.parts.delaySeconds` | integer | no |  |
| `targets.settings` | object | no | Default: `{}`. |
| `rule` | object | yes |  |
| `rule.freq` | string | yes | One of: `daily` \| `weekly` \| `monthly` \| `interval`. |
| `rule.weekdays` | integer[] | no |  |
| `rule.monthDay` | integer | no |  |
| `rule.interval` | integer | no |  |
| `rule.until` | string | no |  |
| `rule.count` | integer | no |  |
| `tagIds` | string[] | no | Default: `[]`. |
| `startAt` | string | no |  |
| `scope` | string | yes | One of: `following` \| `all`. |

```json
{
  "parts": [
    {
      "text": "string",
      "mediaIds": [],
      "delaySeconds": 0
    }
  ],
  "targets": [
    {
      "channelId": "string",
      "parts": [
        {
          "text": "string",
          "mediaIds": [],
          "delaySeconds": 0
        }
      ],
      "settings": {}
    }
  ],
  "rule": {
    "freq": "daily",
    "weekdays": [
      0
    ],
    "monthDay": 0,
    "interval": 0,
    "until": "string",
    "count": 0
  },
  "tagIds": [],
  "startAt": "2024-01-01T00:00:00Z",
  "scope": "following"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X PUT "http://localhost:4000/api/v1/posts/series/{id}" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z","scope":"following"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/series/{id}', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z","scope":"following"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "PUT",
    "http://localhost:4000/api/v1/posts/series/{id}",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"parts": [{"text": "string", "mediaIds": [], "delaySeconds": 0}], "targets": [{"channelId": "string", "parts": [{"text": "string", "mediaIds": [], "delaySeconds": 0}], "settings": {}}], "rule": {"freq": "daily", "weekdays": [0], "monthDay": 0, "interval": 0, "until": "string", "count": 0}, "tagIds": [], "startAt": "2024-01-01T00:00:00Z", "scope": "following"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("PUT", "http://localhost:4000/api/v1/posts/series/{id}", strings.NewReader(`{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z","scope":"following"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/series/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z","scope":"following"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/series/{id}')
req = Net::HTTP::Put.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"targets":[{"channelId":"string","parts":[{"text":"string","mediaIds":[],"delaySeconds":0}],"settings":{}}],"rule":{"freq":"daily","weekdays":[0],"monthDay":0,"interval":0,"until":"string","count":0},"tagIds":[],"startAt":"2024-01-01T00:00:00Z","scope":"following"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/series/{id}"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("PUT", BodyPublishers.ofString("{\"parts\":[{\"text\":\"string\",\"mediaIds\":[],\"delaySeconds\":0}],\"targets\":[{\"channelId\":\"string\",\"parts\":[{\"text\":\"string\",\"mediaIds\":[],\"delaySeconds\":0}],\"settings\":{}}],\"rule\":{\"freq\":\"daily\",\"weekdays\":[0],\"monthDay\":0,\"interval\":0,\"until\":\"string\",\"count\":0},\"tagIds\":[],\"startAt\":\"2024-01-01T00:00:00Z\",\"scope\":\"following\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

## Skip the next occurrence, end a series, or delete it

**`DELETE http://localhost:4000/api/v1/posts/series/{id}`** — Skip the next occurrence, end a series, or delete it

`scope`: `this` skips the pending occurrence, `following` ends the series, `all` also deletes it. Published occurrences stay as posts.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `scope` | string | yes | One of: `this` \| `following` \| `all`. |

```json
{
  "scope": "this"
}
```

### Responses

**200** — OK

#### Option 1

#### Option 2

```json
{}
```

### Code samples

**cURL**

```curl
curl -X DELETE "http://localhost:4000/api/v1/posts/series/{id}" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"scope":"this"}'
```

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts/series/{id}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer $API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"scope":"this"}),
});
const data = await res.json();
```

**Python**

```python
import requests

res = requests.request(
    "DELETE",
    "http://localhost:4000/api/v1/posts/series/{id}",
    headers={
    "Authorization": "Bearer $API_KEY",
    "Content-Type": "application/json",
    },
    json={"scope": "this"},
)
data = res.json()
```

**Go**

```go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	req, _ := http.NewRequest("DELETE", "http://localhost:4000/api/v1/posts/series/{id}", strings.NewReader(`{"scope":"this"}`))
	req.Header.Set("Authorization", "Bearer $API_KEY")
	req.Header.Set("Content-Type", "application/json")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
```

**PHP**

```php
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://localhost:4000/api/v1/posts/series/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer $API_KEY', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"scope":"this"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;
```

**Ruby**

```ruby
require 'net/http'
require 'uri'

uri = URI('http://localhost:4000/api/v1/posts/series/{id}')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = 'Bearer $API_KEY'
req['Content-Type'] = 'application/json'
req.body = '{"scope":"this"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end
puts res.body
```

**Java**

```java
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("http://localhost:4000/api/v1/posts/series/{id}"))
    .header("Authorization", "Bearer $API_KEY")
    .header("Content-Type", "application/json")
    .method("DELETE", BodyPublishers.ofString("{\"scope\":\"this\"}"))
    .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

---

## For AI agents

- This page for a human reader: https://indrava.forumulate.com/docs/ref-recurring
- The whole space as one Markdown file: https://indrava.forumulate.com/docs/llms-full.txt
- Live search + fetch over MCP: https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp
  - Install (Claude CLI): `claude mcp add forumulate-docs --transport http https://indrava.forumulate.com/docs/_api/public/orgs/e421ace4-3e78-4ed8-9818-7b4899cf3aa0/spaces/2bcc7f09-4489-40af-85d8-9fdd3f3da314/mcp`

This Markdown is the same content the page renders — safe to quote and to ground answers in.
