{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.firstmilelabs.com/schemas/webhooks/case.exit.cancelled.v1.json",
  "title": "FirstMileLabs Outbound Webhook — case.exit.cancelled (v1)",
  "description": "A confirmed exit was cancelled before it ended: the customer stays approved. Sent only for an exit case.exit.confirmed announced; a proposal cancelled before it was confirmed sends nothing. Identifiers, who led it, its state and its dates only: never why, a note, or anyone's name.",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "event",
    "eventId",
    "eventVersion",
    "timestamp",
    "orgId",
    "caseId",
    "exitId",
    "ledBy",
    "endOn",
    "state",
    "cancelledAt"
  ],
  "properties": {
    "event": { "type": "string", "const": "case.exit.cancelled" },
    "eventId": { "type": "string", "format": "uuid" },
    "eventVersion": { "type": "integer", "const": 1 },
    "timestamp": { "type": "string", "format": "date-time" },
    "orgId": { "type": "string" },
    "crmRecordId": { "type": ["string", "null"], "description": "Your own reference for the case, when it has one." },
    "crmSource": { "type": ["string", "null"] },
    "caseId": { "type": "string", "description": "The customer's case." },
    "exitId": { "type": "string", "format": "uuid", "description": "The exit. Stable across every event for the same exit." },
    "ledBy": { "type": "string", "enum": ["customer", "firm"] },
    "endOn": { "type": "string", "format": "date", "description": "The day it would have ended." },
    "state": { "type": "string", "const": "cancelled" },
    "cancelledAt": { "type": "string", "format": "date-time" }
  }
}
