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

# Media

> Create captioned media clips and retrieve transcript text or word timing data.

Media endpoints help applications turn transcript-backed audio or video into reviewable outputs. Use them to create captioned clips from vault media, retrieve transcript text, and search timestamped transcript words for clip assembly or evidence review.

<CardGroup cols={2}>
  <Card title="Captioned clips" icon="scissors">
    Generate short captioned video clips from source media and transcript word ranges.
  </Card>

  <Card title="Transcript utilities" icon="captions">
    Retrieve transcript text or search transcript words with timing metadata.
  </Card>
</CardGroup>

## Create a clip

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl -X POST https://api.case.dev/media/v1/clips \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "source": {
      "vault_id": "vault_abc123",
      "object_id": "obj_media123"
    },
    "transcript": {
      "object_id": "obj_transcript123"
    },
    "selection": {
      "type": "word_range",
      "start_word": 120,
      "end_word": 260
    }
  }'
```

Clip creation is asynchronous. The response returns a job ID that you can poll until the clip is complete.

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl "https://api.case.dev/media/v1/clips/{id}" \
  -H "Authorization: Bearer $CASE_API_KEY"
```

## Work with transcripts

Use transcript retrieval when you need the full text for display, export, or downstream analysis.

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl -X POST https://api.case.dev/media/v1/transcripts/retrieve \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "vault_id": "vault_abc123",
    "object_id": "obj_media123"
  }'
```

Use transcript word search when you need exact word ranges and timing for clip selection.

```bash title="Shell" theme={"theme":{"light":"github-light","dark":"one-dark-pro"}}
curl -X POST https://api.case.dev/media/v1/transcripts/search \
  -H "Authorization: Bearer $CASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "transcript": {
      "vault_id": "vault_abc123",
      "object_id": "obj_transcript123"
    },
    "query": "contract termination"
  }'
```

See the [API Reference](/api-reference) for full request and response schemas.
