Skip to main content
POST
/
v1
/
notifications
/
approvals
/
{approvalId}
/
respond
Respond to approval
curl --request POST \
  --url https://api.example.com/v1/notifications/approvals/{approvalId}/respond \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "decision": "<string>",
  "notes": "<string>"
}
'

Overview

Responds to a pending approval request. Approving triggers immediate execution of the remediation plan. Rejecting cancels the remediation and marks it as rejected. Emits remediation.approved or remediation.rejected on the EventBus. Required role: admin

Request headers

Authorization
string
required
JWT Bearer token. Format: Bearer <your-jwt>.

Path parameters

approvalId
string
required
The approval request identifier from Pending approvals. Example: apr_01HX9VTPQR3KF8MZWBYD5N6JCE.

Request body

decision
string
required
One of: approve, reject.
notes
string
Optional notes explaining your decision. Stored in the incident audit log.

Response

Returns 200 OK.
{
  "approvalId": "apr_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "decision": "approve",
  "remediationId": "rem_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "remediationStatus": "executing",
  "decidedAt": "2024-04-01T14:36:00Z"
}
FieldTypeDescription
approvalIdstringThe approval request ID
decisionstringThe decision taken: approve or reject
remediationIdstringThe remediation that was approved or rejected
remediationStatusstringUpdated remediation status: executing (approved) or rejected
decidedAtstringISO 8601 timestamp

Error responses

StatusError codeDescription
400validation_errorInvalid decision value
401unauthorizedMissing or invalid JWT
403forbiddenCaller lacks admin role
404approval_not_foundNo approval with the given ID
409approval_expiredThe approval deadline passed — create a new remediation
409already_decidedThis approval has already been responded to

Examples

curl https://api.causeflow.ai/v1/notifications/approvals/apr_01HX9VTPQR3KF8MZWBYD5N6JCE/respond \
  -X POST \
  -H "Authorization: Bearer eyJhbGc..." \
  -H "Content-Type: application/json" \
  -d '{
    "decision": "approve",
    "notes": "Confirmed with DBA — safe to scale pool. Proceed."
  }'

Pending approvals

View all pending approval requests

Get remediation detail

Track execution progress after approving