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

# Detach Shipments from Appointment

> Remove one or more shipments from an appointment

Remove one or more shipments from this appointment. Silently ignores shipments that are not
currently linked. Mirror of [Detach Appointments from
Shipment](/api/shipments/detach-appointments-from-shipment).

Same mutation rule as attach: the link can be removed when EITHER the appointment is past
blood-draw, or the shipment was created less than 24 hours ago.

## Request

### Path parameters

<ParamField path="id" type="string" required>
  Appointment UUID.
</ParamField>

### Body parameters

<ParamField body="shipment_ids" type="string[]" required>
  Array of shipment reference IDs to detach. Must contain at least one item.
</ParamField>

## Response

On success, the API returns `200 OK` with the full shipment list for the appointment, ordered
newest-first by creation. Each entry has the same shape as [Get
Shipment](/api/shipments/get-shipment).

## Error responses

| Status | Description                                                                                                                      |
| ------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | Validation error — e.g., empty `shipment_ids` or malformed reference.                                                            |
| `403`  | Forbidden — missing scope, appointment outside access context, or shipment outside access context.                               |
| `404`  | Appointment not found, or one or more shipments not found.                                                                       |
| `409`  | Mutation rule failed — appointment not past blood-draw and at least one shipment is older than 24 hours. Response lists the IDs. |
| `500`  | Internal server error.                                                                                                           |

<RequestExample>
  ```bash cURL theme={null}
  curl --request DELETE \
    --url https://anivahealth.com/api/v1/appointments/c9f3e2a1-7d6b-4c5e-b3a2-1f0e9d8c7b6a/shipments \
    --header 'x-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "shipment_ids": ["P2604154821"]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  []
  ```
</ResponseExample>
