{
  "components": {
    "schemas": {
      "AcknowledgeBody": {
        "properties": {
          "send": {
            "type": "boolean"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "Activity": {
        "properties": {
          "actor": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "created",
              "status",
              "assign",
              "priority",
              "note",
              "reply",
              "resolve",
              "objection",
              "edit",
              "task",
              "sla",
              "customer_reply",
              "sama_request",
              "sama_response"
            ],
            "type": "string"
          },
          "meta": {
            "additionalProperties": {},
            "type": "object"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ActorRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ApprovalCustomerRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ApprovalDecisionInput": {
        "properties": {
          "note": {
            "maxLength": 500,
            "minLength": 0,
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "ApprovalMemberRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ApprovalView": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "caseId": {
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/ApprovalCustomerRef"
          },
          "decidedAt": {
            "format": "date-time",
            "type": "string"
          },
          "decidedBy": {
            "$ref": "#/components/schemas/ApprovalMemberRef"
          },
          "decisionNote": {
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "reveal",
              "identity_change"
            ],
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "requestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "requestedBy": {
            "$ref": "#/components/schemas/ApprovalMemberRef"
          },
          "status": {
            "enum": [
              "pending",
              "approved",
              "declined"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AssignBody": {
        "properties": {
          "assigneeId": {
            "maxLength": 64,
            "minLength": 0,
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "AssignInput": {
        "properties": {
          "assigneeId": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AutomationAction": {
        "description": "type: assign (members, rotating if several), raise_priority (priority), add_note (text), create_task (kind, title).",
        "properties": {
          "kind": {
            "type": "string"
          },
          "members": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "priority": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "enum": [
              "assign",
              "raise_priority",
              "add_note",
              "create_task"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "AutomationCondition": {
        "description": "field: type, category, priority, channel, customerType, segment, risk, kyc (with `in`); samaCares (escalated to SAMA), objection (escalated to Level Two), fromPartnerApp, unassigned (with `is`); amount (with `atLeast`).",
        "properties": {
          "atLeast": {
            "type": "number"
          },
          "field": {
            "enum": [
              "type",
              "category",
              "priority",
              "channel",
              "customertype",
              "segment",
              "risk",
              "kyc",
              "samacares",
              "objection",
              "frompartnerapp",
              "unassigned",
              "amount"
            ],
            "type": "string"
          },
          "in": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "is": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AutomationPreview": {
        "properties": {
          "days": {
            "format": "int32",
            "type": "integer"
          },
          "matched": {
            "format": "int32",
            "type": "integer"
          },
          "sample": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "scanned": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AutomationRule": {
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/AutomationAction"
            },
            "type": "array"
          },
          "applied30d": {
            "format": "int64",
            "type": "integer"
          },
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/AutomationCondition"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "lastAppliedAt": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "status": {
            "enum": [
              "draft",
              "shadow",
              "active",
              "archived"
            ],
            "type": "string"
          },
          "stopAfter": {
            "type": "boolean"
          },
          "trigger": {
            "enum": [
              "case_created",
              "case_updated"
            ],
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "updatedBy": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AutomationRuleInput": {
        "description": "status: draft (default), shadow or active when creating; afterwards use the status endpoint.",
        "properties": {
          "actions": {
            "items": {
              "$ref": "#/components/schemas/AutomationAction"
            },
            "type": "array"
          },
          "conditions": {
            "items": {
              "$ref": "#/components/schemas/AutomationCondition"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "shadow",
              "active"
            ],
            "type": "string"
          },
          "stopAfter": {
            "type": "boolean"
          },
          "trigger": {
            "enum": [
              "case_created",
              "case_updated"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "AutomationRun": {
        "properties": {
          "caseId": {
            "type": "string"
          },
          "effects": {
            "items": {
              "additionalProperties": {},
              "type": "object"
            },
            "type": "array"
          },
          "error": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "applied",
              "shadow",
              "failed"
            ],
            "type": "string"
          },
          "ranAt": {
            "format": "date-time",
            "type": "string"
          },
          "ruleId": {
            "type": "string"
          },
          "ruleName": {
            "type": "string"
          },
          "trigger": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AutomationStatusInput": {
        "properties": {
          "status": {
            "enum": [
              "draft",
              "shadow",
              "active",
              "archived"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CaseAttachment": {
        "properties": {
          "activityId": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "scannedAt": {
            "format": "date-time",
            "type": "string"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          },
          "source": {
            "enum": [
              "customer",
              "agent"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "scanning",
              "clean",
              "infected"
            ],
            "type": "string"
          },
          "statusDetail": {
            "type": "string"
          },
          "uploadedBy": {
            "$ref": "#/components/schemas/MemberRef"
          }
        },
        "type": "object"
      },
      "CaseCustomerRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "lang": {
            "enum": [
              "ar",
              "en"
            ],
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "merchant",
              "business"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CaseDetail": {
        "properties": {
          "assignee": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "category": {
            "enum": [
              "transfers",
              "cards",
              "wallet",
              "bills",
              "kyc",
              "access",
              "fees",
              "fraud",
              "merchant",
              "bnpl",
              "other",
              "collections",
              "disbursement",
              "credit_bureau",
              "repayment",
              "early_settlement",
              "restructuring",
              "application",
              "statements"
            ],
            "type": "string"
          },
          "cause": {
            "enum": [
              "customer",
              "system",
              "partner",
              "process",
              "fraud",
              "policy"
            ],
            "type": "string"
          },
          "channel": {
            "enum": [
              "app",
              "phone",
              "email",
              "whatsapp",
              "web",
              "sama_cares"
            ],
            "type": "string"
          },
          "complaintLevel": {
            "$ref": "#/components/schemas/ComplaintLevel"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "customer": {
            "$ref": "#/components/schemas/CustomerView"
          },
          "customerPending": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstResponseAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "objection": {
            "type": "boolean"
          },
          "outcome": {
            "enum": [
              "in_favor",
              "partial",
              "not_in_favor",
              "info_provided",
              "duplicate",
              "withdrawn"
            ],
            "type": "string"
          },
          "partnerApp": {
            "type": "boolean"
          },
          "pausedAt": {
            "format": "date-time",
            "type": "string"
          },
          "priority": {
            "enum": [
              "p1",
              "p2",
              "p3",
              "p4"
            ],
            "type": "string"
          },
          "resolution": {
            "type": "string"
          },
          "resolvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "resolvedBy": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "respondBy": {
            "format": "date-time",
            "type": "string"
          },
          "samaClass": {
            "enum": [
              "objection",
              "high"
            ],
            "type": "string"
          },
          "samaRef": {
            "type": "string"
          },
          "sla": {
            "$ref": "#/components/schemas/Sla"
          },
          "status": {
            "enum": [
              "new",
              "open",
              "pending_customer",
              "pending_partner",
              "escalated",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tasks": {
            "items": {
              "$ref": "#/components/schemas/TaskView"
            },
            "type": "array"
          },
          "txnAmount": {
            "type": "number"
          },
          "txnDate": {
            "format": "date-time",
            "type": "string"
          },
          "txnRail": {
            "enum": [
              "mada",
              "sarie",
              "sarie_rtgs",
              "sadad",
              "applepay",
              "visa_mc",
              "wallet",
              "payout"
            ],
            "type": "string"
          },
          "txnRef": {
            "type": "string"
          },
          "type": {
            "enum": [
              "complaint",
              "inquiry",
              "request"
            ],
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CaseInput": {
        "properties": {
          "category": {
            "enum": [
              "transfers",
              "cards",
              "wallet",
              "bills",
              "kyc",
              "access",
              "fees",
              "fraud",
              "merchant",
              "bnpl",
              "other",
              "collections",
              "disbursement",
              "credit_bureau",
              "repayment",
              "early_settlement",
              "restructuring",
              "application",
              "statements"
            ],
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "priority": {
            "enum": [
              "p1",
              "p2",
              "p3",
              "p4"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "type": {
            "enum": [
              "complaint",
              "inquiry",
              "request"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CaseSummary": {
        "properties": {
          "assignee": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "category": {
            "enum": [
              "transfers",
              "cards",
              "wallet",
              "bills",
              "kyc",
              "access",
              "fees",
              "fraud",
              "merchant",
              "bnpl",
              "other",
              "collections",
              "disbursement",
              "credit_bureau",
              "repayment",
              "early_settlement",
              "restructuring",
              "application",
              "statements"
            ],
            "type": "string"
          },
          "channel": {
            "enum": [
              "app",
              "phone",
              "email",
              "whatsapp",
              "web",
              "sama_cares"
            ],
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "customer": {
            "$ref": "#/components/schemas/CaseCustomerRef"
          },
          "customerPending": {
            "type": "boolean"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstResponseAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "level": {
            "enum": [
              "one",
              "two",
              "sama"
            ],
            "type": "string"
          },
          "objection": {
            "type": "boolean"
          },
          "pausedAt": {
            "format": "date-time",
            "type": "string"
          },
          "priority": {
            "enum": [
              "p1",
              "p2",
              "p3",
              "p4"
            ],
            "type": "string"
          },
          "resolvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "respondBy": {
            "format": "date-time",
            "type": "string"
          },
          "samaRef": {
            "type": "string"
          },
          "sla": {
            "$ref": "#/components/schemas/Sla"
          },
          "status": {
            "enum": [
              "new",
              "open",
              "pending_customer",
              "pending_partner",
              "escalated",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "txnAmount": {
            "type": "number"
          },
          "type": {
            "enum": [
              "complaint",
              "inquiry",
              "request"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CategoryCount": {
        "properties": {
          "category": {
            "enum": [
              "transfers",
              "cards",
              "wallet",
              "bills",
              "kyc",
              "access",
              "fees",
              "fraud",
              "merchant",
              "bnpl",
              "other",
              "collections",
              "disbursement",
              "credit_bureau",
              "repayment",
              "early_settlement",
              "restructuring",
              "application",
              "statements"
            ],
            "type": "string"
          },
          "count": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CategoryRow": {
        "properties": {
          "avgResolutionWorkingDays": {
            "format": "double",
            "type": "number"
          },
          "category": {
            "enum": [
              "transfers",
              "cards",
              "wallet",
              "bills",
              "kyc",
              "access",
              "fees",
              "fraud",
              "merchant",
              "bnpl",
              "other",
              "collections",
              "disbursement",
              "credit_bureau",
              "repayment",
              "early_settlement",
              "restructuring",
              "application",
              "statements"
            ],
            "type": "string"
          },
          "pastDue": {
            "format": "int64",
            "type": "integer"
          },
          "received": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          },
          "withinSla": {
            "format": "int64",
            "type": "integer"
          },
          "withinSlaPct": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "CauseRow": {
        "properties": {
          "cause": {
            "enum": [
              "customer",
              "system",
              "partner",
              "process",
              "fraud",
              "policy"
            ],
            "type": "string"
          },
          "count": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ChannelRef": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "enum": [
              "whatsapp",
              "web_form",
              "email",
              "in_app_chat",
              "generic_webhook"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ChannelRow": {
        "properties": {
          "channel": {
            "enum": [
              "app",
              "phone",
              "email",
              "whatsapp",
              "web",
              "sama_cares"
            ],
            "type": "string"
          },
          "received": {
            "format": "int64",
            "type": "integer"
          },
          "share": {
            "format": "double",
            "type": "number"
          },
          "withinSlaPct": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "ChannelView": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastTestAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastTestDetail": {
            "type": "string"
          },
          "lastTestOk": {
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "settings": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": {
            "enum": [
              "whatsapp",
              "web_form",
              "email",
              "in_app_chat",
              "generic_webhook"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          },
          "webhookUrl": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ComplaintLevel": {
        "properties": {
          "canEscalate": {
            "type": "boolean"
          },
          "docsRequestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "escalatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "level": {
            "enum": [
              "one",
              "two",
              "sama"
            ],
            "type": "string"
          },
          "levelOneAnsweredAt": {
            "format": "date-time",
            "type": "string"
          },
          "levelOneDueAt": {
            "format": "date-time",
            "type": "string"
          },
          "levelTwoAnsweredAt": {
            "format": "date-time",
            "type": "string"
          },
          "levelTwoDueAt": {
            "format": "date-time",
            "type": "string"
          },
          "samaAnsweredAt": {
            "format": "date-time",
            "type": "string"
          },
          "samaRequestedAt": {
            "format": "date-time",
            "type": "string"
          },
          "samaRequests": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ComplaintReport": {
        "properties": {
          "ackLate": {
            "format": "int64",
            "type": "integer"
          },
          "avgResolutionWorkingDays": {
            "format": "double",
            "type": "number"
          },
          "byCategory": {
            "items": {
              "$ref": "#/components/schemas/CategoryRow"
            },
            "type": "array"
          },
          "byCause": {
            "items": {
              "$ref": "#/components/schemas/CauseRow"
            },
            "type": "array"
          },
          "byChannel": {
            "items": {
              "$ref": "#/components/schemas/ChannelRow"
            },
            "type": "array"
          },
          "byOutcome": {
            "items": {
              "$ref": "#/components/schemas/OutcomeRow"
            },
            "type": "array"
          },
          "month": {
            "type": "string"
          },
          "objections": {
            "format": "int64",
            "type": "integer"
          },
          "pastDue": {
            "format": "int64",
            "type": "integer"
          },
          "received": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          },
          "samaReferrals": {
            "format": "int64",
            "type": "integer"
          },
          "stillOpen": {
            "format": "int64",
            "type": "integer"
          },
          "withinSla": {
            "format": "int64",
            "type": "integer"
          },
          "withinSlaPct": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "ComplaintStats": {
        "properties": {
          "ackLate": {
            "format": "int64",
            "type": "integer"
          },
          "avgResolutionWorkingDays": {
            "format": "double",
            "type": "number"
          },
          "objections": {
            "format": "int64",
            "type": "integer"
          },
          "pastDue": {
            "format": "int64",
            "type": "integer"
          },
          "received": {
            "format": "int64",
            "type": "integer"
          },
          "resolved": {
            "format": "int64",
            "type": "integer"
          },
          "samaReferrals": {
            "format": "int64",
            "type": "integer"
          },
          "stillOpen": {
            "format": "int64",
            "type": "integer"
          },
          "withinSla": {
            "format": "int64",
            "type": "integer"
          },
          "withinSlaPct": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Contact": {
        "properties": {
          "canRaiseCases": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "idNumber": {
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "finance_manager",
              "signatory",
              "other"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ContactView": {
        "properties": {
          "canRaiseCases": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "idMasked": {
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "finance_manager",
              "signatory",
              "other"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConversationDetail": {
        "properties": {
          "consent": {
            "items": {
              "$ref": "#/components/schemas/State"
            },
            "type": "array"
          },
          "conversation": {
            "$ref": "#/components/schemas/ConversationSummary"
          },
          "leads": {
            "items": {
              "$ref": "#/components/schemas/LeadSummary"
            },
            "type": "array"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/MessageView"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ConversationSummary": {
        "properties": {
          "assignee": {
            "$ref": "#/components/schemas/Ref"
          },
          "canReply": {
            "type": "boolean"
          },
          "caseRef": {
            "type": "string"
          },
          "channel": {
            "$ref": "#/components/schemas/ChannelRef"
          },
          "contact": {
            "type": "string"
          },
          "contactName": {
            "type": "string"
          },
          "firstMessageAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstResponseAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastInboundAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastMessageAt": {
            "format": "date-time",
            "type": "string"
          },
          "leadRef": {
            "type": "string"
          },
          "person": {
            "$ref": "#/components/schemas/Person"
          },
          "preview": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "replyWindowEndsAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "open",
              "closed"
            ],
            "type": "string"
          },
          "suggestedCustomerRef": {
            "type": "string"
          },
          "unread": {
            "format": "int32",
            "type": "integer"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CreateBody": {
        "properties": {
          "amount": {
            "minimum": 0.0,
            "type": "number"
          },
          "assigneeId": {
            "type": "string"
          },
          "caseId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "dueDate": {
            "format": "date",
            "type": "string"
          },
          "kind": {
            "enum": [
              "refund",
              "chargeback",
              "trace",
              "kyc_review",
              "unfreeze",
              "settlement",
              "fee_reversal",
              "card_reissue",
              "kyc_renewal",
              "integration"
            ],
            "type": "string"
          },
          "requiresApproval": {
            "type": "boolean"
          },
          "title": {
            "maxLength": 160,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "title"
        ],
        "type": "object"
      },
      "CreateInput": {
        "properties": {
          "leadTypeId": {
            "format": "uuid",
            "type": "string"
          },
          "note": {
            "maxLength": 2000,
            "minLength": 0,
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "person": {
            "$ref": "#/components/schemas/PersonInput"
          },
          "product": {
            "maxLength": 60,
            "minLength": 0,
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/Source"
          },
          "valueSar": {
            "type": "number"
          }
        },
        "required": [
          "leadTypeId",
          "person",
          "product"
        ],
        "type": "object"
      },
      "CustomerContactInput": {
        "properties": {
          "canRaiseCases": {
            "type": "boolean"
          },
          "email": {
            "format": "email",
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "idNumber": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[0-9 ]{10,14}$",
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "keep": {
            "format": "int32",
            "type": "integer"
          },
          "name": {
            "maxLength": 120,
            "minLength": 1,
            "type": "string"
          },
          "phone": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[+0-9 ()-]{7,24}$",
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "finance_manager",
              "signatory",
              "other"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerFullDetails": {
        "properties": {
          "approvalId": {
            "type": "string"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/FullDetailsContact"
            },
            "type": "array"
          },
          "email": {
            "type": "string"
          },
          "expiresAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idNumber": {
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerInput": {
        "properties": {
          "account": {
            "enum": [
              "active",
              "frozen",
              "dormant",
              "closed"
            ],
            "type": "string"
          },
          "city": {
            "enum": [
              "riyadh",
              "jeddah",
              "dammam",
              "khobar",
              "makkah",
              "madinah",
              "qassim",
              "hail",
              "abha",
              "tabuk"
            ],
            "type": "string"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/CustomerContactInput"
            },
            "maxItems": 10,
            "minItems": 0,
            "type": "array"
          },
          "crExpiry": {
            "format": "date",
            "type": "string"
          },
          "email": {
            "format": "email",
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "idNumber": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[0-9 ]{10,14}$",
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "kyc": {
            "enum": [
              "verified",
              "pending",
              "expired",
              "rejected"
            ],
            "type": "string"
          },
          "kycExpiry": {
            "format": "date",
            "type": "string"
          },
          "lang": {
            "enum": [
              "ar",
              "en"
            ],
            "type": "string"
          },
          "nameAr": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "nameEn": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "phone": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[+0-9 ()-]{7,24}$",
            "type": "string"
          },
          "products": {
            "items": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,39}$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 0,
            "type": "array"
          },
          "risk": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "segment": {
            "enum": [
              "retail",
              "premium",
              "sme",
              "enterprise",
              "micro",
              "small",
              "medium"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "merchant",
              "business"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "account",
          "city",
          "idType",
          "kyc",
          "lang",
          "risk",
          "segment",
          "type"
        ],
        "type": "object"
      },
      "CustomerView": {
        "properties": {
          "account": {
            "enum": [
              "active",
              "frozen",
              "dormant",
              "closed"
            ],
            "type": "string"
          },
          "city": {
            "enum": [
              "riyadh",
              "jeddah",
              "dammam",
              "khobar",
              "makkah",
              "madinah",
              "qassim",
              "hail",
              "abha",
              "tabuk"
            ],
            "type": "string"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/ContactView"
            },
            "type": "array"
          },
          "crExpiry": {
            "format": "date",
            "type": "string"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "idMasked": {
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "identityChangePending": {
            "type": "boolean"
          },
          "kyc": {
            "enum": [
              "verified",
              "pending",
              "expired",
              "rejected"
            ],
            "type": "string"
          },
          "kycExpiry": {
            "format": "date",
            "type": "string"
          },
          "lang": {
            "enum": [
              "ar",
              "en"
            ],
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "openCases": {
            "format": "int64",
            "type": "integer"
          },
          "partnerRef": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "placeholder": {
            "type": "boolean"
          },
          "products": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "risk": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "segment": {
            "enum": [
              "retail",
              "premium",
              "sme",
              "enterprise",
              "micro",
              "small",
              "medium"
            ],
            "type": "string"
          },
          "source": {
            "enum": [
              "manual",
              "partner"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "merchant",
              "business"
            ],
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Dashboard": {
        "properties": {
          "attention": {
            "items": {
              "$ref": "#/components/schemas/CaseSummary"
            },
            "type": "array"
          },
          "byCategory": {
            "items": {
              "$ref": "#/components/schemas/CategoryCount"
            },
            "type": "array"
          },
          "complaintsThisMonth": {
            "$ref": "#/components/schemas/ComplaintStats"
          },
          "kpis": {
            "$ref": "#/components/schemas/Kpis"
          },
          "mine": {
            "items": {
              "$ref": "#/components/schemas/CaseSummary"
            },
            "type": "array"
          },
          "newPerDay": {
            "items": {
              "$ref": "#/components/schemas/DayCount"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "DayCount": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "date": {
            "format": "date",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EngagementInput": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Entry": {
        "properties": {
          "action": {
            "type": "string"
          },
          "actor": {
            "$ref": "#/components/schemas/ActorRef"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "details": {
            "additionalProperties": {},
            "type": "object"
          },
          "entityId": {
            "type": "string"
          },
          "entityType": {
            "type": "string"
          },
          "hash": {
            "type": "string"
          },
          "seq": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Field": {
        "properties": {
          "name": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "secret": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "FullDetailsContact": {
        "properties": {
          "email": {
            "type": "string"
          },
          "idNumber": {
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "finance_manager",
              "signatory",
              "other"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Holiday": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "HolidayInput": {
        "properties": {
          "date": {
            "format": "date",
            "type": "string"
          },
          "label": {
            "maxLength": 80,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "date"
        ],
        "type": "object"
      },
      "Input": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "body": {
            "type": "string"
          },
          "category": {
            "enum": [
              "marketing",
              "utility",
              "authentication"
            ],
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "paramLabels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "JsonNode": {
        "properties": {
          "array": {
            "type": "boolean"
          },
          "bigDecimal": {
            "type": "boolean"
          },
          "bigInteger": {
            "type": "boolean"
          },
          "binary": {
            "type": "boolean"
          },
          "boolean": {
            "type": "boolean"
          },
          "container": {
            "type": "boolean"
          },
          "double": {
            "type": "boolean"
          },
          "embeddedValue": {
            "type": "boolean"
          },
          "empty": {
            "type": "boolean"
          },
          "float": {
            "type": "boolean"
          },
          "floatingPointNumber": {
            "type": "boolean"
          },
          "int": {
            "type": "boolean"
          },
          "integralNumber": {
            "type": "boolean"
          },
          "long": {
            "type": "boolean"
          },
          "missingNode": {
            "type": "boolean"
          },
          "nodeType": {
            "enum": [
              "array",
              "binary",
              "boolean",
              "missing",
              "null",
              "number",
              "object",
              "pojo",
              "string"
            ],
            "type": "string"
          },
          "null": {
            "type": "boolean"
          },
          "number": {
            "type": "boolean"
          },
          "object": {
            "type": "boolean"
          },
          "pojo": {
            "type": "boolean"
          },
          "short": {
            "type": "boolean"
          },
          "string": {
            "type": "boolean"
          },
          "textual": {
            "deprecated": true,
            "type": "boolean"
          },
          "valueNode": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Keywords": {
        "properties": {
          "start": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "stop": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Kpi": {
        "properties": {
          "denominator": {
            "format": "int64",
            "type": "integer"
          },
          "direction": {
            "enum": [
              "min",
              "max"
            ],
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "met": {
            "type": "boolean"
          },
          "numerator": {
            "format": "int64",
            "type": "integer"
          },
          "threshold": {
            "format": "double",
            "type": "number"
          },
          "value": {
            "format": "double",
            "type": "number"
          }
        },
        "type": "object"
      },
      "Kpis": {
        "properties": {
          "ackLate": {
            "format": "int64",
            "type": "integer"
          },
          "awaitingApproval": {
            "format": "int64",
            "type": "integer"
          },
          "breached": {
            "format": "int64",
            "type": "integer"
          },
          "dueToday": {
            "format": "int64",
            "type": "integer"
          },
          "mine": {
            "format": "int64",
            "type": "integer"
          },
          "myTasks": {
            "format": "int64",
            "type": "integer"
          },
          "open": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "KycFileDay": {
        "properties": {
          "accepted": {
            "format": "int32",
            "type": "integer"
          },
          "alerts": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "businessDate": {
            "format": "date",
            "type": "string"
          },
          "lines": {
            "format": "int32",
            "type": "integer"
          },
          "received": {
            "type": "boolean"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "rejected": {
            "format": "int32",
            "type": "integer"
          },
          "replaced": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "KycFileInput": {
        "properties": {
          "businessDate": {
            "format": "date",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/KycFileLine"
            },
            "maxItems": 50000,
            "minItems": 0,
            "type": "array"
          }
        },
        "required": [
          "businessDate",
          "lines"
        ],
        "type": "object"
      },
      "KycFileLine": {
        "properties": {
          "crExpiryDate": {
            "type": "string"
          },
          "kycExpiryDate": {
            "type": "string"
          },
          "kycReviewDate": {
            "type": "string"
          },
          "kycStatus": {
            "type": "string"
          },
          "line": {
            "format": "int32",
            "type": "integer"
          },
          "partnerCustomerRef": {
            "type": "string"
          },
          "riskRating": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "KycFileReceipt": {
        "properties": {
          "accepted": {
            "format": "int32",
            "type": "integer"
          },
          "alreadyReceived": {
            "type": "boolean"
          },
          "businessDate": {
            "format": "date",
            "type": "string"
          },
          "received": {
            "format": "int32",
            "type": "integer"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "rejected": {
            "format": "int32",
            "type": "integer"
          },
          "rejections": {
            "items": {
              "$ref": "#/components/schemas/KycFileRejection"
            },
            "type": "array"
          },
          "replacedEarlierFile": {
            "type": "boolean"
          },
          "tasksRaised": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "updated": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "KycFileRejection": {
        "properties": {
          "line": {
            "format": "int32",
            "type": "integer"
          },
          "partnerCustomerRef": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "LeadDetail": {
        "properties": {
          "lead": {
            "$ref": "#/components/schemas/LeadSummary"
          },
          "touchpoints": {
            "items": {
              "$ref": "#/components/schemas/Touchpoint"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "LeadInput": {
        "properties": {
          "leadTypeId": {
            "format": "uuid",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "product": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LeadSummary": {
        "properties": {
          "closeReason": {
            "type": "string"
          },
          "closedAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstContactDueAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstContactedAt": {
            "format": "date-time",
            "type": "string"
          },
          "firstSource": {
            "$ref": "#/components/schemas/Source"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lastStep": {
            "type": "string"
          },
          "latestSource": {
            "$ref": "#/components/schemas/Source"
          },
          "leadTypeAr": {
            "type": "string"
          },
          "leadTypeEn": {
            "type": "string"
          },
          "leadTypeId": {
            "format": "uuid",
            "type": "string"
          },
          "openedAt": {
            "format": "date-time",
            "type": "string"
          },
          "owner": {
            "$ref": "#/components/schemas/Ref"
          },
          "person": {
            "$ref": "#/components/schemas/Person"
          },
          "product": {
            "type": "string"
          },
          "ref": {
            "type": "string"
          },
          "stage": {
            "$ref": "#/components/schemas/Stage"
          },
          "status": {
            "enum": [
              "open",
              "won",
              "lost"
            ],
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "valueSar": {
            "type": "number"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LeadType": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "closingEvents": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "firstContactMinutes": {
            "format": "int32",
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "openLeads": {
            "format": "int64",
            "type": "integer"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          },
          "stages": {
            "items": {
              "$ref": "#/components/schemas/Stage"
            },
            "type": "array"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LeadTypeInput": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "closingEvents": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "description": {
            "type": "string"
          },
          "firstContactMinutes": {
            "format": "int32",
            "type": "integer"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "stages": {
            "items": {
              "$ref": "#/components/schemas/StageInput"
            },
            "type": "array"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "LinkInput": {
        "properties": {
          "customerId": {
            "maxLength": 40,
            "minLength": 0,
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "customerId",
          "version"
        ],
        "type": "object"
      },
      "LookupInput": {
        "properties": {
          "address": {
            "maxLength": 320,
            "minLength": 0,
            "type": "string"
          },
          "channel": {
            "enum": [
              "whatsapp",
              "sms",
              "email",
              "in_app_chat"
            ],
            "type": "string"
          }
        },
        "required": [
          "address",
          "channel"
        ],
        "type": "object"
      },
      "Me": {
        "properties": {
          "email": {
            "type": "string"
          },
          "features": {
            "items": {
              "enum": [
                "engagement"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "items": {
              "enum": [
                "case:read",
                "case:write",
                "customer:read",
                "customer:write",
                "task:read",
                "task:write",
                "task:approve",
                "report:read",
                "settings:write",
                "audit:read",
                "customer:approve",
                "partner:read",
                "partner:resend",
                "integration:write",
                "conversation:read",
                "conversation:write",
                "lead:read",
                "lead:write",
                "engagement:settings",
                "product:settings",
                "engagement:ingest"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "preferences": {
            "$ref": "#/components/schemas/Preferences"
          },
          "roles": {
            "items": {
              "enum": [
                "agent",
                "ops",
                "ops_lead",
                "lead",
                "compliance",
                "admin",
                "cx_agent",
                "cx_lead",
                "marketing",
                "platform_admin",
                "integration",
                "channels"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "tenantId": {
            "format": "uuid",
            "type": "string"
          },
          "tenantName": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Member": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "roles": {
            "items": {
              "enum": [
                "agent",
                "ops",
                "ops_lead",
                "lead",
                "compliance",
                "admin",
                "cx_agent",
                "cx_lead",
                "marketing",
                "platform_admin",
                "integration",
                "channels"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "MemberRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "MessageTemplate": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "body": {
            "type": "string"
          },
          "category": {
            "enum": [
              "marketing",
              "utility",
              "authentication"
            ],
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "paramLabels": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "MessageView": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "author": {
            "$ref": "#/components/schemas/Ref"
          },
          "delivery": {
            "enum": [
              "received",
              "queued",
              "sent",
              "delivered",
              "read",
              "failed",
              "note"
            ],
            "type": "string"
          },
          "deliveryAt": {
            "format": "date-time",
            "type": "string"
          },
          "deliveryError": {
            "type": "string"
          },
          "direction": {
            "enum": [
              "in",
              "out",
              "note"
            ],
            "type": "string"
          },
          "fields": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "template": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "NoteBody": {
        "properties": {
          "text": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "type": "object"
      },
      "NoteInput": {
        "properties": {
          "note": {
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "note"
        ],
        "type": "object"
      },
      "Opened": {
        "properties": {
          "created": {
            "type": "boolean"
          },
          "lead": {
            "$ref": "#/components/schemas/LeadSummary"
          }
        },
        "type": "object"
      },
      "OrderInput": {
        "properties": {
          "ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "ids"
        ],
        "type": "object"
      },
      "OutcomeRow": {
        "properties": {
          "count": {
            "format": "int64",
            "type": "integer"
          },
          "outcome": {
            "enum": [
              "in_favor",
              "partial",
              "not_in_favor",
              "info_provided",
              "duplicate",
              "withdrawn"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PageResultCaseSummary": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CaseSummary"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PageResultConversationSummary": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/ConversationSummary"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PageResultCustomerView": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CustomerView"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PageResultEntry": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Entry"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PageResultLeadSummary": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/LeadSummary"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PageResultTaskView": {
        "properties": {
          "facets": {
            "additionalProperties": {
              "format": "int64",
              "type": "integer"
            },
            "type": "object"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/TaskView"
            },
            "type": "array"
          },
          "page": {
            "format": "int32",
            "type": "integer"
          },
          "size": {
            "format": "int32",
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PartnerCaseCreated": {
        "properties": {
          "caseId": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "customerLinked": {
            "type": "boolean"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "priority": {
            "enum": [
              "p1",
              "p2",
              "p3",
              "p4"
            ],
            "type": "string"
          },
          "respondBy": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PartnerCaseFile": {
        "properties": {
          "contentType": {
            "type": "string"
          },
          "fileId": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "size": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PartnerCaseInput": {
        "properties": {
          "category": {
            "enum": [
              "transfers",
              "cards",
              "wallet",
              "bills",
              "kyc",
              "access",
              "fees",
              "fraud",
              "merchant",
              "bnpl",
              "other",
              "collections",
              "disbursement",
              "credit_bureau",
              "repayment",
              "early_settlement",
              "restructuring",
              "application",
              "statements"
            ],
            "type": "string"
          },
          "description": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          },
          "partnerCustomerRef": {
            "maxLength": 64,
            "minLength": 0,
            "type": "string"
          },
          "subject": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "submissionId": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "type": {
            "enum": [
              "complaint",
              "inquiry",
              "request"
            ],
            "type": "string"
          }
        },
        "required": [
          "category",
          "partnerCustomerRef",
          "subject",
          "submissionId",
          "type"
        ],
        "type": "object"
      },
      "PartnerCaseUpdate": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "caseId": {
            "type": "string"
          },
          "files": {
            "items": {
              "$ref": "#/components/schemas/PartnerCaseFile"
            },
            "type": "array"
          },
          "kind": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "in_favor",
              "partial",
              "not_in_favor",
              "info_provided",
              "duplicate",
              "withdrawn"
            ],
            "type": "string"
          },
          "partnerCustomerRef": {
            "type": "string"
          },
          "seq": {
            "format": "int64",
            "type": "integer"
          },
          "status": {
            "enum": [
              "new",
              "open",
              "pending_customer",
              "pending_partner",
              "escalated",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "submissionId": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PartnerCaseUpdateFeed": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PartnerCaseUpdate"
            },
            "type": "array"
          },
          "more": {
            "type": "boolean"
          },
          "next": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PartnerChange": {
        "properties": {
          "changedAt": {
            "format": "date-time",
            "type": "string"
          },
          "changedFields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "customerId": {
            "type": "string"
          },
          "partnerCustomerRef": {
            "type": "string"
          },
          "profile": {
            "$ref": "#/components/schemas/PartnerFullProfile"
          },
          "seq": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PartnerChangeFeed": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PartnerChange"
            },
            "type": "array"
          },
          "more": {
            "type": "boolean"
          },
          "next": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PartnerConnectionOverview": {
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "kycFiles": {
            "items": {
              "$ref": "#/components/schemas/KycFileDay"
            },
            "type": "array"
          },
          "messages": {
            "$ref": "#/components/schemas/JsonNode"
          },
          "reconciliations": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationReport"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PartnerContactInput": {
        "properties": {
          "canRaiseCases": {
            "type": "boolean"
          },
          "email": {
            "format": "email",
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "idNumber": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[0-9 ]{10,14}$",
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "phone": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[+0-9 ()-]{7,24}$",
            "type": "string"
          },
          "role": {
            "enum": [
              "owner",
              "finance_manager",
              "signatory",
              "other"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "role"
        ],
        "type": "object"
      },
      "PartnerFileInput": {
        "properties": {
          "contentBase64": {
            "maxLength": 14000000,
            "minLength": 0,
            "type": "string"
          },
          "contentType": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "fileName": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "uploadId": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "contentBase64",
          "contentType",
          "fileName",
          "uploadId"
        ],
        "type": "object"
      },
      "PartnerFileReceived": {
        "properties": {
          "caseId": {
            "type": "string"
          },
          "fileId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "scanning",
              "clean",
              "infected"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PartnerFullProfile": {
        "properties": {
          "account": {
            "enum": [
              "active",
              "frozen",
              "dormant",
              "closed"
            ],
            "type": "string"
          },
          "city": {
            "enum": [
              "riyadh",
              "jeddah",
              "dammam",
              "khobar",
              "makkah",
              "madinah",
              "qassim",
              "hail",
              "abha",
              "tabuk"
            ],
            "type": "string"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/Contact"
            },
            "type": "array"
          },
          "crExpiry": {
            "format": "date",
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "idNumber": {
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "kyc": {
            "enum": [
              "verified",
              "pending",
              "expired",
              "rejected"
            ],
            "type": "string"
          },
          "kycExpiry": {
            "format": "date",
            "type": "string"
          },
          "lang": {
            "enum": [
              "ar",
              "en"
            ],
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "partnerRef": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "products": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "risk": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "segment": {
            "enum": [
              "retail",
              "premium",
              "sme",
              "enterprise",
              "micro",
              "small",
              "medium"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "merchant",
              "business"
            ],
            "type": "string"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PartnerProfileInput": {
        "properties": {
          "account": {
            "enum": [
              "active",
              "frozen",
              "dormant",
              "closed"
            ],
            "type": "string"
          },
          "changedAt": {
            "format": "date-time",
            "type": "string"
          },
          "city": {
            "enum": [
              "riyadh",
              "jeddah",
              "dammam",
              "khobar",
              "makkah",
              "madinah",
              "qassim",
              "hail",
              "abha",
              "tabuk"
            ],
            "type": "string"
          },
          "contacts": {
            "items": {
              "$ref": "#/components/schemas/PartnerContactInput"
            },
            "maxItems": 10,
            "minItems": 0,
            "type": "array"
          },
          "crExpiry": {
            "format": "date",
            "type": "string"
          },
          "email": {
            "format": "email",
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "idNumber": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[0-9 ]{10,14}$",
            "type": "string"
          },
          "idType": {
            "enum": [
              "nid",
              "iqama",
              "cr"
            ],
            "type": "string"
          },
          "kyc": {
            "enum": [
              "verified",
              "pending",
              "expired",
              "rejected"
            ],
            "type": "string"
          },
          "kycExpiry": {
            "format": "date",
            "type": "string"
          },
          "lang": {
            "enum": [
              "ar",
              "en"
            ],
            "type": "string"
          },
          "nameAr": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "nameEn": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "phone": {
            "maxLength": 24,
            "minLength": 0,
            "pattern": "^$|^[+0-9 ()-]{7,24}$",
            "type": "string"
          },
          "products": {
            "items": {
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,39}$",
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 0,
            "type": "array"
          },
          "risk": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "segment": {
            "enum": [
              "retail",
              "premium",
              "sme",
              "enterprise",
              "micro",
              "small",
              "medium"
            ],
            "type": "string"
          },
          "type": {
            "enum": [
              "individual",
              "merchant",
              "business"
            ],
            "type": "string"
          }
        },
        "required": [
          "account",
          "changedAt",
          "city",
          "idType",
          "lang",
          "segment"
        ],
        "type": "object"
      },
      "PartnerReplyInput": {
        "properties": {
          "fileIds": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 5,
            "minItems": 0,
            "type": "array"
          },
          "replyId": {
            "maxLength": 100,
            "minLength": 0,
            "type": "string"
          },
          "text": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "replyId"
        ],
        "type": "object"
      },
      "PartnerReplyReceived": {
        "properties": {
          "caseId": {
            "type": "string"
          },
          "fileIds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "new",
              "open",
              "pending_customer",
              "pending_partner",
              "escalated",
              "resolved",
              "closed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PartnerSettings": {
        "properties": {
          "allowPartnerRead": {
            "type": "boolean"
          },
          "escalateAfterDays": {
            "format": "int32",
            "type": "integer"
          },
          "kycFileDeadline": {
            "type": "string"
          },
          "kycFileEnabled": {
            "type": "boolean"
          },
          "missingAlertMinutes": {
            "format": "int32",
            "type": "integer"
          },
          "rejectAlertPercent": {
            "format": "int32",
            "type": "integer"
          },
          "revealMinutes": {
            "format": "int32",
            "type": "integer"
          },
          "saved": {
            "type": "boolean"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "PartnerSettingsInput": {
        "properties": {
          "allowPartnerRead": {
            "type": "boolean"
          },
          "escalateAfterDays": {
            "format": "int32",
            "type": "integer"
          },
          "kycFileDeadline": {
            "type": "string"
          },
          "kycFileEnabled": {
            "type": "boolean"
          },
          "missingAlertMinutes": {
            "format": "int32",
            "type": "integer"
          },
          "rejectAlertPercent": {
            "format": "int32",
            "type": "integer"
          },
          "revealMinutes": {
            "format": "int32",
            "type": "integer"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "escalateAfterDays",
          "kycFileDeadline",
          "kycFileEnabled",
          "missingAlertMinutes",
          "rejectAlertPercent",
          "revealMinutes",
          "version"
        ],
        "type": "object"
      },
      "PartnerUpsertResult": {
        "properties": {
          "changedFields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "customerId": {
            "type": "string"
          },
          "outcome": {
            "enum": [
              "created",
              "updated",
              "unchanged",
              "linked",
              "ignored_older"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PendingApprovals": {
        "properties": {
          "pending": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Person": {
        "properties": {
          "customerRef": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "handle": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "suggestedCustomerId": {
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "enum": [
              "customer",
              "prospect"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PersonInput": {
        "properties": {
          "customerId": {
            "maxLength": 40,
            "minLength": 0,
            "type": "string"
          },
          "email": {
            "maxLength": 320,
            "minLength": 0,
            "type": "string"
          },
          "handle": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "lang": {
            "maxLength": 2,
            "minLength": 0,
            "type": "string"
          },
          "name": {
            "maxLength": 120,
            "minLength": 0,
            "type": "string"
          },
          "phone": {
            "maxLength": 40,
            "minLength": 0,
            "type": "string"
          }
        },
        "type": "object"
      },
      "PolicyInput": {
        "properties": {
          "policy": {
            "additionalProperties": {
              "additionalProperties": {},
              "type": "object"
            },
            "type": "object"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "policy",
          "version"
        ],
        "type": "object"
      },
      "Preferences": {
        "properties": {
          "locale": {
            "enum": [
              "ar",
              "en"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "theme": {
            "enum": [
              "system",
              "light",
              "dark"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PriorityBody": {
        "properties": {
          "priority": {
            "enum": [
              "p1",
              "p2",
              "p3",
              "p4"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "priority",
          "version"
        ],
        "type": "object"
      },
      "Product": {
        "properties": {
          "category": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/ProductDocument"
            },
            "type": "array"
          },
          "effectiveFrom": {
            "format": "date",
            "type": "string"
          },
          "effectiveTo": {
            "format": "date",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "indicativeRangeAr": {
            "type": "string"
          },
          "indicativeRangeEn": {
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "shariaApprovalDate": {
            "format": "date",
            "type": "string"
          },
          "shariaApprovalRef": {
            "type": "string"
          },
          "shariaStructure": {
            "enum": [
              "tawarruq",
              "murabaha",
              "ijara"
            ],
            "type": "string"
          },
          "source": {
            "enum": [
              "catalogue",
              "manual"
            ],
            "type": "string"
          },
          "sourceUpdatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "enum": [
              "upcoming",
              "on_sale",
              "closed",
              "not_sellable"
            ],
            "type": "string"
          },
          "tailoredPricing": {
            "type": "boolean"
          },
          "updatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ProductCodeSeen": {
        "properties": {
          "code": {
            "type": "string"
          },
          "firstSeenAt": {
            "format": "date-time",
            "type": "string"
          },
          "lastSeenAt": {
            "format": "date-time",
            "type": "string"
          },
          "resolvedTo": {
            "type": "string"
          },
          "seenIn": {
            "enum": [
              "profile",
              "lead",
              "journey_event"
            ],
            "type": "string"
          },
          "timesSeen": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ProductDocument": {
        "properties": {
          "kind": {
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ProductInput": {
        "properties": {
          "category": {
            "type": "string"
          },
          "documents": {
            "items": {
              "$ref": "#/components/schemas/ProductDocument"
            },
            "type": "array"
          },
          "effectiveFrom": {
            "format": "date",
            "type": "string"
          },
          "effectiveTo": {
            "format": "date",
            "type": "string"
          },
          "indicativeRangeAr": {
            "type": "string"
          },
          "indicativeRangeEn": {
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "shariaApprovalDate": {
            "format": "date",
            "type": "string"
          },
          "shariaApprovalRef": {
            "type": "string"
          },
          "shariaStructure": {
            "enum": [
              "tawarruq",
              "murabaha",
              "ijara"
            ],
            "type": "string"
          },
          "source": {
            "enum": [
              "catalogue",
              "manual"
            ],
            "type": "string"
          },
          "sourceUpdatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "tailoredPricing": {
            "type": "boolean"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ProductResolveInput": {
        "properties": {
          "productCode": {
            "maxLength": 40,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "productCode"
        ],
        "type": "object"
      },
      "ProductSaved": {
        "properties": {
          "outcome": {
            "enum": [
              "created",
              "updated",
              "unchanged",
              "ignored_older"
            ],
            "type": "string"
          },
          "product": {
            "$ref": "#/components/schemas/Product"
          }
        },
        "type": "object"
      },
      "Provider": {
        "properties": {
          "canReply": {
            "type": "boolean"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/Field"
            },
            "type": "array"
          },
          "provider": {
            "type": "string"
          },
          "type": {
            "enum": [
              "whatsapp",
              "web_form",
              "email",
              "in_app_chat",
              "generic_webhook"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReconciliationBody": {
        "properties": {
          "businessDate": {
            "format": "date",
            "type": "string"
          },
          "customers": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationLine"
            },
            "maxItems": 500000,
            "minItems": 0,
            "type": "array"
          }
        },
        "required": [
          "businessDate",
          "customers"
        ],
        "type": "object"
      },
      "ReconciliationDifference": {
        "properties": {
          "customerId": {
            "type": "string"
          },
          "fields": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "kind": {
            "type": "string"
          },
          "partnerCustomerRef": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReconciliationLine": {
        "properties": {
          "accountStatus": {
            "type": "string"
          },
          "kycStatus": {
            "type": "string"
          },
          "partnerCustomerRef": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReconciliationReport": {
        "properties": {
          "businessDate": {
            "format": "date",
            "type": "string"
          },
          "differences": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationDifference"
            },
            "type": "array"
          },
          "matched": {
            "format": "int32",
            "type": "integer"
          },
          "mismatched": {
            "format": "int32",
            "type": "integer"
          },
          "missingInSanad": {
            "format": "int32",
            "type": "integer"
          },
          "partnerCount": {
            "format": "int32",
            "type": "integer"
          },
          "receivedAt": {
            "format": "date-time",
            "type": "string"
          },
          "sanadCount": {
            "format": "int32",
            "type": "integer"
          },
          "taskRaised": {
            "type": "string"
          },
          "truncated": {
            "type": "boolean"
          },
          "unknownToPartner": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RecordInput": {
        "properties": {
          "action": {
            "enum": [
              "given",
              "withdrawn"
            ],
            "type": "string"
          },
          "address": {
            "maxLength": 320,
            "minLength": 0,
            "type": "string"
          },
          "channel": {
            "enum": [
              "whatsapp",
              "sms",
              "email",
              "in_app_chat"
            ],
            "type": "string"
          },
          "method": {
            "enum": [
              "keyword",
              "form",
              "agent",
              "import",
              "partner_app"
            ],
            "type": "string"
          },
          "personId": {
            "format": "uuid",
            "type": "string"
          },
          "personType": {
            "enum": [
              "customer",
              "prospect"
            ],
            "type": "string"
          },
          "purpose": {
            "enum": [
              "service",
              "marketing"
            ],
            "type": "string"
          },
          "sourceRef": {
            "maxLength": 200,
            "minLength": 0,
            "type": "string"
          },
          "wording": {
            "maxLength": 2000,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "action",
          "address",
          "channel",
          "method",
          "purpose"
        ],
        "type": "object"
      },
      "Recorded": {
        "properties": {
          "action": {
            "enum": [
              "given",
              "withdrawn"
            ],
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "channel": {
            "enum": [
              "whatsapp",
              "sms",
              "email",
              "in_app_chat"
            ],
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "method": {
            "enum": [
              "keyword",
              "form",
              "agent",
              "import",
              "partner_app"
            ],
            "type": "string"
          },
          "personId": {
            "format": "uuid",
            "type": "string"
          },
          "personType": {
            "enum": [
              "customer",
              "prospect"
            ],
            "type": "string"
          },
          "purpose": {
            "enum": [
              "service",
              "marketing"
            ],
            "type": "string"
          },
          "recordedAt": {
            "format": "date-time",
            "type": "string"
          },
          "recordedBy": {
            "type": "string"
          },
          "sourceRef": {
            "type": "string"
          },
          "wording": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Ref": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReplyBody": {
        "properties": {
          "attachmentIds": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 5,
            "minItems": 0,
            "type": "array"
          },
          "send": {
            "type": "boolean"
          },
          "text": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "text"
        ],
        "type": "object"
      },
      "ReplyInput": {
        "properties": {
          "params": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "templateId": {
            "format": "uuid",
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RequestInfoBody": {
        "properties": {
          "message": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          },
          "send": {
            "type": "boolean"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "message",
          "version"
        ],
        "type": "object"
      },
      "ResolveBody": {
        "properties": {
          "cause": {
            "enum": [
              "customer",
              "system",
              "partner",
              "process",
              "fraud",
              "policy"
            ],
            "type": "string"
          },
          "documents": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 0,
            "type": "array"
          },
          "message": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          },
          "outcome": {
            "enum": [
              "in_favor",
              "partial",
              "not_in_favor",
              "info_provided",
              "duplicate",
              "withdrawn"
            ],
            "type": "string"
          },
          "send": {
            "type": "boolean"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "cause",
          "outcome",
          "version"
        ],
        "type": "object"
      },
      "RevealRequestInput": {
        "properties": {
          "caseId": {
            "maxLength": 40,
            "minLength": 0,
            "type": "string"
          },
          "reason": {
            "maxLength": 500,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "caseId",
          "reason"
        ],
        "type": "object"
      },
      "SamaKpiReport": {
        "properties": {
          "from": {
            "format": "date",
            "type": "string"
          },
          "generatedAt": {
            "format": "date-time",
            "type": "string"
          },
          "kpis": {
            "items": {
              "$ref": "#/components/schemas/Kpi"
            },
            "type": "array"
          },
          "quarter": {
            "type": "string"
          },
          "received": {
            "format": "int64",
            "type": "integer"
          },
          "to": {
            "format": "date",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SamaRequestBody": {
        "properties": {
          "note": {
            "maxLength": 2000,
            "minLength": 0,
            "type": "string"
          },
          "samaRef": {
            "maxLength": 60,
            "minLength": 0,
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "SamaResponseBody": {
        "properties": {
          "documents": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 20,
            "minItems": 1,
            "type": "array"
          },
          "message": {
            "maxLength": 4000,
            "minLength": 0,
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "documents",
          "message",
          "version"
        ],
        "type": "object"
      },
      "SavedReply": {
        "properties": {
          "bodyAr": {
            "type": "string"
          },
          "bodyEn": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SavedReplyInput": {
        "properties": {
          "bodyAr": {
            "type": "string"
          },
          "bodyEn": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Sla": {
        "properties": {
          "ackLate": {
            "type": "boolean"
          },
          "cls": {
            "enum": [
              "complaint",
              "sama_objection",
              "sama_high",
              "inquiry",
              "request",
              "critical"
            ],
            "type": "string"
          },
          "deltaSeconds": {
            "format": "int64",
            "type": "integer"
          },
          "state": {
            "enum": [
              "ok",
              "risk",
              "breached",
              "paused",
              "met",
              "missed"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SlaSettingsView": {
        "properties": {
          "holidays": {
            "items": {
              "$ref": "#/components/schemas/Holiday"
            },
            "type": "array"
          },
          "policy": {
            "additionalProperties": {
              "additionalProperties": {},
              "type": "object"
            },
            "type": "object"
          },
          "timezone": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          },
          "workweek": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Source": {
        "properties": {
          "adId": {
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "campaign": {
            "type": "string"
          },
          "clickId": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "conversation",
              "form",
              "app_event",
              "ad",
              "manual",
              "import"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Stage": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "open",
              "won",
              "lost"
            ],
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          },
          "position": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "StageInput": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "open",
              "won",
              "lost"
            ],
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "State": {
        "properties": {
          "action": {
            "enum": [
              "given",
              "withdrawn"
            ],
            "type": "string"
          },
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "method": {
            "enum": [
              "keyword",
              "form",
              "agent",
              "import",
              "partner_app"
            ],
            "type": "string"
          },
          "purpose": {
            "enum": [
              "service",
              "marketing"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Status": {
        "properties": {
          "address": {
            "type": "string"
          },
          "channel": {
            "enum": [
              "whatsapp",
              "sms",
              "email",
              "in_app_chat"
            ],
            "type": "string"
          },
          "history": {
            "items": {
              "$ref": "#/components/schemas/Recorded"
            },
            "type": "array"
          },
          "states": {
            "items": {
              "$ref": "#/components/schemas/State"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "StatusBody": {
        "properties": {
          "status": {
            "enum": [
              "new",
              "open",
              "pending_customer",
              "pending_partner",
              "escalated",
              "resolved",
              "closed"
            ],
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "status",
          "version"
        ],
        "type": "object"
      },
      "TaskCustomerRef": {
        "properties": {
          "id": {
            "type": "string"
          },
          "nameAr": {
            "type": "string"
          },
          "nameEn": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TaskView": {
        "properties": {
          "amount": {
            "type": "number"
          },
          "approvedAt": {
            "format": "date-time",
            "type": "string"
          },
          "assignee": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "caseId": {
            "type": "string"
          },
          "checker": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "createdBy": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "customer": {
            "$ref": "#/components/schemas/TaskCustomerRef"
          },
          "doneAt": {
            "format": "date-time",
            "type": "string"
          },
          "dueAt": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "refund",
              "chargeback",
              "trace",
              "kyc_review",
              "unfreeze",
              "settlement",
              "fee_reversal",
              "card_reissue",
              "kyc_renewal",
              "integration"
            ],
            "type": "string"
          },
          "maker": {
            "$ref": "#/components/schemas/MemberRef"
          },
          "note": {
            "type": "string"
          },
          "overdue": {
            "type": "boolean"
          },
          "partnerRef": {
            "type": "string"
          },
          "requiresApproval": {
            "type": "boolean"
          },
          "status": {
            "enum": [
              "todo",
              "in_progress",
              "awaiting_approval",
              "waiting_partner",
              "done"
            ],
            "type": "string"
          },
          "submittedAt": {
            "format": "date-time",
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Template": {
        "properties": {
          "lang": {
            "enum": [
              "ar",
              "en"
            ],
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Tenant": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "format": "date-time",
            "type": "string"
          },
          "engagementEnabled": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TenantInput": {
        "properties": {
          "name": {
            "maxLength": 80,
            "minLength": 0,
            "type": "string"
          },
          "slug": {
            "maxLength": 41,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "name",
          "slug"
        ],
        "type": "object"
      },
      "Touchpoint": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "by": {
            "$ref": "#/components/schemas/Ref"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "reference": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "UpdateInput": {
        "properties": {
          "ownerId": {
            "type": "string"
          },
          "product": {
            "maxLength": 60,
            "minLength": 0,
            "type": "string"
          },
          "valueSar": {
            "type": "number"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "Usage": {
        "properties": {
          "cxSeats": {
            "format": "int32",
            "type": "integer"
          },
          "measuredAt": {
            "format": "date-time",
            "type": "string"
          },
          "month": {
            "format": "date",
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "tenantId": {
            "format": "uuid",
            "type": "string"
          },
          "whatsappNumbers": {
            "format": "int32",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Verification": {
        "properties": {
          "brokenAtSeq": {
            "format": "int64",
            "type": "integer"
          },
          "entries": {
            "format": "int64",
            "type": "integer"
          },
          "valid": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "VersionBody": {
        "properties": {
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "version"
        ],
        "type": "object"
      },
      "VersionInput": {
        "properties": {
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "Workspace": {
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WorkspaceInput": {
        "properties": {
          "name": {
            "maxLength": 80,
            "minLength": 0,
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      }
    }
  },
  "info": {
    "description": "The API behind the Reconaxe app: cases and their SLA clocks, customers, operations tasks with maker-checker approval, the inbox, leads, reports and the audit trail. Partners connecting their own systems use the [Partner API](../partner-api/) instead.\n\n**Sign in.** Every call needs `Authorization: Bearer <access token>` from your workspace's identity provider (OpenID Connect). What a token can do follows the person's roles, and every call stays inside their workspace.\n\n| Topic | Rule |\n|---|---|\n| Base path | `/api/v1`, JSON in camelCase |\n| Dates | Timestamps are ISO-8601 UTC (`2026-10-26T09:00:00Z`); dates are `YYYY-MM-DD`; money is a number in SAR with two decimals |\n| Errors | RFC 7807 `application/problem+json` with a stable `code`, for example `validation_failed`, `stale_version`, `invalid_transition`, `forbidden` |\n| Optimistic locking | Every change to an existing record sends the `version` it last read. A stale version answers **409** `stale_version` |\n| Idempotency | `POST /cases`, `/customers` and `/tasks` accept an `Idempotency-Key` header. Repeating a key returns the first answer |\n| Paging | `?page=0&size=25` (size up to 100) answers `{ items, page, size, total }`; lists with quick filters add `facets` |\n| Enums | Lowercase, exactly as listed in each schema. Unknown values answer 400 |\n| References | Customers `CU-YYMMDD-XXXX`, cases `CS-YYMMDD-XXXX`, tasks `OP-YYMMDD-XXXX` |\n| Personal data | Lists return contact details masked. Only `GET /customers/{id}` returns them in full, and each such view is written to the audit trail |\n\nReconaxe's SLA dates and states come from the server. Show `dueAt` as it is; recompute only a countdown for display.\n",
    "title": "Reconaxe CRM API",
    "version": "v1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/approvals": {
      "get": {
        "operationId": "list_9",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customerId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ApprovalView"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/approvals/count": {
      "get": {
        "operationId": "count",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PendingApprovals"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/approvals/{id}/approve": {
      "post": {
        "operationId": "approve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalDecisionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/approvals/{id}/decline": {
      "post": {
        "operationId": "decline",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApprovalDecisionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/audit": {
      "get": {
        "operationId": "list_8",
        "parameters": [
          {
            "in": "query",
            "name": "entityType",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "entityId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "action",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResultEntry"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Audit trail for the tenant, newest first",
        "tags": [
          "Audit"
        ]
      }
    },
    "/api/v1/audit/verify": {
      "get": {
        "operationId": "verify",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Verification"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Recompute the tenant's audit hash chain",
        "tags": [
          "Audit"
        ]
      }
    },
    "/api/v1/cases": {
      "get": {
        "operationId": "list_5",
        "parameters": [
          {
            "in": "query",
            "name": "filter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "enum": [
                "transfers",
                "cards",
                "wallet",
                "bills",
                "kyc",
                "access",
                "fees",
                "fraud",
                "merchant",
                "bnpl",
                "other",
                "collections",
                "disbursement",
                "credit_bureau",
                "repayment",
                "early_settlement",
                "restructuring",
                "application",
                "statements"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "priority",
            "required": false,
            "schema": {
              "enum": [
                "p1",
                "p2",
                "p3",
                "p4"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customerId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResultCaseSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Case queue with SLA ordering and per-filter counts",
        "tags": [
          "Cases"
        ]
      },
      "post": {
        "operationId": "create_7",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}": {
      "get": {
        "operationId": "get_4",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      },
      "patch": {
        "operationId": "edit_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": {},
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/acknowledge": {
      "post": {
        "operationId": "acknowledge",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcknowledgeBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/activities": {
      "get": {
        "operationId": "activities",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Activity"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/assign": {
      "post": {
        "operationId": "assign_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/attachments": {
      "get": {
        "operationId": "attachments",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/CaseAttachment"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Files on the case, with their virus-check status",
        "tags": [
          "Cases"
        ]
      },
      "post": {
        "operationId": "upload",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "properties": {
                  "file": {
                    "format": "binary",
                    "type": "string"
                  }
                },
                "required": [
                  "file"
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseAttachment"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Add a file to the case (PDF, JPG or PNG up to 10 MB); it can be opened or sent once the virus check passes",
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/attachments/{attachmentId}/content": {
      "get": {
        "operationId": "attachmentContent",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "format": "byte",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Download a file that passed the virus check (recorded in the audit trail)",
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/close": {
      "post": {
        "operationId": "close_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/notes": {
      "post": {
        "operationId": "note_2",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            },
            "description": "Created"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/objection": {
      "post": {
        "operationId": "objection",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The customer escalates the complaint to Level Two (3 business days); allowed once Level One is answered or past its deadline",
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/priority": {
      "post": {
        "operationId": "priority",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PriorityBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/replies": {
      "post": {
        "operationId": "reply_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Activity"
                }
              }
            },
            "description": "Created"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/request-info": {
      "post": {
        "operationId": "requestInfo",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestInfoBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/resolve": {
      "post": {
        "operationId": "resolve_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/sama-request": {
      "post": {
        "operationId": "samaRequest",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SamaRequestBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "SAMA asks for the answer on a complaint the customer escalated to SAMA: counted, 2 business days, reopens a resolved complaint",
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/sama-response": {
      "post": {
        "operationId": "samaResponse",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SamaResponseBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Record the answer to SAMA with the case files that support it (at least one)",
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/status": {
      "post": {
        "operationId": "status_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CaseDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/cases/{id}/templates/{kind}": {
      "get": {
        "operationId": "template",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": [
                "ack",
                "docs",
                "resolve"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Cases"
        ]
      }
    },
    "/api/v1/channels-gateway/events": {
      "post": {
        "operationId": "event",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JsonNode"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "A customer's message or a delivery status from Sanad Channels; 404 for an unknown channel, 409 when its workspace cannot take it",
        "tags": [
          "Channels gateway"
        ]
      }
    },
    "/api/v1/conversations": {
      "get": {
        "operationId": "list_7",
        "parameters": [
          {
            "in": "query",
            "name": "queue",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "mine",
                "unassigned"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "open",
                "closed"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResultConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Conversations, newest activity first. queue: all, mine or unassigned; q: a reference, a customer, or an exact phone or email",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}": {
      "get": {
        "operationId": "detail_1",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "A conversation with its messages, the contact's consent and the person's leads",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/assign": {
      "post": {
        "operationId": "assign",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AssignInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Assign to a member who can work conversations, or to nobody",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/case": {
      "post": {
        "operationId": "openCase",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CaseInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Open a case from the conversation, counted from the customer's first message (the conversation must belong to a customer)",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/close": {
      "post": {
        "operationId": "close",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/lead": {
      "post": {
        "operationId": "openLead",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Open a lead from the conversation, or attach to the person's open lead for the same product",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/link-customer": {
      "post": {
        "operationId": "link_1",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Link the conversation's prospect to an existing customer (an agent's decision)",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/messages": {
      "post": {
        "operationId": "reply",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MessageView"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Reply to the customer: text while the reply window is open, an approved template after it (409 reply_window_closed)",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/notes": {
      "post": {
        "operationId": "note_1",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MessageView"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "An internal note, never sent to the customer",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/read": {
      "post": {
        "operationId": "read_1",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "summary": "Mark the conversation as read",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/conversations/{ref}/reopen": {
      "post": {
        "operationId": "reopen",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/customers": {
      "get": {
        "operationId": "list_4",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "filter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResultCustomerView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      },
      "post": {
        "operationId": "create_6",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/customers/{id}": {
      "get": {
        "operationId": "get_2",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      },
      "put": {
        "operationId": "update_2",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/customers/{id}/full": {
      "get": {
        "operationId": "full",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFullDetails"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/customers/{id}/reveal-requests": {
      "post": {
        "operationId": "requestReveal",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevealRequestInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalView"
                }
              }
            },
            "description": "Created"
          }
        },
        "tags": [
          "Customers"
        ]
      }
    },
    "/api/v1/dashboard": {
      "get": {
        "operationId": "dashboard",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Dashboard"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Reports and dashboard",
          "Cases"
        ]
      }
    },
    "/api/v1/engagement/channels": {
      "get": {
        "operationId": "channels",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ChannelView"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The workspace's channels (settings only; secrets are never returned)",
        "tags": [
          "Engagement channels"
        ]
      },
      "post": {
        "operationId": "create_5",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelView"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Connect a channel with the workspace's own provider credentials; the webhook address is shown once, in this answer",
        "tags": [
          "Engagement channels"
        ]
      }
    },
    "/api/v1/engagement/channels/{id}": {
      "patch": {
        "operationId": "update_4",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelView"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Change a channel (send the version you read); secrets left out stay as they are",
        "tags": [
          "Engagement channels"
        ]
      }
    },
    "/api/v1/engagement/channels/{id}/renew-address": {
      "post": {
        "operationId": "renew",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelView"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Give the channel a new webhook address (shown once); the old one stops working at once",
        "tags": [
          "Engagement channels"
        ]
      }
    },
    "/api/v1/engagement/channels/{id}/test": {
      "post": {
        "operationId": "test",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelView"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Check the channel's credentials with the provider",
        "tags": [
          "Engagement channels"
        ]
      }
    },
    "/api/v1/engagement/consent": {
      "post": {
        "operationId": "record",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Recorded"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Record consent given or withdrawn by hand (agent, form or import); giving consent needs the wording shown",
        "tags": [
          "Consent"
        ]
      }
    },
    "/api/v1/engagement/consent-keywords": {
      "get": {
        "operationId": "keywords",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Keywords"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The words that, sent alone, withdraw (stop) or give (start) marketing consent",
        "tags": [
          "Consent"
        ]
      },
      "put": {
        "operationId": "saveKeywords",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Keywords"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Keywords"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Replace the STOP and START words (at least one STOP word; none in both lists)",
        "tags": [
          "Consent"
        ]
      }
    },
    "/api/v1/engagement/consent/lookup": {
      "post": {
        "operationId": "lookup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LookupInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Status"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Current consent per purpose and the full history for one contact address (masked)",
        "tags": [
          "Consent"
        ]
      }
    },
    "/api/v1/engagement/lead-types": {
      "get": {
        "operationId": "types",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LeadType"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The workspace's lead types with their stages and open lead counts",
        "tags": [
          "Leads"
        ]
      },
      "post": {
        "operationId": "createType",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadTypeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadType"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Create a lead type: 3–12 stages, the first open, at least one open, won and lost",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/engagement/lead-types/starter-set": {
      "post": {
        "operationId": "starterSet_1",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LeadType"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Add the starting set of lead types for lenders (types with the same English name are skipped)",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/engagement/lead-types/{id}": {
      "put": {
        "operationId": "updateType",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadTypeInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadType"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Change a lead type and its stages (send the version you read; keep the ids of stages that stay)",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/engagement/providers": {
      "get": {
        "operationId": "providers",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Provider"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Providers a channel can use, with the settings and secrets each needs",
        "tags": [
          "Engagement channels"
        ]
      }
    },
    "/api/v1/engagement/saved-replies": {
      "get": {
        "operationId": "savedReplies",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SavedReply"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Inbox"
        ]
      },
      "post": {
        "operationId": "createReply",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedReplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReply"
                }
              }
            },
            "description": "Created"
          }
        },
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/engagement/saved-replies/{id}": {
      "delete": {
        "operationId": "deleteReply",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "tags": [
          "Inbox"
        ]
      },
      "put": {
        "operationId": "updateReply",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SavedReplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SavedReply"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/engagement/templates": {
      "get": {
        "operationId": "list_3",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MessageTemplate"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The WhatsApp templates this workspace copied from Meta, switched-off ones included",
        "tags": [
          "Inbox"
        ]
      },
      "post": {
        "operationId": "create_4",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTemplate"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Add a template Meta approved: its exact name and language, wording with {{1}}… and a label per placeholder",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/engagement/templates/{id}": {
      "delete": {
        "operationId": "delete_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "summary": "Remove a template; messages already sent keep their wording",
        "tags": [
          "Inbox"
        ]
      },
      "put": {
        "operationId": "update_1",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/MessageTemplate"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Change a template, or switch it off while Meta has it paused",
        "tags": [
          "Inbox"
        ]
      }
    },
    "/api/v1/integration/case-updates": {
      "get": {
        "operationId": "caseUpdates",
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "default": 0,
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerCaseUpdateFeed"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "What the partner's app should tell customers about their cases, after a position, oldest first",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/cases": {
      "post": {
        "operationId": "createCase",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerCaseInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerCaseCreated"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Create a case raised in the partner's app; returns the reference to show the customer",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/cases/{submissionId}/files": {
      "post": {
        "operationId": "caseFile",
        "parameters": [
          {
            "in": "path",
            "name": "submissionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerFileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerFileReceived"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Evidence from the customer for a case (PDF, JPG or PNG up to 10 MB); locked until the virus check passes",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/cases/{submissionId}/replies": {
      "post": {
        "operationId": "caseReply",
        "parameters": [
          {
            "in": "path",
            "name": "submissionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerReplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerReplyReceived"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The customer's answer from the app, with files uploaded before; a case waiting on the customer goes back to the team",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/changes": {
      "get": {
        "operationId": "changes",
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "default": 0,
              "format": "int64",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerChangeFeed"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Changes made in Sanad to the partner's customers, after a position, oldest first",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/customers/{partnerRef}": {
      "get": {
        "operationId": "read",
        "parameters": [
          {
            "in": "path",
            "name": "partnerRef",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerFullProfile"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "A customer's full details, when the workspace allows the partner to read them (audited)",
        "tags": [
          "Partner integration"
        ]
      },
      "put": {
        "operationId": "upsert",
        "parameters": [
          {
            "in": "path",
            "name": "partnerRef",
            "required": true,
            "schema": {
              "maxLength": 64,
              "minLength": 0,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerProfileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerUpsertResult"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Create or update a customer profile from the partner (matched by the partner's customer number)",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/files/{fileId}": {
      "get": {
        "operationId": "file",
        "parameters": [
          {
            "in": "path",
            "name": "fileId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "format": "byte",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "A file an agent sent to the customer, or the customer's own, once it passed the virus check",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/kyc-files": {
      "post": {
        "operationId": "kycFile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KycFileInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/KycFileReceipt"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Apply the end-of-day KYC file; returns a receipt line by line",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/kyc-files/{businessDate}": {
      "get": {
        "operationId": "kycReceipt",
        "parameters": [
          {
            "in": "path",
            "name": "businessDate",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/KycFileReceipt"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The receipt of a day's KYC file",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/integration/reconciliations": {
      "post": {
        "operationId": "reconcile",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReconciliationBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationReport"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Compare the partner's nightly customer list with Sanad",
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/leads": {
      "get": {
        "operationId": "list_2",
        "parameters": [
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "open",
                "won",
                "lost"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "owner",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResultLeadSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Leads, most recently changed first; q matches a reference, a name, or an exact phone or email",
        "tags": [
          "Leads"
        ]
      },
      "post": {
        "operationId": "create_3",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Opened"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Create a lead for a customer or for contact details (matched to a prospect); attaches to the person's open lead for the same product instead of duplicating it",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/leads/{ref}": {
      "get": {
        "operationId": "detail",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "A lead with its touchpoints, newest first",
        "tags": [
          "Leads"
        ]
      },
      "patch": {
        "operationId": "update_3",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Change the owner, value or product (send the version you read)",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/leads/{ref}/link-customer": {
      "post": {
        "operationId": "link",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Link the lead's prospect to an existing customer; all the prospect's leads move to the customer",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/leads/{ref}/notes": {
      "post": {
        "operationId": "note",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Add a note (counts as first contact)",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/leads/{ref}/stage": {
      "post": {
        "operationId": "stage",
        "parameters": [
          {
            "in": "path",
            "name": "ref",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StageInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/LeadSummary"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Move to another stage: won and lost close the lead (lost needs a reason), an open stage reopens it",
        "tags": [
          "Leads"
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "me",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Session and members"
        ]
      }
    },
    "/api/v1/me/preferences": {
      "put": {
        "operationId": "savePreferences",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Preferences"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Preferences"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Session and members"
        ]
      }
    },
    "/api/v1/members": {
      "get": {
        "operationId": "members",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Member"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Session and members"
        ]
      }
    },
    "/api/v1/partner-connection": {
      "get": {
        "operationId": "overview",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerConnectionOverview"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/partner-connection/messages": {
      "get": {
        "operationId": "messages",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "default": "failed",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 100,
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/JsonNode"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/partner-connection/messages/{id}/resend": {
      "post": {
        "operationId": "resend",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/JsonNode"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Partner integration"
        ]
      }
    },
    "/api/v1/platform/engagement-usage": {
      "get": {
        "operationId": "usage",
        "parameters": [
          {
            "in": "query",
            "name": "month",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Usage"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Highest connected WhatsApp numbers and CX seats per tenant for a month (YYYY-MM, Riyadh months)",
        "tags": [
          "Workspace and platform"
        ]
      }
    },
    "/api/v1/platform/engagement-usage/measure": {
      "post": {
        "operationId": "measure",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Usage"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Measure every tenant now and return the current month",
        "tags": [
          "Workspace and platform"
        ]
      }
    },
    "/api/v1/platform/tenants": {
      "get": {
        "operationId": "list_1",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Tenant"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Workspace and platform"
        ]
      },
      "post": {
        "operationId": "create_2",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TenantInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            },
            "description": "Created"
          }
        },
        "tags": [
          "Workspace and platform"
        ]
      }
    },
    "/api/v1/platform/tenants/{id}/engagement": {
      "put": {
        "operationId": "engagement",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EngagementInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Workspace and platform"
        ]
      }
    },
    "/api/v1/products": {
      "get": {
        "operationId": "list_6",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The product list with each product's derived status and document checklist",
        "tags": [
          "Products"
        ]
      }
    },
    "/api/v1/products/codes-seen": {
      "get": {
        "operationId": "codesSeen",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ProductCodeSeen"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Codes met on profiles, leads or app events without a product, waiting to be named (named ones last)",
        "tags": [
          "Products"
        ]
      }
    },
    "/api/v1/products/codes-seen/{code}/resolve": {
      "post": {
        "operationId": "resolve",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductResolveInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCodeSeen"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Say which product a held code means; customers and leads holding it switch to the product's code",
        "tags": [
          "Products"
        ]
      }
    },
    "/api/v1/products/starter-set": {
      "post": {
        "operationId": "starterSet",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Product"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Add the starting product list (skips codes already on the list)",
        "tags": [
          "Products"
        ]
      }
    },
    "/api/v1/products/{code}": {
      "get": {
        "operationId": "get_1",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "One product by code (any case)",
        "tags": [
          "Products"
        ]
      },
      "put": {
        "operationId": "save",
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSaved"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Create or change a product: send the version you read to change one kept by hand; a catalogue entry older than the one held is ignored",
        "tags": [
          "Products"
        ]
      }
    },
    "/api/v1/reports/complaints": {
      "get": {
        "operationId": "complaints",
        "parameters": [
          {
            "in": "query",
            "name": "month",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ComplaintReport"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Monthly complaint KPIs (SAMA working-day rules, Asia/Riyadh)",
        "tags": [
          "Reports and dashboard"
        ]
      }
    },
    "/api/v1/reports/complaints.csv": {
      "get": {
        "operationId": "complaintsCsv",
        "parameters": [
          {
            "in": "query",
            "name": "month",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "default": "en",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "format": "byte",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Complaint register for a month as CSV (export is audited)",
        "tags": [
          "Reports and dashboard"
        ]
      }
    },
    "/api/v1/reports/sama-kpis": {
      "get": {
        "operationId": "samaKpis",
        "parameters": [
          {
            "in": "query",
            "name": "quarter",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SamaKpiReport"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "SAMA's eight quarterly complaint KPIs against their thresholds, for the complaints received in a quarter (YYYY-Qn)",
        "tags": [
          "Reports and dashboard"
        ]
      }
    },
    "/api/v1/reports/sama-kpis.csv": {
      "get": {
        "operationId": "samaKpisCsv",
        "parameters": [
          {
            "in": "query",
            "name": "quarter",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "lang",
            "required": false,
            "schema": {
              "default": "en",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "format": "byte",
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "SAMA quarterly KPI pack as CSV for the top executive (export is audited)",
        "tags": [
          "Reports and dashboard"
        ]
      }
    },
    "/api/v1/settings/automation/order": {
      "put": {
        "operationId": "reorder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AutomationRule"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Reorder the rules: every rule id once, first to run first",
        "tags": [
          "Automation rules"
        ]
      }
    },
    "/api/v1/settings/automation/preview": {
      "post": {
        "operationId": "preview",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationPreview"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "How many cases from the last 30 days match these conditions (as the cases are now)",
        "tags": [
          "Automation rules"
        ]
      }
    },
    "/api/v1/settings/automation/rules": {
      "get": {
        "operationId": "rules",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AutomationRule"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "The rules, in the order they run, with how often each applied in the last 30 days",
        "tags": [
          "Automation rules"
        ]
      },
      "post": {
        "operationId": "create_1",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                }
              }
            },
            "description": "Created"
          }
        },
        "summary": "Create a rule: a draft unless status says shadow or active",
        "tags": [
          "Automation rules"
        ]
      }
    },
    "/api/v1/settings/automation/rules/{id}": {
      "delete": {
        "operationId": "delete",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "version",
            "required": true,
            "schema": {
              "format": "int64",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "summary": "Delete a draft that never ran (rules that have run are archived instead, so their history stays)",
        "tags": [
          "Automation rules"
        ]
      },
      "put": {
        "operationId": "update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Change a rule (send the version you read)",
        "tags": [
          "Automation rules"
        ]
      }
    },
    "/api/v1/settings/automation/rules/{id}/status": {
      "post": {
        "operationId": "status",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationStatusInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRule"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "Move a rule through its lifecycle: draft, shadow (runs, changes nothing), active, archived",
        "tags": [
          "Automation rules"
        ]
      }
    },
    "/api/v1/settings/automation/runs": {
      "get": {
        "operationId": "runs",
        "parameters": [
          {
            "in": "query",
            "name": "ruleId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "live",
                "shadow"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AutomationRun"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK"
          }
        },
        "summary": "What the rules did, newest first (optionally for one rule; kind=live for applied or failed runs, kind=shadow for what shadow rules would have done)",
        "tags": [
          "Automation rules"
        ]
      }
    },
    "/api/v1/settings/partner": {
      "get": {
        "operationId": "get",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSettings"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Settings"
        ]
      },
      "put": {
        "operationId": "put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerSettingsInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerSettings"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Settings"
        ]
      }
    },
    "/api/v1/settings/sla": {
      "get": {
        "operationId": "get_5",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SlaSettingsView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "SLA settings"
        ]
      }
    },
    "/api/v1/settings/sla/holidays": {
      "post": {
        "operationId": "addHoliday",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HolidayInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SlaSettingsView"
                }
              }
            },
            "description": "Created"
          }
        },
        "tags": [
          "SLA settings"
        ]
      }
    },
    "/api/v1/settings/sla/holidays/{date}": {
      "delete": {
        "operationId": "removeHoliday",
        "parameters": [
          {
            "in": "path",
            "name": "date",
            "required": true,
            "schema": {
              "format": "date",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SlaSettingsView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "SLA settings"
        ]
      }
    },
    "/api/v1/settings/sla/policy": {
      "put": {
        "operationId": "updatePolicy",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PolicyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SlaSettingsView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "SLA settings"
        ]
      }
    },
    "/api/v1/settings/workspace": {
      "get": {
        "operationId": "workspace",
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Workspace and platform"
        ]
      },
      "put": {
        "operationId": "rename",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WorkspaceInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Workspace"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Workspace and platform"
        ]
      }
    },
    "/api/v1/tasks": {
      "get": {
        "operationId": "list",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "caseId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "customerId",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "size",
            "required": false,
            "schema": {
              "format": "int32",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/PageResultTaskView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Operations (maker-checker)"
        ]
      },
      "post": {
        "operationId": "create",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TaskView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Operations (maker-checker)"
        ]
      }
    },
    "/api/v1/tasks/{id}": {
      "get": {
        "operationId": "get_3",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TaskView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Operations (maker-checker)"
        ]
      },
      "patch": {
        "operationId": "edit",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": {},
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TaskView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Operations (maker-checker)"
        ]
      }
    },
    "/api/v1/tasks/{id}/{action}": {
      "post": {
        "operationId": "act",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersionBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/TaskView"
                }
              }
            },
            "description": "OK"
          }
        },
        "tags": [
          "Operations (maker-checker)"
        ]
      }
    }
  },
  "servers": [
    {
      "description": "Same origin as the web app",
      "url": "/"
    }
  ]
}
