---
title: "PATCH /api/v2/secret-rotations/postgres-credentials/{rotationId}"
method: PATCH
path: "/api/v2/secret-rotations/postgres-credentials/{rotationId}"
tags: ["Secret Rotations"]
---

# PATCH /api/v2/secret-rotations/postgres-credentials/{rotationId}

`PATCH /api/v2/secret-rotations/postgres-credentials/{rotationId}`

Update the specified PostgreSQL Credentials Rotation.

## Path parameters

- `rotationId` string, uuid, required

## Request body

- object
  - `name` string — The updated name of the PostgreSQL Credentials Rotation. Must be slug-friendly.
  - `description` string, nullable — The updated description of the PostgreSQL Credentials Rotation.
  - `isAutoRotationEnabled` boolean — Whether secrets should be automatically rotated when the specified rotation interval has elapsed.
  - `rotationInterval` number — The updated interval, in days, to automatically rotate secrets.
  - `rotateAtUtc` object — The updated hours and minutes rotation should occur at in UTC.
    - `hours` number, required
    - `minutes` number, required
  - `parameters` object
    - `username1` string, required — The username of the first login to rotate passwords for. This user must already exists in your database.
    - `username2` string, required — The username of the second login to rotate passwords for. This user must already exists in your database.
    - `rotationStatement` string — The SQL template query used for rotation.
    - `passwordRequirements` object — The password requirements to use when generating the new password.
      - `length` number, required — The length of the password to generate.
      - `required` object, required
        - `digits` number, required — The amount of digits to require in the generated password.
        - `lowercase` number, required — The amount of lowercase characters to require in the generated password.
        - `uppercase` number, required — The amount of uppercase characters to require in the generated password.
        - `symbols` number, required — The amount of symbols to require in the generated password.
      - `allowedSymbols` string — The allowed symbols to use in the generated password (defaults to "-_.~!*").
  - `secretsMapping` object
    - `username` string, required — The name of the secret that the active username will be mapped to.
    - `password` string, required — The name of the secret that the generated password will be mapped to.

## Response `200`

Default Response

- object
  - `secretRotation` object, required
    - `id` string, uuid, required
    - `name` string, required
    - `description` string, nullable
    - `isAutoRotationEnabled` boolean
    - `activeIndex` number
    - `folderId` string, uuid, required
    - `connectionId` string, uuid, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `rotationInterval` number, required
    - `rotationStatus` string, required
    - `lastRotationAttemptedAt` string, date-time, required
    - `lastRotatedAt` string, date-time, required
    - `lastRotationJobId` string, nullable
    - `nextRotationAt` string, date-time, nullable
    - `isLastRotationManual` boolean
    - `connection` object, required
      - `app` 'postgres', required
      - `name` string, required
      - `id` string, uuid, required
    - `environment` object, required
      - `slug` string, required
      - `name` string, required
      - `id` string, uuid, required
    - `projectId` string, required
    - `folder` object, required
      - `id` string, required
      - `path` string, required
    - `rotateAtUtc` object, required
      - `hours` number, required
      - `minutes` number, required
    - `lastRotationMessage` string, nullable
    - `type` 'postgres-credentials', required
    - `parameters` object, required
      - `username1` string, required — The username of the first login to rotate passwords for. This user must already exists in your database.
      - `username2` string, required — The username of the second login to rotate passwords for. This user must already exists in your database.
      - `rotationStatement` string — The SQL template query used for rotation.
      - `passwordRequirements` object — The password requirements to use when generating the new password.
        - `length` number, required — The length of the password to generate.
        - `required` object, required
          - `digits` number, required — The amount of digits to require in the generated password.
          - `lowercase` number, required — The amount of lowercase characters to require in the generated password.
          - `uppercase` number, required — The amount of uppercase characters to require in the generated password.
          - `symbols` number, required — The amount of symbols to require in the generated password.
        - `allowedSymbols` string — The allowed symbols to use in the generated password (defaults to "-_.~!*").
    - `secretsMapping` object, required
      - `username` string, required — The name of the secret that the active username will be mapped to.
      - `password` string, required — The name of the secret that the generated password will be mapped to.

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/versions/885aef3e6c11/schema)
