# Get the Plotwork connection

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

Whether the workspace has connected a Plotwork account, and which one.

`GET /v1/plotwork`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Get the Plotwork connection. |
| What does it need? | An API key or an OAuth access token. |
| What does it take? | Nothing. |
| What does it return? | Status 200 with a body of type [`PlotworkConnection`](https://docs.flung.dev/reference/api/schemas.md#plotworkconnection). |
| In the SDK? | `flung.plotwork.get()` |
| 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

Whether the workspace has connected a Plotwork account, and which one. Never a token.

## Example

**curl**

```bash
curl -X GET 'https://api.flung.dev/v1/plotwork' \
  --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.get()
```

**fetch**

```js
const response = await fetch('https://api.flung.dev/v1/plotwork', {
  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
{
  "connected": true,
  "status": "active",
  "account": {
    "id": "string",
    "name": "string",
    "email": "string",
    "organisation": {
      "slug": "string",
      "name": "string"
    }
  },
  "connectedAt": "2026-11-01T09:00:00.000Z"
}
```

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | The connection. | [`PlotworkConnection`](https://docs.flung.dev/reference/api/schemas.md#plotworkconnection) |
| 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 [`PlotworkConnection`](https://docs.flung.dev/reference/api/schemas.md#plotworkconnection).

| Field | Type | Required | Description |
|---|---|---|---|
| `connected` | `boolean` | yes |  |
| `status` | `"active" \| "needs_reconnect" \| null` | yes | `needs_reconnect` once Plotwork ended the grant: a person connects it again in the portal. Null when not connected. |
| `account` | `object \| null` | yes |  |
| `account.id` | `string` | yes |  |
| `account.name` | `string \| null` | yes |  |
| `account.email` | `string \| null` | yes |  |
| `account.organisation` | `object \| null` | yes | The Plotwork organisation whose library it reads, or null for the person's own. |
| `account.organisation.slug` | `string` | yes |  |
| `account.organisation.name` | `string` | yes |  |
| `connectedAt` | `string \| null` | 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 |
