Ana içeriğe geç

Update JWK

Endpoint

PUT /apiops/projects/{projectName}/jwks/{jwkName}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
jwkNamestringYesName of the JWK to update

Request Body

{
"name": "updated-jwk",
"description": "Updated JWK description"
}

Request Body Fields

FieldTypeRequiredDescription
namestringNoNew JWK name (must be unique if changed)
descriptionstringNoNew JWK description

Notes

  • If name is changed, it must be unique within the project
  • Updating a JWK that was created from a source (URL, certificate, key, keystore) will detach it from the source
  • JWK is automatically deployed to all environments after update

Response

Success Response (200 OK)

{
"success": true,
"deploymentResult": {
"success": true,
"message": "Deployment completed successfully",
"environmentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployed successfully"
}
]
}
}

Error Response (400 Bad Request)

{
"error": "bad_request",
"error_description": "JWK (name: my-jwk) is not found! Try create operation."
}

or

{
"error": "bad_request",
"error_description": "JWK (name: updated-jwk) is already exist!"
}

cURL Example

curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/jwks/my-jwk/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "updated-jwk",
"description": "Updated JWK description"
}'

Notes and Warnings

  • Source Detachment:

    • Updating a JWK created from a source will detach it from the source
    • The JWK becomes independent after update
  • Name Changes:

    • Name can be changed, but must remain unique
    • All references to the old name must be updated
  • Automatic Deployment:

    • JWK is automatically deployed after update
    • Deployment results are returned in the response

Permissions

User must have SECRETS + MANAGE permission in the project. For deployment operations (when deploying JWKs to environments), user must also have SECRETS + DEPLOY_UNDEPLOY permission.