***

title: errorKeys
slug: /reference/typescript/agents/data-map/error-keys
description: Set error detection keys for webhook responses.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ref-datamap]: /docs/server-sdks/reference/typescript/agents/data-map

[global-error-keys]: /docs/server-sdks/reference/typescript/agents/data-map/global-error-keys

Set error keys on the most recently added webhook, or at the top level if no
webhooks exist. If any of these keys appear in the API response, the response
is treated as an error.

To always set keys at the top level regardless of webhook context, use
[`globalErrorKeys()`][global-error-keys].

## **Parameters**

<ParamField path="keys" type="string[]" required={true} toc={true}>
  List of JSON keys whose presence indicates an error.
</ParamField>

## **Returns**

[`DataMap`][ref-datamap] -- Self for method chaining.

## **Example**

```typescript {5}
import { DataMap } from '@signalwire/sdk';

const dm = new DataMap('api_call');
dm.webhook('GET', 'https://api.example.com/data');
dm.errorKeys(['error', 'error_message']);
```