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

# Delete Transcription

> Delete the transcription stored for a specific appointment.

## Overview

Deletes the transcription stored for a specific appointment, located by `appointment_id`. The caller must be the appointment's owning doctor. On success the endpoint returns `{ "success": true }` with no body payload.

<Warning>
  **Permanent deletion.** This operation permanently removes the transcription record and cannot be undone.
</Warning>

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer JWT token. The calling user is derived from the token.

  ```
  Authorization: Bearer <JWT>
  ```
</ParamField>

## Path Parameters

<ParamField path="appointmentId" type="string" required>
  The appointment ObjectId whose transcription is deleted (looked up by `appointment_id`). The caller must be the appointment's owning doctor.

  ```
  665f8a1b2c3d4e5f6789012f3
  ```
</ParamField>

## Response

<ResponseField name="success" type="boolean" required>
  Always `true` on a successful deletion. No further payload is returned.
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X DELETE \
    'https://app.medisync.me/api/transcriptions/665f8a1b2c3d4e5f6789012f3' \
    -H 'Authorization: Bearer <JWT>'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.medisync.me/api/transcriptions/665f8a1b2c3d4e5f6789012f3',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer <JWT>'
      }
    }
  );

  const result = await response.json();
  ```

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

  headers = {'Authorization': 'Bearer <JWT>'}

  response = requests.delete(
      'https://app.medisync.me/api/transcriptions/665f8a1b2c3d4e5f6789012f3',
      headers=headers
  )

  result = response.json()
  ```
</CodeGroup>

## Example Response

```json Success (200) theme={null}
{
  "success": true
}
```

## Error Responses

```json 401 Unauthorized theme={null}
{
  "success": false,
  "message": "Unauthorized"
}
```

```json 403 Forbidden (not the owning doctor) theme={null}
{
  "success": false,
  "error": "Forbidden"
}
```

```json 404 Transcription Not Found theme={null}
{
  "success": false,
  "error": "Transcription not found"
}
```

```json 404 Appointment Not Found theme={null}
{
  "success": false,
  "error": "Appointment not found"
}
```

<Note>
  The `Unauthorized` response uses the `message` field; handler-level errors use the `error` field. Unexpected server errors return `500 { "success": false, "error": "<message>" }`.
</Note>

## Behavior Notes

* **Lookup by appointment**: The transcription is located by `appointment_id`.
* **Ownership**: Only the appointment's owning doctor may delete its transcription; otherwise the request returns `403 Forbidden`.
* **Distinct 404s**: `Transcription not found` is returned when no transcription exists for the appointment; `Appointment not found` is returned when the transcription exists but its appointment does not.
* **Success shape**: A successful deletion returns `{ "success": true }` only.
