REST /api/v1/auto-approvals 6 endpoints
GET /api/v1/auto-approvals/api/v1/auto-approvals

List auto-approval results for an organization

Public

Response Example

{
  "data": [
    {
      "auto_approval_id": "aap_8d3c6f",
      "expense_id": "exp_1a4f8b",
      "result": "approved",
      "reason": "Distance 15 km below auto-approval threshold of 50 km",
      "processed_at": "2026-03-19T11:32:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 1
  }
}
GET /api/v1/auto-approvals/api/v1/auto-approvals/:id

Get auto-approval result for an expense

Public

Response Example

{
  "auto_approval_id": "aap_8d3c6f",
  "expense_id": "exp_1a4f8b",
  "organization_id": "org_4729bc",
  "result": "approved",
  "reason": "Distance 15 km below auto-approval threshold of 50 km",
  "processed_at": "2026-03-19T11:32:00Z"
}
POST /api/v1/auto-approvals/api/v1/auto-approvals

Invoke auto-approval edge function for an expense

Public

Request Example

{
  "expense_id": "exp_1a4f8b",
  "organization_id": "org_4729bc"
}

Response Example

{
  "auto_approval_id": "aap_8d3c6f",
  "expense_id": "exp_1a4f8b",
  "status": "processing",
  "invoked_at": "2026-03-19T11:31:00Z"
}
PUT /api/v1/auto-approvals/api/v1/auto-approvals/:id

Update auto-approval record (callback from edge function)

Public

Request Example

{
  "result": "approved",
  "reason": "Distance 15 km below auto-approval threshold of 50 km"
}

Response Example

{
  "auto_approval_id": "aap_8d3c6f",
  "result": "approved",
  "processed_at": "2026-03-19T11:32:00Z"
}
DELETE /api/v1/auto-approvals/api/v1/auto-approvals/:id

Cancel a pending auto-approval (admin override)

Public

Response Example

{
  "deleted": true,
  "auto_approval_id": "aap_8d3c6f"
}
GET /api/v1/auto-approvals/api/v1/auto-approvals/threshold-config/:organizationId

Get auto-approval threshold configuration for organization

Public

Response Example

{
  "organization_id": "org_4729bc",
  "distance_threshold_km": 50,
  "amount_threshold_nok": 1000,
  "enabled": true,
  "updated_at": "2026-01-15T00:00:00Z"
}

Additional Metadata

{
  "contract_summary": {
    "total_contracts": 410,
    "total_endpoints": 2416,
    "api_styles_used": [
      "rest"
    ]
  },
  "generated_at": "2026-03-26T06:55:53.316Z"
}