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
| Parameter | Type | Required | Description |
|---|---|---|---|
| ctx | context.Context | Yes | Request context |
| projectID | string | Yes | Unique project identifier (prefixed, e.g. prj_xxx). |
| agentID | string | Yes | Unique agent credential identifier (prefixed, e.g. agt_xxx). |
| req | pgbeam.UpdateAgentCredentialStatusRequest | Yes | Request body |
| req.Status | string | Yes | Set 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
| Status | Description |
|---|---|
| 400 | Invalid request parameters. |
| 401 | Missing or invalid authentication. |
| 403 | Operation not allowed by current plan limits. |
| 404 | Resource not found. |