# Export a transcript

Downloads a completed transcript as plain text, or as SRT or WebVTT subtitles.

`GET /v1/transcripts/{id}/export` on `https://api.eu.vatis.tech`

> **Needs batch transcription.** Transcripts are the results of files, so this works once batch is open on your workspace ([Batch transcription](https://platform.vatis.tech/docs/batch)). A live session keeps no transcript.

## Path parameters

| parameter | values | default | meaning |
|---|---|---|---|
| `id` | a transcript id, `tr_...` | required | The transcript: the `id` of the answer to [Create a transcript](https://platform.vatis.tech/docs/endpoints/create-a-transcript). |

## Headers

| header | values | default | meaning |
|---|---|---|---|
| `Authorization` | `Bearer <api key>` | required | Your API key ([Authentication and API keys](https://platform.vatis.tech/docs/authentication)). |

## Query parameters

| parameter | values | default | meaning |
|---|---|---|---|
| `format` | `txt`, `srt`, `vtt` | required | Plain text, SRT subtitles, or WebVTT subtitles. |
| `timestamps` | `true`, `false` | `true` | `txt` only: each paragraph starts with its time, `[01:05]`, or `[1:02:03]` past the first hour. |
| `speakers` | `true`, `false` | `true` | Name the speaker: `Speaker 1` for `speaker_0`, `Channel 1` for `channel_0`. A transcript without speakers has none to name. |
| `lines` | 1 to 3 | `2` | `srt` and `vtt` only: lines per caption. |
| `words_per_line` | 3 to 12 | `7` | `srt` and `vtt` only: words per line. |

## Responses

`200`: The file, in UTF-8, with `Content-Disposition: attachment; filename="<id>.<format>"` and the `Content-Type` `text/plain; charset=utf-8`, `application/x-subrip; charset=utf-8` or `text/vtt; charset=utf-8`. Here, `format=txt`.

```
[00:00] Speaker 1: Bună ziua, luați loc.

[00:02] Speaker 2: Am venit pentru contractul din 12 martie.
```

`400` `invalid_parameter`: A parameter unknown, sent twice, out of range, or not one the format takes (`lines` with `txt`, `timestamps` with `srt`); or subtitles of a transcript made with `timestamps=none` (`param` `format`).

`400` `missing_parameter`: No `format`.

```json
{
  "error": {
    "code": "missing_parameter",
    "message": "'format' is required: txt, srt or vtt.",
    "param": "format",
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`401` `unauthorized`: No key, or a wrong, revoked or expired one.

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid, revoked or expired key.",
    "param": null,
    "request_id": "req_bf2fed760ba5437ba0933a57"
  }
}
```

`404` `not_found`: An id that is unknown, deleted or past its 7 days; one sent with `store=false`; or another key's transcript, to a Member key.

`409` `not_completed`: The transcript is still `queued` or `processing`, or it `failed`. Wait until it is `completed`.

`503` `unavailable`: The service is busy for a moment. Send the request again after the seconds of the `Retry-After` header.

## Notes

- Booleans are `true` or `false` (also `1` or `0`). An empty value counts as not sent.
- To save the file under the name the API gives, `<id>.<format>`: `curl -sS -H "Authorization: Bearer $VATIS_KEY" -OJ "https://api.eu.vatis.tech/v1/transcripts/$ID/export?format=srt"`.
- What the files look like, and how their captions are cut: [What the files look like](https://platform.vatis.tech/docs/batch/exports#what-the-files-look-like).
- With `store=false` nothing is kept to export: ask for the files with the request, in `exports` ([Create a transcript](https://platform.vatis.tech/docs/endpoints/create-a-transcript)).
