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

Overview

Responds to a pending remediation approval request. When CauseFlow AI proposes a remediation step that requires human sign-off, an approval notification is created and an approval.requested event is emitted via SSE. This endpoint records the decision and either proceeds with execution or cancels the remediation step. Required role: admin

Path parameters

approvalId
string
required
The identifier of the approval request to respond to. Found in the approval.requested SSE event or in the notification payload’s approvalId field.

Request body

action
string
required
The approval decision. One of:
  • approve — authorize the remediation step to proceed
  • reject — cancel the remediation step; the incident remains open for manual resolution

Response

Returns 200 OK confirming the decision was recorded and indicating the resulting remediation status.
{
  "approvalId": "apr_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "action": "approve",
  "remediationId": "rem_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "remediationStatus": "executing",
  "decidedBy": "user_01HX9VTPQR3KF8MZWBYD5N6JCE",
  "decidedAt": "2024-04-01T14:42:00Z"
}
FieldTypeDescription
approvalIdstringThe approval request identifier
actionstringThe decision recorded: approve or reject
remediationIdstringThe associated remediation identifier
remediationStatusstringNew remediation status: executing (approved) or cancelled (rejected)
decidedBystringIdentifier of the user who made the decision
decidedAtstringISO 8601 timestamp when the decision was recorded

Error responses

StatusError codeDescription
400validation_erroraction is missing or not one of approve/reject
404not_foundNo approval request with the given approvalId exists
409already_resolvedThis approval request has already been approved or rejected
Approving a remediation authorizes CauseFlow to execute infrastructure changes on your behalf. Ensure you have reviewed the proposed remediation plan in the dashboard before approving.

Examples

# Approve a pending remediation
curl https://api.causeflow.ai/v1/notifications/approvals/apr_01HX9VTPQR3KF8MZWBYD5N6JCE \
  -X POST \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"action": "approve"}'