> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Certificate

> Updates an existing certificate. The certificate name cannot be changed. Certificate is automatically deployed to all specified environments after update.

## Endpoint

```
PUT /apiops/projects/{projectName}/certificates/{certificateName}/
```

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value               | Required |
| ------------- | ------------------- | -------- |
| Authorization | Bearer `{token}`    | Yes      |
| Content-Type  | multipart/form-data | Yes      |

### Path Parameters

| Parameter       | Type   | Required | Description                          |
| --------------- | ------ | -------- | ------------------------------------ |
| projectName     | string | Yes      | Project name                         |
| certificateName | string | Yes      | Certificate name (cannot be changed) |

### Form Data

Same as Create Certificate. See [Create Certificate](/api-reference/keys-secrets/crud/create-certificate) for field descriptions.

### Query Parameters

| Parameter       | Type   | Required | Description                                                                                                                                    |
| --------------- | ------ | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| jwkUpdateAction | string | No       | Action to take on referenced JWKs: `NULLIFY` (clear references) or `UPDATE` (re-parse and update JWKs). Defaults to `NULLIFY` if not provided. |
| updateScope     | string | No       | Scope for updating JWKs: `SAME_PROJECT` or `ALL_PROJECTS` (used when jwkUpdateAction is `UPDATE`)                                              |

### Notes

* Certificate name in path must match existing certificate
* All form fields are required
* Old certificate is deleted and new one is created
* Certificate is automatically deployed after update
* If `jwkUpdateAction=UPDATE`, JWKs created from this certificate will be re-parsed and updated
* If `jwkUpdateAction=NULLIFY` or not provided, JWK references will be cleared (default behavior)
* `updateScope` determines which JWKs to update when `jwkUpdateAction=UPDATE`: `SAME_PROJECT` or `ALL_PROJECTS`

## Response

Same as Create Certificate. See [Create Certificate](/api-reference/keys-secrets/crud/create-certificate) for response format.

## cURL Example

### Example 1: Update Certificate

```bash theme={null}
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/certificates/my-certificate/" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "alias=updated-cert-alias" \
  -F "certificateDescription=Updated SSL certificate" \
  -F "environmentList=production,staging" \
  -F "pemEncodedFile=@updated-certificate.pem"
```

### Example 2: Update Certificate with JWK Updates

```bash theme={null}
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/certificates/my-certificate/?jwkUpdateAction=UPDATE&updateScope=SAME_PROJECT" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "alias=updated-cert-alias" \
  -F "certificateDescription=Updated SSL certificate" \
  -F "environmentList=production,staging" \
  -F "pemEncodedFile=@updated-certificate.pem"
```

### Example 3: Update Certificate and Clear JWK References

```bash theme={null}
curl -X PUT \
  "https://demo.apinizer.com/apiops/projects/MyProject/certificates/my-certificate/?jwkUpdateAction=NULLIFY" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -F "alias=updated-cert-alias" \
  -F "certificateDescription=Updated SSL certificate" \
  -F "environmentList=production,staging" \
  -F "pemEncodedFile=@updated-certificate.pem"
```

## Notes and Warnings

* **Certificate Name**:
  * Cannot be changed (specified in path)
  * Must match existing certificate

* **Replacement**:
  * Old certificate is deleted and new one is created
  * This ensures clean update across all environments

* **All Fields Required**:
  * All form fields must be provided
  * Same requirements as create

* **Referenced JWKs**:
  * If `jwkUpdateAction=UPDATE`, JWKs created from this certificate will be re-parsed and updated
  * If `jwkUpdateAction=NULLIFY` or not provided (default), JWK references will be cleared
  * `updateScope` determines which JWKs to update when `jwkUpdateAction=UPDATE`: `SAME_PROJECT` or `ALL_PROJECTS`
  * Default behavior (`NULLIFY`) ensures JWKs don't reference deleted or updated certificates

## Permissions

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

## Related Documentation

* [Create Certificate](/api-reference/keys-secrets/crud/create-certificate) - Create a new certificate
* [Get Certificate](/api-reference/keys-secrets/crud/get-certificate) - Get certificate details
