> **Source:** https://knowledge.leegality.com/sign-station/api/update-1 > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # PUT /api/v1/certificates/{id} — Update certificate Updates an existing certificate for the current user's organization. Certificate file upload is optional - if not provided, the existing certificate file will be retained. Supported format: .p12/.pfx (PKCS12) only (max size: 5MB) **Authentication:** `X-Auth-Token` header required on every request. ## Request URL ``` PUT https://app1.leegality.com/api/api/v1/certificates/{id} ``` **Environments:** - Production: `https://app1.leegality.com/api/api/v1/certificates/{id}` - Sandbox: `https://sandbox.leegality.com/api/api/v1/certificates/{id}` --- ## Parameters | Name | In | Required | Type | Description | Example | |------|----|----------|------|-------------|---------| | `id` | path | Yes | string | Certificate ID | — | --- ## Request Body **Content-Type:** `application/json` Certificate data including name, passkey, type, expiry, departmentId, enabled flag, and certificate file | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `passkey` | string | No | Passkey for the certificate file | `mySecretPasskey` | | `certificateFile` | string | No | Certificate file to be uploaded | `TestCertificate.leegality.com` | | `departmentId` | string | No | Associated department ID | — | | `enabled` | boolean | No | Indicates whether the certificate is enabled or disabled | — | ### Sample Request ```json { "passkey": "mySecretPasskey", "certificateFile": "TestCertificate.leegality.com", "departmentId": "string", "enabled": false } ``` --- ## Responses ### 200 — Certificate updated successfully | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Response status code | `null` | | `message` | string | No | Response message | `null` | | `data` | CertificateVO | No | See **CertificateVO** below. | — | #### CertificateVO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `id` | string | No | Certificate unique identifier | `46d4e120-ed03-47cc-98c6-529bff3bbabc` | | `name` | string | No | Certificate name | `TestCertificate.leegality.com` | | `certificateType` | string | No | Type of the certificate Allowed: `PKCS12_PFX`, `PKCS12_HSM`, `PKCS11`. | — | | `expiry` | string | No | Certificate expiry date | — | | `createdAt` | string | No | The date and time when the certificate was created | — | | `departmentId` | string | No | Associated department ID | `18b45e41-5d8b-4417-bb83-1d769187aef9` | | `departmentName` | string | No | Associated department name | `HR` | ### 400 — Invalid request data or unsupported file format | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_400` | | `errors` | array\ | No | List of error details See **ErrorDetail400VO** below. | — | #### ErrorDetail400VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Invalid request parameter: days must be a positive integer.` | ### 401 — Unauthorized - Invalid or expired token | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_401` | | `errors` | array\ | No | List of error details See **ErrorDetail401Unauthorized** below. | — | #### ErrorDetail401Unauthorized | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Invalid or expired token` | | `path` | string | No | API path that generated the error | `/api/v1/*` | | `code` | string | No | Specific error code | `LE_ERR_SS_303` | ### 404 — Certificate not found | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_404` | | `errors` | array\ | No | List of error details See **ErrorDetailVO** below. | — | #### ErrorDetailVO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Certificate with id 46d4e120-ed03-47cc-98c6-529bff3bbaba doe` | | `path` | string | No | API path that generated the error | `/api/v1/certificates/46d4e120-ed03-47cc-98c6-529bff3bbaba` | | `code` | string | No | Specific error code | `LE_ERR_SS_001` | ### 500 — Internal server error | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `code` | string | No | Top-level error code | `LE_ERR_SS_500` | | `errors` | array\ | No | List of error details See **ErrorDetailToken500VO** below. | — | #### ErrorDetailToken500VO | Field | Type | Required | Description | Example | |-------|------|----------|-------------|---------| | `message` | string | No | Detailed error message | `Internal Server Error` | | `path` | string | No | API path that generated the error | `null` | | `code` | string | No | Specific error code | `null` | ### Sample Response (200) ```json { "code": null, "message": null, "data": { "id": "46d4e120-ed03-47cc-98c6-529bff3bbabc", "name": "TestCertificate.leegality.com", "certificateType": "PKCS12_PFX", "expiry": "string", "createdAt": "string", "departmentId": "18b45e41-5d8b-4417-bb83-1d769187aef9", "departmentName": "HR" } } ```