Update Key
Overview
Updates an existing cryptographic key and deploys it to environments. Can optionally update referenced JWKs when the key is updated.
Endpoint
PUT /apiops/projects/{projectName}/keys/{keyName}/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| keyName | string | Yes | Name of the key to update |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| updateReferencedJwks | boolean | No | Whether to update referenced JWKs (default: false) |
| updateScope | string | No | Scope for updating JWKs: SAME_PROJECT or ALL_PROJECTS (required if updateReferencedJwks is true) |
Request Body
The request body should contain the complete updated CryptoKeyInfo object.
Response
Same as Create Key response format.
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/keys/my-key/?updateReferencedJwks=true&updateScope=SAME_PROJECT" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "updated-key",
"description": "Updated key",
"keyType": "RSA",
"cryptoKeyInfoEnvironmentList": [...]
}'
Notes and Warnings
- Referenced JWKs:
- If
updateReferencedJwks=true, JWKs created from this key will be updated updateScopedetermines which JWKs to update:SAME_PROJECTorALL_PROJECTS
- If
- Automatic Deployment:
- Key is automatically deployed after update
- Permissions:
- Requires
ROLE_API_SECURITYpermission - Requires
ROLE_DEPLOY_UNDEPLOY_PROXIESpermission for deployment
- Requires
Related Documentation
- List Keys - List all keys
- Create Key - Create a new key