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

# Auto-Processing

> Automatically transcribe and summarize recordings when they are uploaded, with configurable providers and templates.

## Overview

Auto-Processing lets you automatically transcribe recordings when they're uploaded, and optionally generate summaries when transcription completes — without any additional API calls.

```mermaid theme={null}
flowchart LR
    A["Recording Created"] -- "Upload complete" --> B["Uploaded"]
    B -- "Auto-transcribe" --> C["Transcription"]
    C -- "Auto-summarize" --> D["Summary"]
```

**Benefits:**

* Zero-code processing pipeline — upload once, get transcription and summary automatically
* Configurable per organization, project, end user, or device
* Choose your preferred ASR provider and LLM provider at each level
* Non-blocking — auto-processing errors never fail the upload

**Use Cases:**

* Medical clinics: Upload recording → auto-transcribe → auto-generate SOAP notes
* Sales teams: Upload call recording → auto-transcribe → auto-generate deal summary
* Legal firms: Upload consultation → auto-transcribe → auto-generate legal memo
* Enterprise: Upload meeting → auto-transcribe → auto-generate meeting notes

***

## Quick Start

Enable auto-processing for an entire project with a single API call:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT https://api.bota.dev/v1/projects/proj_xxx/config/processing \
    -H "Authorization: Bearer sk_live_..." \
    -H "Content-Type: application/json" \
    -d '{
      "auto_transcription": {
        "enabled": true
      },
      "auto_summary": {
        "enabled": true,
        "template": "general_notes"
      }
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch('https://api.bota.dev/v1/projects/proj_xxx/config/processing', {
    method: 'PUT',
    headers: {
      'Authorization': 'Bearer sk_live_...',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      auto_transcription: { enabled: true },
      auto_summary: { enabled: true, template: 'general_notes' },
    }),
  });
  ```

  ```python Python theme={null}
  import requests

  requests.put(
      'https://api.bota.dev/v1/projects/proj_xxx/config/processing',
      headers={
          'Authorization': 'Bearer sk_live_...',
          'Content-Type': 'application/json',
      },
      json={
          'auto_transcription': {'enabled': True},
          'auto_summary': {'enabled': True, 'template': 'general_notes'},
      },
  )
  ```
</CodeGroup>

Now every recording uploaded in this project will be automatically transcribed and summarized.

***

## How It Works

### Processing Flow

1. **Recording upload completes** — your app calls `POST /v1/recordings/:id/upload-complete`
2. **Auto-transcription check** — the system resolves the `processing` config for the recording's device/end\_user/project
3. **If enabled** — a transcription job is queued automatically (same as calling `POST /v1/recordings/:id/transcribe`)
4. **Transcription completes** — the worker checks the same config for auto-summary settings
5. **If enabled** — a summary job is queued automatically (same as calling `POST /v1/summaries`)
6. **Webhooks fire** — `transcription.completed` and `summary.completed` events are sent as usual

### Config Resolution

The system determines which processing settings to apply based on the recording's context:

```mermaid theme={null}
flowchart TD
    A{"Has device_id?"} -- Yes --> B["Resolve for device"]
    A -- No --> C{"Has end_user_id?"}
    C -- Yes --> D["Resolve for end_user"]
    C -- No --> E["Resolve for project"]
