> ## Documentation Index
> Fetch the complete documentation index at: https://docs.captureflow.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Content agent

> Let CaptureFlow's content agent write draft posts from an idea, an input or text.

The content agent is the same agent that writes drafts in the app. Through the API it runs in the background: you start a run, then read it until it's done. Nothing is posted; the drafts wait for you in CaptureFlow.

Scope: `agent:run`.

## Start a run

`POST /v1/agent/runs` with exactly one of:

| Field | |
| - | - |
| `idea_id` | One of your ideas. |
| `input_id` | One of your inputs (a transcript, an article, a document). |
| `text` | 20 to 100,000 characters of notes, a transcript or an article. Saved as an input; `title` names it. |

Optional `instructions` (up to 2,000 characters) steer the drafts: tone, length, the angle to take.

```bash theme={null}
curl https://api.captureflow.ai/v1/agent/runs?workspace_id=$WORKSPACE_ID \
  -H "Authorization: Bearer $CAPTUREFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "input_id": "'$INPUT_ID'", "instructions": "Two short LinkedIn posts, practical tone." }'
```

If that input already has a background run, it is returned with `reused: true` and the new `instructions` are not used. A reused run still counts toward the daily limit.

## Follow it

`GET /v1/agent/runs/{id}` until `status` is `completed` (or `failed`); it usually takes a few minutes. The finished run lists its drafts (up to 50) and `app_url`, where you review them and turn one into a post.

## Limits

* One run at a time per person in a workspace: [`agent_run_in_progress`](https://docs.captureflow.ai/api/errors#agent_run_in_progress), with `details.run_id`.
* 20 runs per person per workspace per day: [`agent_daily_limit`](https://docs.captureflow.ai/api/errors#agent_daily_limit).
* A daily limit for all background runs of a workspace: [`agent_workspace_limit`](https://docs.captureflow.ai/api/errors#agent_workspace_limit).
* The agent may be switched off for a workspace: [`agent_disabled`](https://docs.captureflow.ai/api/errors#agent_disabled).
* In an agency client workspace, members can't start runs ([`managed_member_restricted`](https://docs.captureflow.ai/api/errors#managed_member_restricted)).
* Agent calls have their own, tighter [rate limit](https://docs.captureflow.ai/guides/rate-limits.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.