docs/documentation/platform/secret-rotation/datadog-application-key-secret.mdx
This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles. </Note>
user_app_keys under API and Application Keys and service_account_write, user_access_manage and user_access_read under Access Management 
2. Select the **Datadog Application Key** option.

3. Configure the rotation behavior, then click **Next**.

- **Datadog Connection** - the connection that will perform the rotation of the Service Account's Application Key.
- **Rotation Interval** - the interval, in days, that once elapsed will trigger a rotation.
- **Rotate At** - the local time of day when rotation should occur once the interval has elapsed.
- **Auto-Rotation Enabled** - whether secrets should automatically be rotated once the rotation interval has elapsed. Disable this option to manually rotate secrets or pause secret rotation.
4. Select the Datadog **Service Account** whose Application Key you want to rotate. Then click **Next**.

- **Service Account** - the Datadog Service Account that will own the rotated Application Keys. Only non-disabled Service Accounts visible to the connection are listed.
<Note>
**Service account role:** The Datadog Service Account whose Application Keys are rotated must have at least the **Datadog Standard Role** assigned.
</Note>
5. Specify the secret names that the rotated credentials should be mapped to. Then click **Next**.

- **Application Key ID** - the name of the secret that the Datadog Application Key ID will be mapped to.
- **Application Key** - the name of the secret that the rotated Datadog Application Key value will be mapped to.
6. Give your rotation a name and description (optional). Then click **Next**.

- **Name** - the name of the secret rotation configuration. Must be slug-friendly.
- **Description** (optional) - a description of this rotation configuration.
7. Review your configuration, then click **Create Secret Rotation**.

8. Your **Datadog Application Key** credentials are now available for use via the mapped secrets.

</Tab>
<Tab title="API">
To create a Datadog Application Key Rotation, make an API request to the [Create Datadog Application Key Rotation](/api-reference/endpoints/secret-rotations/datadog-application-key-secret/create) API endpoint.
You will first need the **Service Account ID** of the Datadog Service Account you want to rotate the Application Key for. This can be obtained from the Service Account's URL in the Datadog dashboard, or by listing Service Accounts on the [Datadog Connection](/integrations/app-connections/datadog).
### Sample request
```bash Request
curl --request POST \
--url https://us.infisical.com/api/v2/secret-rotations/datadog-application-key-secret \
--header 'Content-Type: application/json' \
--data '{
"name": "my-datadog-rotation",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"description": "my datadog application key rotation",
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment": "dev",
"secretPath": "/",
"isAutoRotationEnabled": true,
"rotationInterval": 30,
"rotateAtUtc": {
"hours": 0,
"minutes": 0
},
"parameters": {
"serviceAccountId": "..."
},
"secretsMapping": {
"applicationKeyId": "DATADOG_APPLICATION_KEY_ID",
"applicationKey": "DATADOG_APPLICATION_KEY"
}
}'
```
### Sample response
```bash Response
{
"secretRotation": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "my-datadog-rotation",
"description": "my datadog application key rotation",
"secretsMapping": {
"applicationKeyId": "DATADOG_APPLICATION_KEY_ID",
"applicationKey": "DATADOG_APPLICATION_KEY"
},
"isAutoRotationEnabled": true,
"activeIndex": 0,
"folderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"connectionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"rotationInterval": 30,
"rotationStatus": "success",
"lastRotationAttemptedAt": "2023-11-07T05:31:56Z",
"lastRotatedAt": "2023-11-07T05:31:56Z",
"lastRotationJobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextRotationAt": "2023-11-07T05:31:56Z",
"connection": {
"app": "datadog",
"name": "my-datadog-connection",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"environment": {
"slug": "dev",
"name": "Development",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"folder": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"path": "/"
},
"rotateAtUtc": {
"hours": 0,
"minutes": 0
},
"lastRotationMessage": null,
"type": "datadog-application-key-secret",
"parameters": {
"serviceAccountId": "..."
}
}
}
```
</Tab>