# List posts

> 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 posts

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

Newest first. Page with `cursor` (the id of the last post of the previous page). `GET /posts/count` answers how many posts the same filter matches.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string | no |  |
| `to` | query | string | no |  |
| `status` | query | string[] | no |  |
| `channelId` | query | string | no |  |
| `channelIds` | query | string[] | no |  |
| `tagId` | query | string | no |  |
| `clientId` | query | string | no |  |
| `type` | query | string | no |  |
| `authorId` | query | string | no |  |
| `campaignId` | query | string | no |  |
| `awaitingApproverId` | query | string | no |  |
| `hasComments` | query | boolean | no |  |
| `fieldId` | query | string | no |  |
| `fieldValue` | query | string | no |  |
| `cursor` | query | string | no |  |
| `limit` | query | integer | no |  |

### Responses

**200** — OK

#### Fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes |  |
| `organizationId` | string | yes |  |
| `authorId` | string | yes |  |
| `parts` |  | yes |  |
| `status` | string | yes | One of: `draft` \| `pending_approval` \| `scheduled` \| `publishing` \| `published` \| `failed`. |
| `scheduledAt` | string | yes |  |
| `clientId` | string | yes |  |
| `aiGenerated` | boolean | yes |  |
| `recycledFromId` | string | yes |  |
| `idempotencyKey` | string | yes |  |
| `source` | string | yes |  |
| `draftReason` | string | yes |  |
| `draftProblem` |  | yes |  |
| `createdAt` | string | yes |  |
| `updatedAt` | string | yes |  |
| `targets` | object[] | yes |  |
| `targets.id` | string | yes |  |
| `targets.organizationId` | string | yes |  |
| `targets.postId` | string | yes |  |
| `targets.channelId` | string | yes |  |
| `targets.parts` |  | yes |  |
| `targets.settings` |  | yes |  |
| `targets.status` | string | yes | One of: `pending` \| `publishing` \| `published` \| `failed`. |
| `targets.published` |  | yes |  |
| `targets.notBefore` | string | yes |  |
| `targets.remoteUrl` | string | yes |  |
| `targets.error` | string | yes |  |
| `targets.errorCode` | string | yes |  |
| `targets.errorParams` |  | yes |  |
| `targets.attempts` | number | yes |  |
| `targets.publishedAt` | string | yes |  |
| `targets.pending` |  | yes |  |
| `tagIds` | string[] | yes |  |
| `seriesId` | string | yes |  |

```json
[
  {
    "id": "string",
    "organizationId": "string",
    "authorId": "string",
    "parts": {},
    "status": "draft",
    "scheduledAt": "2024-01-01T00:00:00Z",
    "clientId": "string",
    "aiGenerated": true,
    "recycledFromId": "string",
    "idempotencyKey": "string",
    "source": "string",
    "draftReason": "string",
    "draftProblem": {},
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z",
    "targets": [
      {
        "id": "string",
        "organizationId": "string",
        "postId": "string",
        "channelId": "string",
        "parts": {},
        "settings": {},
        "status": "pending",
        "published": {},
        "notBefore": "2024-01-01T00:00:00Z",
        "remoteUrl": "string",
        "error": "string",
        "errorCode": "string",
        "errorParams": {},
        "attempts": 0,
        "publishedAt": "2024-01-01T00:00:00Z",
        "pending": {}
      }
    ],
    "tagIds": [
      "string"
    ],
    "seriesId": "string"
  }
]
```

### Code samples

**cURL**

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

**TypeScript**

```typescript
const res = await fetch('http://localhost:4000/api/v1/posts', {
  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",
    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", 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');
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')
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"))
    .header("Authorization", "Bearer $API_KEY")
    .GET()
    .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-posts-list
- 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.
