> ## 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.

# Delete Custom Record

> Delete a custom emission factor record

[← Custom Emission Factors](/api-reference/custom-emission-factors/overview)

Deletes a record that no data uses. Returns `204 No Content`.

<Warning>
  **Beta.** Part of the custom emission factors API, currently in beta. The contract may still change before general
  availability.
</Warning>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X DELETE "https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/records/c3d4e5f6-a7b8-9012-cdef-ab3456789012" \
    -H "x-api-key: ${DCYCLE_API_KEY}" \
    -H "x-organization-id: ${DCYCLE_ORG_ID}"
  ```

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

  import requests

  response = requests.delete(
      "https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/records/c3d4e5f6-a7b8-9012-cdef-ab3456789012",
      headers={
          "x-api-key": os.environ["DCYCLE_API_KEY"],
          "x-organization-id": os.environ["DCYCLE_ORG_ID"],
      },
      timeout=30,
  )
  response.raise_for_status()
  ```

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

  const response = await axios.delete('https://api.dcycle.io/v1/emission-factors/custom-databases/5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b/versions/7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d/records/c3d4e5f6-a7b8-9012-cdef-ab3456789012', {
    headers: {
      'x-api-key': process.env.DCYCLE_API_KEY,
      'x-organization-id': process.env.DCYCLE_ORG_ID,
    },
  });
  console.log(response.status, response.data);
  ```
</RequestExample>

<ResponseExample>
  ```text 204 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  (empty body)
  ```
</ResponseExample>

## Request

### Headers

<ParamField header="x-api-key" type="string" required>
  Your API key for authentication

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

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

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

<ParamField path="database_id" type="uuid" required>
  The database id.

  **Example:** `5f1c2e7a-3b4d-4e8f-9a01-2c3d4e5f6a7b`
</ParamField>

<ParamField path="source_id" type="uuid" required>
  The version id (`id` of the version).

  **Example:** `7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d`
</ParamField>

<ParamField path="record_id" type="uuid" required>
  The record id.

  **Example:** `c3d4e5f6-a7b8-9012-cdef-ab3456789012`
</ParamField>

## Response

Returns `204 No Content` on success.

## Common Errors

### 401 Unauthorized

Missing or invalid API key.

### 403 Forbidden

`LOGGED_USER_NOT_MEMBER`: the API key's user is not a member of the organization in `x-organization-id`.

### 404 CUSTOM\_RECORD\_NOT\_FOUND

The record does not exist in that version or is not visible.

### 403 CUSTOM\_DATABASE\_NOT\_OWNER

Only the organization that owns the database can delete its records.

### 409 CUSTOM\_RECORD\_IN\_USE

Data already uses the record. Disable it instead with [Update Record](/api-reference/custom-emission-factors/update-record) (`"enabled": false`).

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Update Record" icon="pencil" href="/api-reference/custom-emission-factors/update-record">
    Disable a record instead
  </Card>

  <Card title="List Records" icon="list" href="/api-reference/custom-emission-factors/list-records">
    Records of a version
  </Card>
</CardGroup>
