API REFERENCE

Approvals & Self-Service

11 endpoints discovered from this archive’s backend.

Submitting a request to Alphie's approval engine

This is the API that can be called by your Ansible runner using an Access Package-provided Bearer token. The caller must have the permissions required by the current Core API. The JSON path must already exist on the Alphie server and pass the server's path validation.

export APPROVAL_KEY="YOUR_APPROVAL_DEFINITION_KEY"
export RUNBOOK_ID="123"
export APPROVAL_JSON_PATH="/opt/alphie/approval/YOUR_REQUEST.json"

cat > request.json <<EOF
{
  "approval_key": "$APPROVAL_KEY",
  "item_type": "runbook",
  "runbook_id": $RUNBOOK_ID,
  "json_path": "$APPROVAL_JSON_PATH"
}
EOF
curl --fail-with-body -sS -X POST "$ALPHIE_URL/api/approvals/requests" \
  -H "Authorization: Bearer $ALPHIE_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

To submit a pipeline approval instead, use "item_type":"pipeline" and "pipeline_id". An approval definition with the given key must already exist and be enabled. Keep the target runbook/pipeline and approval key administrator-controlled rather than accepting arbitrary values from end-user forms.

The public /api/approvals/review/{token} and /api/approvals/respond/{token} endpoints use per-recipient approval link tokens instead of an Alphie Bearer header. Treat these tokens as secrets.

Set these variables first
export ALPHIE_URL="https://YOUR-ALPHIE-HOST"
export ALPHIE_TOKEN="PASTE_YOUR_API_TOKEN_HERE"
# Requires a certificate trusted by your machine. For test-only self-signed certificates,
# use curl --cacert /path/to/alphie.crt (preferred) rather than disabling TLS verification.

Most authenticated endpoints accept Authorization: Bearer $ALPHIE_TOKEN. Endpoints can still require administrator permissions or particular roles. API tokens must be provisioned through an authorized Alphie account; don't put secrets in playbooks, logs, or browser-side forms.

GET/api/approvals/definitions

List approval definitions

curl --fail-with-body -sS -X GET "$ALPHIE_URL/api/approvals/definitions" \
  -H "Authorization: Bearer $ALPHIE_TOKEN"

POST/api/approvals/definitions

Create approval definition

curl --fail-with-body -sS -X POST "$ALPHIE_URL/api/approvals/definitions" \
  -H "Authorization: Bearer $ALPHIE_TOKEN" \n  -H "Content-Type: application/json" \n  --data-binary @request.json

Body example: supply a request.json file matching this endpoint’s request model. Consult $ALPHIE_URL/openapi.json for required fields.

DELETE/api/approvals/definitions/{definition_id}

Delete approval definition

curl --fail-with-body -sS -X DELETE "$ALPHIE_URL/api/approvals/definitions/${DEFINITION_ID}" \
  -H "Authorization: Bearer $ALPHIE_TOKEN"

GET/api/approvals/definitions/{definition_id}

Get approval definition

curl --fail-with-body -sS -X GET "$ALPHIE_URL/api/approvals/definitions/${DEFINITION_ID}" \
  -H "Authorization: Bearer $ALPHIE_TOKEN"

PUT/api/approvals/definitions/{definition_id}

Update approval definition

curl --fail-with-body -sS -X PUT "$ALPHIE_URL/api/approvals/definitions/${DEFINITION_ID}" \
  -H "Authorization: Bearer $ALPHIE_TOKEN" \n  -H "Content-Type: application/json" \n  --data-binary @request.json

Body example: supply a request.json file matching this endpoint’s request model. Consult $ALPHIE_URL/openapi.json for required fields.

GET/api/approvals/requests

List approval requests

curl --fail-with-body -sS -X GET "$ALPHIE_URL/api/approvals/requests" \
  -H "Authorization: Bearer $ALPHIE_TOKEN"

POST/api/approvals/requests

Create approval request

curl --fail-with-body -sS -X POST "$ALPHIE_URL/api/approvals/requests" \
  -H "Authorization: Bearer $ALPHIE_TOKEN" \n  -H "Content-Type: application/json" \n  --data-binary @request.json

Body example: supply a request.json file matching this endpoint’s request model. Consult $ALPHIE_URL/openapi.json for required fields.

DELETE/api/approvals/requests/{request_id}

Delete approval request admin

curl --fail-with-body -sS -X DELETE "$ALPHIE_URL/api/approvals/requests/${REQUEST_ID}" \
  -H "Authorization: Bearer $ALPHIE_TOKEN"

GET/api/approvals/requests/{request_id}

Get approval request admin

curl --fail-with-body -sS -X GET "$ALPHIE_URL/api/approvals/requests/${REQUEST_ID}" \
  -H "Authorization: Bearer $ALPHIE_TOKEN"

POST/api/approvals/respond/{token}

Respond to approval request

curl --fail-with-body -sS -X POST "$ALPHIE_URL/api/approvals/respond/${APPROVAL_TOKEN}" \n  -H "Content-Type: application/json" \n  --data-binary @request.json

Example request body shown; use only with an authorized token. The approval link token authorizes this endpoint; treat it as a secret.

GET/api/approvals/review/{token}

Review approval request

curl --fail-with-body -sS -X GET "$ALPHIE_URL/api/approvals/review/${APPROVAL_TOKEN}"

The approval link token authorizes this endpoint; treat it as a secret.