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

# Eliminar datastore

> Eliminar un datastore y todos sus datasources.

## Endpoint

```
DELETE /api/datastores/{datastoreId}
```

<Warning>
  Esta operación es irreversible. Todos los datasources y datos asociados serán eliminados.
</Warning>

<Note>
  Si el datastore tiene datasources, la eliminación se procesa en segundo plano. El estado cambiará a `pending_deletion`.
</Note>

## Path Parameters

<ParamField path="datastoreId" type="string" required>
  ID del datastore a eliminar
</ParamField>

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token con tu API key. Formato: `Bearer sk_live_xxx`
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE https://app.horneross.com/api/datastores/ds_abc123 \
    -H "Authorization: Bearer sk_live_xxx"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.horneross.com/api/datastores/ds_abc123',
    {
      method: 'DELETE',
      headers: {
        'Authorization': 'Bearer sk_live_xxx',
      },
    }
  );

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

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

  response = requests.delete(
      'https://app.horneross.com/api/datastores/ds_abc123',
      headers={'Authorization': 'Bearer sk_live_xxx'}
  )

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

## Response

<ResponseField name="id" type="string" required>
  ID del datastore eliminado
</ResponseField>

<ResponseField name="name" type="string">
  Nombre del datastore
</ResponseField>

<ResponseField name="status" type="string">
  Estado de eliminación (si tiene datasources)
</ResponseField>

<ResponseExample>
  ```json 200 - Success (sin datasources) theme={null}
  {
    "id": "ds_abc123",
    "name": "Datastore eliminado"
  }
  ```

  ```json 200 - Success (con datasources - eliminación en segundo plano) theme={null}
  {
    "id": "ds_abc123",
    "name": "Datastore",
    "status": "pending_deletion"
  }
  ```

  ```json 400 - Bad Request theme={null}
  {
    "error": {
      "code": "INVALID_REQUEST",
      "message": "No se puede eliminar el datastore Root"
    }
  }
  ```
</ResponseExample>