```

This means you can set different processing rules at each level. See [Hierarchical Configuration](/guides/hierarchical-config) for details on how inheritance works.

### Error Handling

Auto-processing is **non-blocking**. If auto-transcription or auto-summary fails:

* The upload still completes successfully
* The error is logged but does not affect the parent operation
* You can always retry manually via the API

<Warning>
  Auto-processing requires that the relevant AI provider API keys are configured. If you're using [user-provided API keys](/api-reference/integrations), they will be used automatically. Otherwise, the system falls back to Bota's default keys.
</Warning>

***

## Configuration

### Processing Config Schema

```json theme={null}
{
  "processing": {
    "auto_transcription": {
      "enabled": false,
      "provider": "whisper"
    },
    "auto_summary": {
      "enabled": false,
      "provider": "gemini",
      "template": "general_notes"
    }
  }
}
```

### Auto-Transcription Settings

| Field      | Type    | Default        | Description                              |
| ---------- | ------- | -------------- | ---------------------------------------- |
| `enabled`  | boolean | `false`        | Enable automatic transcription on upload |
| `provider` | string  | System default | ASR provider to use                      |

**Available ASR Providers:**

| Provider     | Description                                              |
| ------------ | -------------------------------------------------------- |
| `whisper`    | OpenAI Whisper (default) — 99 languages, word timestamps |
| `deepgram`   | Deepgram Nova-2 — real-time capable, speaker diarization |
| `assemblyai` | AssemblyAI — Best/Nano models                            |
| `elevenlabs` | ElevenLabs — high accuracy, language detection           |

### Auto-Summary Settings

| Field      | Type    | Default         | Description                                  |
| ---------- | ------- | --------------- | -------------------------------------------- |
| `enabled`  | boolean | `false`         | Enable automatic summary after transcription |
| `provider` | string  | System default  | LLM provider to use                          |
| `template` | string  | `general_notes` | Summary template                             |

**Available LLM Providers:**

| Provider | Description                                     |
| -------- | ----------------------------------------------- |
| `gemini` | Google Gemini 2.0 Flash (default) — JSON output |
| `openai` | OpenAI GPT-4o — JSON mode                       |
| `claude` | Anthropic Claude Sonnet 4 — structured output   |

**Available Templates:**

| Template        | Industry         | Output                                               |
| --------------- | ---------------- | ---------------------------------------------------- |
| `general_notes` | General meetings | Key points, action items, decisions                  |
| `sales_call`    | Sales            | Pain points, budget, timeline, next steps            |
| `clinical_soap` | Healthcare       | SOAP notes (Subjective, Objective, Assessment, Plan) |
| `legal_memo`    | Legal            | Facts, issues, analysis, conclusion                  |

***

## Setting Config at Different Levels

Auto-processing uses the [hierarchical configuration system](/guides/hierarchical-config), so you can set it at any level.

### Project Level

Apply to all recordings in a project:

```bash theme={null}
curl -X PUT https://api.bota.dev/v1/projects/proj_xxx/config/processing \
  -H "Authorization: Bearer sk_live_..." \
  -d '{
    "auto_transcription": { "enabled": true, "provider": "whisper" },
    "auto_summary": { "enabled": true, "template": "sales_call" }
  }'
```

### End User Level

Override for a specific end user (e.g., a clinician who needs SOAP notes):

```bash theme={null}
curl -X PUT https://api.bota.dev/v1/end-users/eu_drsmith/config/processing \
  -H "Authorization: Bearer sk_live_..." \
  -d '{
    "auto_summary": { "template": "clinical_soap" }
  }'
```

<Note>
  You only need to specify the fields you want to override. Dr. Smith's recordings will still inherit `auto_transcription` and `auto_summary.enabled` from the project level — only the template changes.
</Note>

### Device Level

Override for a specific device:

```bash theme={null}
curl -X PUT https://api.bota.dev/v1/devices/dev_abc123/config/processing \
  -H "Authorization: Bearer sk_live_..." \
  -d '{
    "auto_transcription": { "provider": "deepgram" }
  }'
```

### Disable for a Specific Entity

Disable auto-processing at a lower level even if the parent has it enabled:

```bash theme={null}
# Project has auto-transcription enabled, but disable for this device
curl -X PUT https://api.bota.dev/v1/devices/dev_abc123/config/processing \
  -H "Authorization: Bearer sk_live_..." \
  -d '{
    "auto_transcription": { "enabled": false }
  }'
```

### Remove Override (Revert to Inherited)

Delete the processing override to revert to the parent's settings:

```bash theme={null}
curl -X DELETE https://api.bota.dev/v1/devices/dev_abc123/config/processing \
  -H "Authorization: Bearer sk_live_..."
