errors.connections.rotate-key

Rotate the managed DSN key: new key, every connected app rebuilt, the old key revoked after the grace

POST /errors/api/projects/{id}/rotate-keyIAM errors:UpdateProjectChanges state

The previous key is revoked once the grace is over AND every connected app runs a build made after the rotation; a failed rebuild holds it. Image and compose apps are listed under rebuildYourself: their browser bundles keep the old DSN until rebuilt.

Request syntax

POST /errors/api/projects/{id}/rotate-key
{
  "graceSeconds": "number"
}

Path parameters

  • idRequired

    string

    Constraints: uuid

Request body

  • graceSecondsOptional

    number

    Seconds the previous key keeps working; it is revoked after that once every connected app runs a build made after the rotation

    Constraints: integer, 600-604800

    Default: 86400

Response

201 with { newKeyId, previousKeyId, dsn, revokeAfter, redeployed, rebuildYourself, failed }: `dsn` the new DSN; `redeployed` the apps rebuilding (appId, appName, deploymentId); `rebuildYourself` image and compose apps to rebuild yourself; `failed` apps whose rebuild could not start (appId, appName, error). 404 when nothing is connected to the project (no managed key); 409 while a previous rotation is still in its grace period.

A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.

Errors

  • 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
  • 401No credentials, or an access key that is unknown, revoked or expired.
  • 403The caller's policies do not allow errors:UpdateProject on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
  • 404The resource does not exist in your organization.

Examples

The required parameters only, with example values. Replace id and the other placeholders with your own.

dcloud errors connections rotate-key id

Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_errors_connections_rotate-key.