# Creates or updates a Datadog integration api key

**PUT** `/v1/integrations/datadog/{id}/api-key`

**Operation ID**: `upsertDatadogApiKey`
**Summary**: Creates or updates a Datadog integration api key
Creates an API key for a Datadog integration if it doesn't exist and updates it otherwise.  If the key is updated while the integration is being used by a pipeline, the  new key will be picked at pipeline restart, rescaling or an update.  Ingestion supports the previous and the updated key for up to 24 hours of  a key update. Make sure to change the key used by the agents to send data within  24 hours of an update for a seamless transition

## Tags
- Datadog Integration
## Parameters

- **id** (required) - path
  - Type: string

## Request Body

**Content-Type**: `application/json`

**Schema**: `SecretApi`

## Responses

### 204

Api key upserted successfully.

### 401

Unauthorized

### 404

Integration not found.
