Update a secret
SDK platic.secrets.update()
Change the name, expiration or both by sending name or expiresAt. The secret’s value is preserved; to change it, use Rotate a secret.
Example
curl -X PATCH https://api.platic.ai/v1/secrets/$SECRET_ID \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Orders API (production)" }' await platic.secrets.update("secret_123", { name: "Orders API (production)" }); Path parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
secretId | string | Id of the secret | ✓ |
Request body
Send at least one.
| Field | Type | Description | Required |
|---|---|---|---|
name | string | New name, 1 to 150 characters | — |
expiresAt | string | null | A future date in ISO 8601 with a time zone. null removes the expiration | — |
{
"name": "Acme Store · Orders API (production)",
"expiresAt": "2027-06-30T06:00:00.000Z"
} Response
{
"status": "success",
"message": "Secret updated successfully",
"data": {
"id": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c",
"name": "Acme Store · Orders API (production)",
"kind": "bearer",
"status": "active",
"revision": 2,
"createdAt": "2026-10-28T12:05:00.000Z",
"updatedAt": "2026-11-03T18:40:12.000Z",
"expiresAt": "2027-06-30T06:00:00.000Z"
}
} Response fields
data has the secret after the change, with the fields in list secrets. revision goes up by one.
Errors
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | The body is empty or a field is not valid. details.issues has the list of problems |
400 | INVALID_EXPIRY | expiresAt is not in the future |
403 | FORBIDDEN | The person behind the token cannot manage secrets |
404 | SECRET_NOT_FOUND | The secret does not exist in this workspace or was already deleted |
409 | SECRET_CHANGED | Another change arrived at the same time. Repeat the call |
409 | SECRET_USE_REVOKED | The secret is being deleted |
Notes
- You do not need to send the secret's revision: the API uses the current one.
- Changing the name or expiration does not affect resources that already work. Before publishing an API or choosing tools from an MCP server that uses this secret, test it again: both operations require a test with the secret’s current configuration.
- The
kindcannot be changed. If you made a mistake, create another secret.