```

***

## Monitoring

### Webhook Events

Auto-processing triggers the same webhook events as manual processing:

| Event                     | Trigger                       |
| ------------------------- | ----------------------------- |
| `transcription.started`   | Auto-transcription job begins |
| `transcription.completed` | Auto-transcription finished   |
| `transcription.failed`    | Auto-transcription failed     |
| `summary.started`         | Auto-summary job begins       |
| `summary.completed`       | Auto-summary finished         |
| `summary.failed`          | Auto-summary failed           |

Subscribe to these events to track processing status. See [Webhook Events](/webhooks/events) for payload details.

### Checking Results

After auto-processing completes, retrieve results the same way as manual processing:

<CodeGroup>
  ```bash cURL theme={null}
  # Get transcription for a recording
  curl https://api.bota.dev/v1/transcriptions/txn_abc123 \
    -H "Authorization: Bearer sk_live_..."

  # Get summary
  curl https://api.bota.dev/v1/summaries/sum_abc123 \
    -H "Authorization: Bearer sk_live_..."
  ```

  ```javascript Node.js theme={null}
  // Get transcription
  const txn = await fetch('https://api.bota.dev/v1/transcriptions/txn_abc123', {
    headers: { 'Authorization': 'Bearer sk_live_...' },
  }).then(r => r.json());

  console.log(txn.text);     // Full transcript
  console.log(txn.provider); // 'whisper' (or whichever was configured)
  ```

  ```python Python theme={null}
  # Get transcription
  txn = requests.get(
      'https://api.bota.dev/v1/transcriptions/txn_abc123',
      headers={'Authorization': 'Bearer sk_live_...'},
  ).json()

  print(txn['text'])
  print(txn['provider'])  # 'whisper'
  ```
</CodeGroup>

### Verifying Current Config

Check the resolved processing config for any entity:

```bash theme={null}
curl https://api.bota.dev/v1/devices/dev_abc123/config/processing \
  -H "Authorization: Bearer sk_live_..."
```

```json theme={null}
{
  "data": {
    "auto_transcription": {
      "enabled": true,
      "provider": "whisper"
    },
    "auto_summary": {
      "enabled": true,
      "provider": "gemini",
      "template": "clinical_soap"
    }
  }
}
```

***

## Troubleshooting

### Recording Uploaded But Not Auto-Transcribed

**Check:**

1. Processing config is enabled: `GET /v1/devices/:id/config/processing`
2. Recording reached `uploaded` status (check `recording.uploaded` webhook)
3. ASR provider API key is configured (system default or [user-provided](/api-reference/integrations))

### Auto-Transcription Works But No Summary

**Check:**

1. `auto_summary.enabled` is `true` in resolved config
2. Transcription completed successfully (not `failed`)
3. LLM provider API key is configured

### Wrong Provider or Template Used

Config is resolved from the recording's context at the time of processing. Check which level the setting is coming from:

```bash theme={null}
# Check device-level override
GET /v1/devices/:id/config/processing

# Check end-user-level override
GET /v1/end-users/:id/config/processing

# Check project-level config
GET /dashboard/projects/:projectId/config
```

A more specific level always takes precedence. To revert to the parent's setting, delete the override at the lower level.

***

<CardGroup cols={2}>
  <Card title="Hierarchical Config" icon="layer-group" href="/guides/hierarchical-config">
    Learn how config inheritance works
  </Card>

  <Card title="Create Transcription" icon="file-lines" href="/api-reference/transcriptions/create">
    Manual transcription API reference
  </Card>

  <Card title="Create Summary" icon="wand-magic-sparkles" href="/api-reference/summaries/create">
    Manual summary API reference
  </Card>

  <Card title="Webhook Events" icon="bell" href="/webhooks/events">
    Subscribe to processing events
  </Card>
</CardGroup>
