REST /api/v1/exclusion-rules 7 endpoints
GET /api/v1/exclusion-rules/api/v1/exclusion-rules

List all mutual exclusion rules

Public

Response Example

{
  "data": [
    {
      "id": "rule-001",
      "trigger_type": "publicTransit",
      "excluded_types": [
        "kilometers",
        "tolls",
        "parking"
      ],
      "reason": "Public transit is reimbursed as a flat fare and cannot be combined with vehicle-based expense types.",
      "created_at": "2026-01-10T00:00:00Z"
    },
    {
      "id": "rule-002",
      "trigger_type": "kilometers",
      "excluded_types": [
        "publicTransit"
      ],
      "reason": "Kilometer reimbursement implies personal vehicle use, incompatible with public transit.",
      "created_at": "2026-01-10T00:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 2
  }
}
GET /api/v1/exclusion-rules/api/v1/exclusion-rules/:id

Get a specific exclusion rule by ID

Public

Response Example

{
  "id": "rule-001",
  "trigger_type": "publicTransit",
  "excluded_types": [
    "kilometers",
    "tolls",
    "parking"
  ],
  "reason": "Public transit is reimbursed as a flat fare and cannot be combined with vehicle-based expense types.",
  "created_at": "2026-01-10T00:00:00Z"
}
POST /api/v1/exclusion-rules/api/v1/exclusion-rules

Create a new mutual exclusion rule

Public

Request Example

{
  "trigger_type": "parking",
  "excluded_types": [
    "publicTransit"
  ],
  "reason": "Parking implies personal vehicle; incompatible with public transit reimbursement."
}

Response Example

{
  "id": "rule-003",
  "trigger_type": "parking",
  "excluded_types": [
    "publicTransit"
  ],
  "reason": "Parking implies personal vehicle; incompatible with public transit reimbursement.",
  "created_at": "2026-03-26T12:00:00Z"
}
PUT /api/v1/exclusion-rules/api/v1/exclusion-rules/:id

Update an existing exclusion rule

Public

Request Example

{
  "trigger_type": "parking",
  "excluded_types": [
    "publicTransit"
  ],
  "reason": "Updated: Parking charges apply to personal vehicle trips only."
}

Response Example

{
  "id": "rule-003",
  "trigger_type": "parking",
  "excluded_types": [
    "publicTransit"
  ],
  "reason": "Updated: Parking charges apply to personal vehicle trips only.",
  "created_at": "2026-03-26T12:00:00Z",
  "updated_at": "2026-03-26T12:30:00Z"
}
DELETE /api/v1/exclusion-rules/api/v1/exclusion-rules/:id

Delete an exclusion rule

Public

Response Example

{
  "success": true,
  "deleted_id": "rule-003"
}
POST /api/v1/exclusion-rules/api/v1/exclusion-rules/validate

Validate a set of selected expense types against all exclusion rules

Public

Request Example

{
  "selected_types": [
    "kilometers",
    "tolls",
    "publicTransit"
  ]
}

Response Example

{
  "is_valid": false,
  "violations": [
    {
      "conflicting_types": [
        "publicTransit",
        "kilometers"
      ],
      "reason": "Public transit cannot be combined with kilometer reimbursement."
    },
    {
      "conflicting_types": [
        "publicTransit",
        "tolls"
      ],
      "reason": "Toll charges require personal vehicle use, incompatible with public transit."
    }
  ],
  "disabled_types": [
    "publicTransit"
  ],
  "compatible_selection": [
    "kilometers",
    "tolls"
  ]
}
POST /api/v1/exclusion-rules/api/v1/exclusion-rules/compatibility

Check compatibility between two specific expense types

Public

Request Example

{
  "type_a": "kilometers",
  "type_b": "tolls"
}

Response Example

{
  "type_a": "kilometers",
  "type_b": "tolls",
  "is_compatible": true,
  "exclusion_reason": null
}

Additional Metadata

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