> Documentation index: https://beezr.io/developers/api/llms.txt

# Delete a record

`POST /api/v1/records/delete`

Delete a record.

## Requirements

| Requirement | Value |
| --- | --- |
| Auth | `X-API-Key` |
| Counts as | 1 request |
| Idempotency | not supported |
| Batch limit | n/a |

## Headers

| Parameter | Type | Presence | Description |
| --- | --- | --- | --- |
| `X-API-Key` | string | required | Read from your server environment. |
| `Content-Type` | string | required | `application/json`. |

## Body parameters

| Parameter | Type | Presence | Description |
| --- | --- | --- | --- |
| `module` | string | required | The module's table name, shown under the module name on its card in Beezr Designer (for example `cm_equipment_requests_base`). |
| `id` | integer | required | Minimum 1. |

## Returns

HTTP 200. Deleted.

| Parameter | Type | Presence | Description |
| --- | --- | --- | --- |
| `success` | boolean | optional | — |
| `data` | object | optional | — |
| `data.deleted` | boolean | optional | — |
| `data.id` | integer | optional | — |

## Errors

| HTTP | Code | What to do |
| --- | --- | --- |
| 400 | [`MISSING_REQUIRED_FIELD`](/developers/api/errors/#missing-required-field) | Send the required body fields. |
| 400 | [`KEY_FIELD_UNRESOLVED`](/developers/api/errors/#key-field-unresolved) | Check the module key field. |
| 401 | [`AUTHENTICATION_FAILED`](/developers/api/errors/#authentication-failed) | Check the API key. |
| 404 | [`MODULE_NOT_FOUND`](/developers/api/errors/#module-not-found) | Copy the module table name. |
| 429 | [`RATE_LIMIT_EXCEEDED`](/developers/api/errors/#rate-limit-exceeded) | Wait for the rate-limit reset. |
| 429 | [`TOO_MANY_CONCURRENT_REQUESTS`](/developers/api/errors/#too-many-concurrent-requests) | Wait; keep at most 2 in flight. |
| 429 | [`MONTHLY_QUOTA_EXCEEDED`](/developers/api/errors/#monthly-quota-exceeded) | Stop retries until the 1st. |
| 409 · 422 · 500 | [`DELETE_FAILED`](/developers/api/errors/#delete-failed) | 422 a rule refused it · 500 retry once. |
| 500 | [`FIELD_LOAD_FAILED`](/developers/api/errors/#field-load-failed) | Retry later. |
| 500 | [`INTERNAL_ERROR`](/developers/api/errors/#internal-error) | Retry later. |

## Request

```curl
curl --fail-with-body --silent --show-error \
  'https://services.beezr.io/generic/api/v1/records/delete' \
  -H "X-API-Key: $BEEZR_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{
  "module": "cm_equipment_requests_base",
  "id": 482913
}'
```

```javascript
const response = await fetch("https://services.beezr.io/generic/api/v1/records/delete", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.BEEZR_API_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "module": "cm_equipment_requests_base",
    "id": 482913
  })
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());
```

```python
import os
import requests

response = requests.post(
    "https://services.beezr.io/generic/api/v1/records/delete",
    headers={"X-API-Key": os.environ["BEEZR_API_KEY"]},
    json={
      "module": "cm_equipment_requests_base",
      "id": 482913
    }
)
response.raise_for_status()
print(response.json())
```

## Success response

```json
{
  "success": true,
  "data": {
    "deleted": true,
    "id": 482913
  }
}
```

## Common error

```json
{"success":false,"error":{"code":"AUTHENTICATION_FAILED","message":"Invalid or missing API key"}}
```
