# List posts

> Page: https://docs.flung.dev/reference/api/get-v1-posts. Index of every page: https://docs.flung.dev/llms.txt

Newest first.

`GET /v1/posts`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | List posts. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | `limit`, `startingAfter`, `status`, `platform`, `accountId` in the query string. |
| What does it return? | Status 200 with a body of type [`PostList`](https://docs.flung.dev/reference/api/schemas.md#postlist). |
| In the SDK? | `flung.posts.list()` |
| As an MCP tool? | [`list_posts`](https://docs.flung.dev/reference/mcp/list-posts.md) |
| What can go wrong? | `401` Missing, unknown, revoked or expired API key; `422` The request failed validation; `429` Too many requests for this credential; wait for `retry-after` seconds. Every failure has the same [error shape](https://docs.flung.dev/reference/api/errors.md). |

## What it does

Newest first. Pass the last id of a page as `startingAfter` to get the next one.

## Example

**curl**

```bash
curl -X GET 'https://api.flung.dev/v1/posts' \
  --header "Authorization: Bearer $FLUNG_API_KEY"
```

**TypeScript**

```ts
import { Flung } from '@flung.dev/sdk'

const flung = new Flung({ apiKey: process.env.FLUNG_API_KEY! })
const result = await flung.posts.list()
```

**fetch**

```js
const response = await fetch('https://api.flung.dev/v1/posts', {
  method: 'GET',
  headers: {
    'Authorization': `Bearer ${process.env.FLUNG_API_KEY}`,
  },
})
if (!response.ok) throw new Error((await response.json()).error.message)
const result = await response.json()
```

A successful answer looks like this:

```json
{
  "data": [
    {
      "id": "post_aaaaaaaaaaaaaaaaaaaaaaaa",
      "status": "scheduled",
      "content": "string",
      "mediaIds": [
        "string"
      ],
      "platformOverrides": {},
      "publishAt": "2026-11-01T09:00:00.000Z",
      "createdAt": "2026-11-01T09:00:00.000Z",
      "updatedAt": "2026-11-01T09:00:00.000Z"
    }
  ],
  "hasMore": true
}
```

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `limit` | `integer` | no |  |
| `startingAfter` | `string` | no | The id of the last post of the previous page. |
| `status` | `"scheduled" \| "publishing" \| "published" \| "partially_published" \| "failed" \| "cancelled"` | no |  |
| `platform` | `any` | no | Only posts with a target on this platform. |
| `accountId` | `string` | no | Only posts with a target on this account. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | A page of posts. | [`PostList`](https://docs.flung.dev/reference/api/schemas.md#postlist) |
| 401 | Missing, unknown, revoked or expired API key. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 422 | The request failed validation. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 429 | Too many requests for this credential; wait for `retry-after` seconds. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |

## Response body

A 200 answer has the type [`PostList`](https://docs.flung.dev/reference/api/schemas.md#postlist).

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | `PostSummary[]` | yes |  |
| `data[].id` | `string` | yes |  |
| `data[].status` | `"scheduled" \| "publishing" \| "published" \| "partially_published" \| "failed" \| "cancelled"` | yes |  |
| `data[].content` | `string` | yes |  |
| `data[].mediaIds` | `string[]` | yes |  |
| `data[].platformOverrides` | `object` | yes |  |
| `data[].platformOverrides.x` | `object` | no |  |
| `data[].platformOverrides.instagram` | `object` | no |  |
| `data[].platformOverrides.facebook` | `object` | no |  |
| `data[].platformOverrides.threads` | `object` | no |  |
| `data[].platformOverrides.linkedin` | `object` | no |  |
| `data[].platformOverrides.tiktok` | `object` | no |  |
| `data[].platformOverrides.youtube` | `object` | no |  |
| `data[].platformOverrides.pinterest` | `object` | no |  |
| `data[].platformOverrides.bluesky` | `object` | no |  |
| `data[].platformOverrides.mastodon` | `object` | no |  |
| `data[].platformOverrides.discord` | `object` | no |  |
| `data[].platformOverrides.farcaster` | `object` | no |  |
| `data[].publishAt` | `string` | yes |  |
| `data[].createdAt` | `string` | yes |  |
| `data[].updatedAt` | `string` | yes |  |
| `hasMore` | `boolean` | yes |  |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.flung.dev/reference/api.md) | Every endpoint |
| [Schemas](https://docs.flung.dev/reference/api/schemas.md) | Every request and response type |
| [Errors](https://docs.flung.dev/reference/api/errors.md) | Every error code and what to do about it |
| [`list_posts`](https://docs.flung.dev/reference/mcp/list-posts.md) | The same operation as an MCP tool |
