PgBeam Docs
Agents

UpdateAgentCredentialStatus

Enable or disable an agent credential

Toggles the kill-switch. Disabling drops live connections within seconds.

Usage

result, err := client.Agents.UpdateAgentCredentialStatus(ctx, "prj_xxx", "agt_xxx", pgbeam.UpdateAgentCredentialStatusRequest{
    Status: "...",
  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
agentIDstringYesUnique agent credential identifier (prefixed, e.g. agt_xxx).
reqpgbeam.UpdateAgentCredentialStatusRequestYesRequest body
req.StatusstringYesSet active to re-enable or disabled to kill-switch. Use DELETE to revoke permanently.

Response

(*pgbeam.AgentCredential, error) — updated agent credential.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

result, err := client.Agents.UpdateAgentCredentialStatus(ctx, "prj_xxx", "agt_xxx", pgbeam.UpdateAgentCredentialStatusRequest{
    Status: "...",
  })
if err != nil {
  log.Fatal(err)
}
fmt.Println(result)

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.

On this page