# List Plotwork diagrams

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

The diagrams the connected Plotwork account can see, newest first, private ones included.

`GET /v1/plotwork/diagrams`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | List Plotwork diagrams. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | `limit`, `cursor`, `folder`, `q` in the query string. |
| What does it return? | Status 200 with a body of type [`PlotworkDiagramList`](https://docs.flung.dev/reference/api/schemas.md#plotworkdiagramlist). |
| In the SDK? | `flung.plotwork.listDiagrams()` |
| As an MCP tool? | [`list_plotwork_diagrams`](https://docs.flung.dev/mcp/tools/list-plotwork-diagrams.md) |
| What can go wrong? | `401` Missing, unknown, revoked or expired API key; `409` Plotwork is not connected (`plotwork_not_connected`), or must be connected again (`plotwork_reconnect`), in the portal; `422` The request failed validation; `429` Too many requests for this credential; wait for `retry-after` seconds; `502` Plotwork could not be reached or refused for a moment (`plotwork_unavailable`); `503` Plotwork is not set up on this server (`not_configured`). Every failure has the same [error shape](https://docs.flung.dev/reference/api/errors.md). |

## What it does

The diagrams the connected Plotwork account can see, newest first, private ones included. `q` keeps to names and folders that hold the words, ignoring case.

## Example

**curl**

```bash
curl -X GET 'https://api.flung.dev/v1/plotwork/diagrams?q=checkout' \
  --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.plotwork.listDiagrams({
  q: 'checkout',
})
```

**fetch**

```js
const response = await fetch('https://api.flung.dev/v1/plotwork/diagrams?q=checkout', {
  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": "string",
      "name": "string",
      "folder": "string",
      "scheme": "string",
      "updatedAt": "2026-11-01T09:00:00.000Z"
    }
  ],
  "nextCursor": "string"
}
```

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `limit` | `integer` | no |  |
| `cursor` | `string` | no | The nextCursor of the page before. |
| `folder` | `string` | no | Only this Plotwork folder and the folders inside it, such as Payments/Checkout. |
| `q` | `string` | no | Words the name or folder holds, ignoring case. Plotwork searches its whole library. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | A page of diagrams. | [`PlotworkDiagramList`](https://docs.flung.dev/reference/api/schemas.md#plotworkdiagramlist) |
| 401 | Missing, unknown, revoked or expired API key. | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 409 | Plotwork is not connected (`plotwork_not_connected`), or must be connected again (`plotwork_reconnect`), in the portal. | [`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) |
| 502 | Plotwork could not be reached or refused for a moment (`plotwork_unavailable`). | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |
| 503 | Plotwork is not set up on this server (`not_configured`). | [`Error`](https://docs.flung.dev/reference/api/schemas.md#error) |

## Response body

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

| Field | Type | Required | Description |
|---|---|---|---|
| `data` | `PlotworkDiagram[]` | yes |  |
| `data[].id` | `string` | yes |  |
| `data[].name` | `string \| null` | yes |  |
| `data[].folder` | `string \| null` | yes |  |
| `data[].scheme` | `string` | yes | The color scheme it was drawn in, such as light, dark or auto. |
| `data[].updatedAt` | `string` | yes | When it was last published in Plotwork. |
| `nextCursor` | `string \| null` | yes | Pass it as `cursor` for the next page; null on the last. |

## 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_plotwork_diagrams`](https://docs.flung.dev/mcp/tools/list-plotwork-diagrams.md) | The same operation as an MCP tool |
