PgBeam Docs
Approvals

ApproveApprovalRequest

Approve a held statement

Approves a pending approval request, releasing the held statement.

Usage

result, err := client.Approvals.ApproveApprovalRequest(ctx, "prj_xxx", "apr_xxx", pgbeam.ApprovalDecisionRequest{

  })

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
approvalIDstringYesUnique approval request identifier (prefixed, e.g. apr_xxx).
reqpgbeam.ApprovalDecisionRequestYesRequest body
req.Reason*stringNoHuman-readable note explaining the decision.

Response

(*pgbeam.ApprovalRequest, error) — the updated approval request.

Example

import pgbeam "go.pgbeam.com/sdk"

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

result, err := client.Approvals.ApproveApprovalRequest(ctx, "prj_xxx", "apr_xxx", pgbeam.ApprovalDecisionRequest{
    Reason: "...",
  })
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.
409Resource already exists or conflicts with current state.

On this page