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

await platic.secrets.update("secret_123", { name: "Orders API (production)" });

Path parameters

ParameterTypeDescriptionRequired
secretIdstringId of the secret✓

Request body

Send at least one.

FieldTypeDescriptionRequired
namestringNew name, 1 to 150 characters—
expiresAtstring | nullA 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

Statusdetails.codeWhen it happens
400INVALID_REQUESTThe body is empty or a field is not valid. details.issues has the list of problems
400INVALID_EXPIRYexpiresAt is not in the future
403FORBIDDENThe person behind the token cannot manage secrets
404SECRET_NOT_FOUNDThe secret does not exist in this workspace or was already deleted
409SECRET_CHANGEDAnother change arrived at the same time. Repeat the call
409SECRET_USE_REVOKEDThe 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 kind cannot be changed. If you made a mistake, create another secret.