docs/documentation/platform/secret-rotation/fireworks-api-key.mdx
This rotation maintains two active credential sets with overlapping validity, ensuring zero-downtime during rotation cycles. </Note>

</Step>
<Step title="Navigate to Users & Access">
In the Settings sidebar, click **Users & Access**.

</Step>
<Step title="Add a Service Account">
Click **+ Add** and select **Service Account** from the dropdown.

</Step>
<Step title="Configure the Service Account">
Enter a **Service Account ID** (lowercase letters, numbers, and hyphens only) and click **Add**. You will need this ID when configuring the rotation in Infisical.

</Step>

2. Select the **Fireworks Secret** option.

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

- **Fireworks Connection** -- The connection (with an API key) that will create and delete API keys during rotation.
- **Rotation Interval** -- The interval, in days, after which a rotation is triggered.
- **Rotate At** -- The local time of day when rotation runs once the interval has elapsed.
- **Auto-Rotation Enabled** -- Whether to rotate automatically on the interval. Turn off to rotate only manually or pause rotation.
4. Select the **Service Account** whose API keys will be rotated, then click **Next**. This is the service account you [created in Fireworks](#create-a-fireworks-service-account) earlier.

- **Service Account** -- The Fireworks service account created in the prerequisites step above.
5. Specify the secret name that the rotated API key will be mapped to. Then click **Next**.

- **API Key** -- The name of the secret in Infisical where the rotated API key value will be stored.
6. Give your rotation a name and description (optional). Then click **Next**.

- **Name** -- A slug-friendly name for this rotation configuration.
- **Description** (optional) -- Notes about this rotation.
7. Review your configuration, then click **Create Secret Rotation**.

</Tab>
<Tab title="API">
To create a Fireworks API Key rotation, call the [Create Fireworks API Key Rotation](/api-reference/endpoints/secret-rotations/fireworks-api-key/create) API endpoint.
### Sample request
```bash Request
curl --request POST \
--url https://us.infisical.com/api/v2/secret-rotations/fireworks-api-key \
--header 'Content-Type: application/json' \
--data '{
"name": "my-fireworks-rotation",
"projectId": "<project-id>",
"description": "Fireworks API key rotation",
"connectionId": "<fireworks-connection-id>",
"environment": "dev",
"secretPath": "/",
"isAutoRotationEnabled": true,
"rotationInterval": 30,
"rotateAtUtc": {
"hours": 0,
"minutes": 0
},
"parameters": {
"serviceAccountUserId": "<fireworks-user-id>"
},
"secretsMapping": {
"apiKey": "FIREWORKS_API_KEY"
}
}'
```
### Sample response
```bash Response
{
"secretRotation": {
"id": "<rotation-id>",
"name": "my-fireworks-rotation",
"description": "Fireworks API key rotation",
"secretsMapping": {
"apiKey": "FIREWORKS_API_KEY"
},
"isAutoRotationEnabled": true,
"activeIndex": 0,
"connectionId": "<fireworks-connection-id>",
"rotationInterval": 30,
"rotateAtUtc": { "hours": 0, "minutes": 0 },
"type": "fireworks-api-key",
"parameters": {
"serviceAccountUserId": "<fireworks-user-id>"
}
}
}
```
</Tab>