> For the complete documentation index, see [llms.txt](https://diffio.ai/llms.txt). This page is also available as HTML at https://diffio.ai/docs/api-reference/get-transcript-draft/.

# Get the transcript draft

Reads the saved transcript editor draft (`data`) and its opaque `revision` string for a generation.

GET `https://api.diffio.ai/v2/projects/{project_id}/generations/{generation_id}/transcript/draft`

- Key scope: `generations:read`
- Auth header: `Authorization: Bearer <apiKey>`
- Body: None

## Request

Pass `project_id` and `generation_id` in the path; takes no request body.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | string | Yes | Unique identifier of the project. |
| `generation_id` | string | Yes | Unique identifier of the generation within the project. |

### Headers

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `Diffio-End-User` | string | No | Optional end-user identifier (up to 128 characters). Scopes the request to that end user's projects; omit to act across the whole account. |

## Example request

**Python**

```python
import os
from diffio import DiffioClient

key = os.environ["DIFFIO_API_KEY"]
client = DiffioClient(api_key=key)

draft = client.transcripts.get_draft(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
    "ce832a32-a1ce-516a-b8bd-75457bd8517f",
)
```

**Node.js**

```javascript
import { DiffioClient } from "diffio"

const client = new DiffioClient({
  apiKey: process.env.DIFFIO_API_KEY,
})

const draft =
  await client.transcripts.getDraft(
    "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
    "ce832a32-a1ce-516a-b8bd-75457bd8517f",
  )
```

**cURL**

```bash
curl "https://api.diffio.ai/v2/projects/62f62565-049f-5e7e-bbd2-9de0cf7ddbfe/generations/ce832a32-a1ce-516a-b8bd-75457bd8517f/transcript/draft" \
  -H "Authorization: Bearer $DIFFIO_API_KEY"
```

## Response

Returns the `transcript_draft` (`data: null` with a valid `revision` when nothing is saved).

Success: `200`

### Response fields

| Field | Type | Present | Description |
| --- | --- | --- | --- |
| `object` | string | Always | Resource type, always `"transcript_draft"`. |
| `project_id` | string | Always | Identifier of the parent project. |
| `generation_id` | string | Always | Identifier of the generation. |
| `revision` | string | Always | Opaque revision string (`"0"` before the first save); send back when saving or deleting to detect concurrent edits. |
| `data` | object \| null | Always | Saved JSON object exactly as sent to `PUT .../transcript/draft`, or `null` when no draft is saved. |
| `created_at` | string \| null | Always | ISO 8601 UTC timestamp when the current draft was first created, or `null` when empty. |
| `updated_at` | string \| null | Always | ISO 8601 UTC timestamp when the draft was last saved, or `null` when empty. |

## Example response (200)

**Successful response**

```json
{
  "object": "transcript_draft",
  "project_id": "62f62565-049f-5e7e-bbd2-9de0cf7ddbfe",
  "generation_id": "ce832a32-a1ce-516a-b8bd-75457bd8517f",
  "revision": "0",
  "data": null,
  "created_at": null,
  "updated_at": null
}
```

## Return codes

- `200` Returns the current draft `data` (or `null`) and `revision`.
- `400` `Diffio-End-User` exceeds 128 characters. [`invalid_header`](https://diffio.ai/docs/api-reference/errors/#invalid_header)
- `403` Key is inactive or lacks `generations:read`. [`permission_denied`](https://diffio.ai/docs/api-reference/errors/#permission_denied)
- `404` Project not found, or generation not found. [`project_not_found`](https://diffio.ai/docs/api-reference/errors/#project_not_found) [`generation_not_found`](https://diffio.ai/docs/api-reference/errors/#generation_not_found)
- **`401` `405` Same on every endpoint**

  - `401` Missing API key (code missing_api_key), or invalid API key (code invalid_api_key).
  - `405` HTTP method not supported on this path; check the Allow header (code method_not_allowed).

### Example error response

Errors are JSON: an `error` object with `code`, `message` and `request_id`. An unrecognized key returns `401`:

**Error response**

```json
{
  "error": {
    "code": "invalid_api_key",
    "message": "Invalid API key.",
    "request_id": "dead773b60e148fd9e22d680a22fa701"
  }
}
```

## Notes

- Each generation has one draft shared across callers with access to the project, and draft reads/writes are free.
- Even when no draft has been saved yet (or after a delete), `GET` returns `200` with `data: null` and the current `revision` so the first save can still use compare-and-swap.

## Related pages

- Previous: [Get a generation's transcript](https://diffio.ai/docs/api-reference/get-transcript/): Retrieve a generation's normalized word-timed transcript for display, assistant turns, or Pro edits.
- Next: [Save the transcript draft](https://diffio.ai/docs/api-reference/save-transcript-draft/): Save an editor's JSON draft state (up to 900,000 bytes) for a generation's transcript.

- [Full API guide](https://diffio.ai/docs/developers/full-api-guide/): Every topic, limit and concept in one index.
- [Billing](https://diffio.ai/docs/overview/administration/billing/): Starter credit, metering and invoices.
