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

# Submit transcript text

> Append conversation text you already have and mark the final batch complete.

Add consultation text to an existing session. For audio, use
[recording uploads](/developers/recordings.md) or [segmented transcription](/developers/segmented-transcription.md).

**Scopes:** `scribe:write` to submit text; `scribe:read` to retrieve it.

## Append a batch

`POST /sessions/{session_id}/transcript/segments`

```bash theme={null}
curl --request POST "$CORTEXA_API_BASE/sessions/$CORTEXA_SESSION_ID/transcript/segments" \
  --header "Authorization: Bearer $CORTEXA_JWT" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: visit-001-text-batch-1' \
  --data '{"segments":[{"speaker":"clinician","text":"How has your sleep been?","start_seconds":0,"end_seconds":3},{"speaker":"patient","text":"It has improved since the last visit.","start_seconds":4,"end_seconds":8}],"language_code":"en","status":"completed"}'
```

| Field | Required | Description |
| - | - | - |
| `segments` | Yes | 1–1,000 segments in this batch |
| `segments[].text` | Yes | Nonempty text, up to 100,000 characters per segment |
| `segments[].speaker` | No | Speaker label supplied by your application |
| `segments[].start_seconds` / `end_seconds` | No | Nonnegative timestamps in seconds |
| `language_code` | No | Transcript language |
| `status` | No | `partial` for more text to come; `completed` for the final batch, which is the default |

The response includes `status`, `full_text`, `language`, and `segments`.

## Send multiple batches

Send only new segments in each batch. Use `partial` until the final batch, then
`completed`. Give each batch a new `Idempotency-Key`; retry a lost response with
the same key and body to avoid appending it twice.

## Retrieve the transcript

```bash theme={null}
curl "$CORTEXA_API_BASE/sessions/$CORTEXA_SESSION_ID/transcript" \
  --header "Authorization: Bearer $CORTEXA_JWT"
```

Example response excerpt:

```json theme={null}
{
  "status": "completed",
  "full_text": "How has your sleep been?\nIt has improved since the last visit.",
  "language": "en"
}
```

`404 TRANSCRIPT_NOT_FOUND` means a transcript is not available yet. If you used
complete audio upload, check its transcription job. If you used segmented audio,
call finish after all chunks have been accepted.

Once the transcript and any required [context](/developers/context.md) are ready,
[generate a consult note](/developers/notes.md).


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