---
title: "Rotate an agent credential's secrets"
description: ""
canonical: "https://pgbeam.com/docs/api/agents/rotateAgentCredential"
last-updated: "2026-09-14T19:37:21.000Z"
---

# Rotate an agent credential's secrets

> 

URL: https://pgbeam.com/docs/api/agents/rotateAgentCredential

Generates a new Postgres password and MCP token for the credential in place, keeping the same id, username, name, and policy. Live connections using the old password are dropped within seconds. The new secrets are returned once and cannot be retrieved again.