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

# Debugging

> Use trace IDs, event IDs, and resource IDs to debug Relay integrations.

Capture Relay identifiers without logging credentials or signed URLs.

## IDs to record

| ID                 | Use                                     |
| ------------------ | --------------------------------------- |
| `trace_id`         | Correlate a failed API request or event |
| `event_id`         | Deduplicate and trace one agent event   |
| Chat ID            | Identify the conversation               |
| Message ID         | Identify one canonical send             |
| Attachment ID      | Identify uploaded metadata              |
| WebSocket sequence | Diagnose one agent checkpoint           |

## Error response

```json theme={null}
{
  "error": {
    "status":409,
    "code":1005,
    "message":"Idempotency key was already used for different message content.",
    "doc_url":"https://docs.relayapp.im/error/codes/1xxx/1005"
  },
  "success":false,
  "trace_id":"b923d71e50be43ba9e0fe1e34a7676c2"
}
```

Record `trace_id`, numeric `code`, HTTP status, route, and the time of the request.

## Safe logs

Do not log:

* Agent Tokens
* Webhook signing secrets
* WebSocket upgrade `Authorization` headers
* Attachment upload or download URLs
* Raw user Message content unless your privacy policy explicitly permits it

## Event debugging

For webhooks, compare `webhook-id` with envelope `event_id`. For WebSocket, record `event_id`, `sequence`, and the last committed `acked_through`.

## Related

* [Error Codes](/error)
* [Webhook delivery](/guides/webhooks/delivery)
