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

# Bulk Delete Hotel Stays

> Delete multiple hotel stay records and their associated emissions in a single request

# Bulk Delete Hotel Stays

Permanently deletes multiple hotel stay records and their associated `total_impacts` rows in a single request. Stays that belong to a different organization are reported as failed rather than raising an error.

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication

  **Example:** `Bearer sk_live_1234567890abcdef`
</ParamField>

<ParamField header="x-organization-id" type="string" required>
  Your organization UUID

  **Example:** `a8315ef3-dd50-43f8-b7ce-d839e68d51fa`
</ParamField>

### Request Body

<ParamField body="hotel_stay_ids" type="array[string]" required>
  List of hotel stay UUIDs to delete

  **Example:** `["550e8400-e29b-41d4-a716-446655440000", "550e8400-e29b-41d4-a716-446655440001"]`
</ParamField>

## Response

<ResponseField name="deleted" type="array[string]">
  UUIDs of hotel stays that were successfully deleted
</ResponseField>

<ResponseField name="failed" type="array[string]">
  UUIDs that could not be deleted (not found or belong to a different organization)
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X POST "https://api.dcycle.io/v1/hotel-stays/bulk-delete" \
    -H "Authorization: Bearer ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}" \
    -H "Content-Type: application/json" \
    -d '{
      "hotel_stay_ids": [
        "550e8400-e29b-41d4-a716-446655440000",
        "550e8400-e29b-41d4-a716-446655440001"
      ]
    }'
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests
  import os

  response = requests.post(
      "https://api.dcycle.io/v1/hotel-stays/bulk-delete",
      headers={
          "Authorization": f"Bearer {os.getenv('DCYCLE_API_KEY')}",
          "x-organization-id": os.getenv("DCYCLE_ORG_ID")
      },
      json={
          "hotel_stay_ids": [
              "550e8400-e29b-41d4-a716-446655440000",
              "550e8400-e29b-41d4-a716-446655440001"
          ]
      }
  )
  result = response.json()
  print(f"Deleted: {result['deleted']}")
  print(f"Failed:  {result['failed']}")
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const axios = require('axios');

  axios.post(
    'https://api.dcycle.io/v1/hotel-stays/bulk-delete',
    {
      hotel_stay_ids: [
        '550e8400-e29b-41d4-a716-446655440000',
        '550e8400-e29b-41d4-a716-446655440001'
      ]
    },
    {
      headers: {
        'Authorization': `Bearer ${process.env.DCYCLE_API_KEY}`,
        'x-organization-id': process.env.DCYCLE_ORG_ID
      }
    }
  )
  .then(r => {
    console.log('Deleted:', r.data.deleted);
    console.log('Failed:', r.data.failed);
  })
  .catch(error => console.error(error));
  ```
</CodeGroup>

### Successful Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "deleted": [
    "550e8400-e29b-41d4-a716-446655440000"
  ],
  "failed": [
    "550e8400-e29b-41d4-a716-446655440001"
  ]
}
```

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Delete Hotel Stay" icon="trash" href="/api-reference/hotel-stays/delete">
    Delete a single hotel stay
  </Card>

  <Card title="List Hotel Stays" icon="list" href="/api-reference/hotel-stays/list">
    Browse all hotel stays
  </Card>
</CardGroup>
