---
title: "Set a Datadog integration's API keys"
method: PUT
path: "/v1/integrations/datadog/{id}/api-keys"
tags: ["Datadog Integration"]
---

# Set a Datadog integration's API keys

`PUT /v1/integrations/datadog/{id}/api-keys`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/integrations/datadog/{id}/api-keys`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Replaces the integration's entire set of API keys in one atomic write. Existing keys are referenced by id (kept or rotated), new keys carry only a value, and omitted keys are removed; one key is marked as the send key used to write data back to Datadog. If any key is rejected the existing set is left unchanged. All keys are accepted for inbound telemetry. Requires the organization to have multiple Datadog API keys enabled. Adding, removing, relabeling, or rotating a key other than the send key is allowed while the integration's pipeline is running; a change that affects the send key (which key it is, or its value) requires the pipeline to be stopped, since that key is baked into the running Flink job.

## Path parameters

- `id` string, required

## Request body

- SetApiKeysRequest: Replaces the full set of API keys for a Datadog integration in one atomic write
  - `keys` ApiKey[], required: The complete desired set of API keys
    - `keyId` string: Id of an existing key to keep or rotate
    - `label` string: User-supplied display name for the key, purely informational. Omitting it clears any existing label.
    - `sendKey` boolean: Whether this key is used to send data back to Datadog
    - `value` string: The cleartext key value (for an added or rotated key)

## Response `200`

API keys updated successfully

- ReadDatadog
  - `createdAt` string, date-time, required: Timestamp when the integration was created.
  - `id` string, required: The integration id
  - `jobIds` string[], required: List of job IDs associated with the integration.
  - `name` string, required: Name of the integration.
  - `organizationId` string, required: Organization ID of the integration.
  - `payload` Datadog, required: The payload containing integration data.
    - `additionalTags` string[], required: Tags to add when writing data to Datadog
    - `apiKey` string: Masked API key for Datadog
    - `apiKeys` IngestKeyView[]: The API keys configured for this integration (masked).
      - `keyId` string: Opaque identifier of the API key
      - `label` string: User-supplied display name for the key, purely informational
      - `maskedValue` string: Masked value of the API key
      - `sendKey` boolean: Whether this key is used to send data back to the vendor
    - `appKey` string: Masked App key for Datadog
    - `clientToken` string: Client token for Datadog
    - `dashboardFreshnessWindow` string, ISO-8601: The active dashboard threshold: only dashboards viewed within it are imported as parsed queries. When unset, every dashboard is imported. Minimum one day.
    - `exceptions` object: The imported exceptions from Datadog. This is a map from the vendor resource Id to the exception.
    - `filterQuery` string, required: Filter to apply when reading any data from the Datadog API
    - `includeNeverViewedDashboards` boolean: When the active dashboard threshold is set, whether dashboards that were never viewed are still imported. Unset means they are.
    - `sendKeyId` string: Identifier of the API key used to send data back to Datadog. Defaults to the only key when unset.
    - `site` string, required: Datadog site URL
    - `validateKeysOnSave` boolean: Indicates whether to validate the API and App keys when saving the keys.
  - `teamIds` string[]: The team IDs that this integration is associated with.
  - `type` 'datadog', required: The type of the integration. This is used to determine the payload type.
  - `updatedAt` string, date-time, required: Timestamp when the integration was last updated.
  - `version` integer, required: Version of the integration. Should be increased by one for every new update in order for the write to succeed. Otherwise, a '409 Conflict' will be returned.

## Other responses

- `401`: Unauthorized
- `404`: Integration or a referenced key not found.
- `409`: The key count exceeds the limit, or the change affects the send key while the integration is in use by a running pipeline.

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
