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

# Hard-erase a candidate and return a content-free receipt

> Hard-erase one Praxa memory candidate and receive a content-free, replay-safe deletion receipt without deleting its provider source.

Hard-erase one Praxa memory candidate and receive a content-free, replay-safe deletion receipt without deleting its provider source.

<Info>
  **Availability:** Qualification preview. **Required scope:** `memory:write`.
</Info>

## Authenticate safely

Create a disposable **personal workspace** API key with exactly `memory:write`. Send it as `Authorization: Bearer $PRAXA_API_KEY`. A Gateway OAuth token, Supabase JWT, provider credential, or organization memory key is not interchangeable with this key.

The hosted playground sends the credential from your browser session to the documented API through the configured playground proxy. Use test data, never share the key, and revoke it when the check ends.

## Request fields

<ParamField path="recordId" type="string" required>
  recordId path parameter.
</ParamField>

<ParamField header="Idempotency-Key" type="string" required>
  Stable key for one logical mutation. Reuse only with the exact same request; changed input under the same key returns a conflict.
</ParamField>

## Runnable request examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --fail-with-body -X DELETE 'https://api.praxa.io/v1/memory/records/018f0000-0000-7000-8000-000000000002' \
    -H "Authorization: Bearer $PRAXA_API_KEY" \
    -H "Idempotency-Key: playground-delete-memory-candidate-0001"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api.praxa.io/v1/memory/records/018f0000-0000-7000-8000-000000000002", {
    "method": "DELETE",
    "headers": {
      "Authorization": `Bearer ${process.env.PRAXA_API_KEY}`,
      "Idempotency-Key": "playground-delete-memory-candidate-0001"
    }
  });
  const text = await response.text();
  if (!response.ok) throw new Error(`${response.status}: ${text}`);
  console.log(text ? JSON.parse(text) : { status: response.status });
  ```

  ```python Python theme={null}
  import json
  import os
  from urllib import error, request

  req = request.Request(
      "https://api.praxa.io/v1/memory/records/018f0000-0000-7000-8000-000000000002",
      method="DELETE",
      headers={
        "Authorization": f"Bearer {os.environ['PRAXA_API_KEY']}",
        "Idempotency-Key": "playground-delete-memory-candidate-0001"
      },
  )
  try:
      with request.urlopen(req, timeout=30) as response:
          text = response.read().decode()
          print(json.loads(text) if text else {"status": response.status})
  except error.HTTPError as exc:
      raise RuntimeError(f"{exc.code}: {exc.read().decode()}") from exc
  ```
</CodeGroup>

## What success means

A `200` response confirms candidate erasure or exact deletion replay. Provider-owned source data is unchanged.

## Successful response

**200** — Candidate content erased or exact deletion replayed.

<ResponseField name="apiVersion" type="v1" required>
  apiVersion response field.
</ResponseField>

<ResponseField name="erased" type="true" required>
  erased response field.
</ResponseField>

<ResponseField name="replayed" type="boolean" required>
  replayed response field.
</ResponseField>

<ResponseField name="receipt" type="object" required>
  receipt response field.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "apiVersion": "v1",
    "erased": true,
    "replayed": false,
    "receipt": {
      "receiptId": "018f0000-0000-7000-8000-000000000001",
      "recordId": "018f0000-0000-7000-8000-000000000001",
      "providerId": "mem0",
      "sourceId": "source-id-demo-0001",
      "externalRecordId": "external-record-id-demo-0001",
      "revision": "revision-demo-0001",
      "sourceFingerprint": "source-fingerprint-demo-0001",
      "deletedAt": "2026-08-13T12:00:00.000Z",
      "receiptDigest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
    }
  }
  ```
</ResponseExample>

## Handle failures

| Response                    | Meaning                                                                    | Safe action                                                                         |
| --------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `400 invalid_request`       | The method, path, headers, query, or body failed strict validation.        | Correct the request; do not retry unchanged input.                                  |
| `401 authentication_failed` | The bearer key is missing, malformed, expired, or revoked.                 | Stop and replace the key through the authenticated console.                         |
| `403 authorization_failed`  | The authenticated key lacks scope or tenant authority.                     | Request only the missing least-privilege scope; never substitute another tenant ID. |
| `409 conflict`              | The same idempotency key was paired with different logical input or state. | Restore the original body or create a key for a genuinely new operation.            |
| `429 rate_limited`          | The principal exceeded a bounded rate.                                     | Honor `retryAfterMs` or `Retry-After`, add jitter, and cap attempts.                |
| retryable `5xx`             | The server could not confirm a final response.                             | Reconcile reads or replay the exact keyed mutation before creating new work.        |

```json Example problem theme={null}
{
  "type": "https://docs.praxa.io/problems/authorization-failed",
  "title": "Authorization failed",
  "status": 403,
  "code": "authorization_failed",
  "detail": "The API key does not grant the required scope.",
  "retryable": false
}
```

## Verify the result

1. Require `erased: true` and a content-free receipt.
2. Query the subject and confirm candidate content is absent.
3. Replay with the same key and require the same receipt.

## Retry, cleanup, and production use

* Treat `401`, `403`, and `409` as authority or state signals, not generic retry prompts.
* Reuse the idempotency key only for an exact retry of the same logical mutation.
* For `429` or retryable 5xx responses, follow server retry guidance and keep a bounded attempt budget.
* Move the request into a trusted application backend before production; never ship the Praxa key in browser or mobile code.
* Revoke the disposable key, disable test webhooks, and erase disposable candidate data after validation.

Continue with [API authentication](/api-playground/authentication), the [failure and retry guide](/api-playground/errors), and the [end-to-end coverage matrix](/api-playground/coverage-and-testing).
