{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.firstmilelabs.com/schemas/webhooks/case.exit.reversed.v1.json",
  "title": "FirstMileLabs Outbound Webhook — case.exit.reversed (v1)",
  "description": "An ended exit was reversed, because ending it was a mistake: the case is approved again, and case.status.changed is sent with it, status \"approved\". Only the confirmed reversal is sent; one proposed or cancelled sends nothing. Identifiers, who led the exit, 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",
    "endedAt",
    "reversedAt"
  ],
  "properties": {
    "event": { "type": "string", "const": "case.exit.reversed" },
    "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 that was reversed." },
    "ledBy": { "type": "string", "enum": ["customer", "firm"] },
    "endOn": { "type": "string", "format": "date", "description": "The day the reversed exit had ended the relationship." },
    "state": { "type": "string", "const": "reversed" },
    "endedAt": { "type": ["string", "null"], "format": "date-time", "description": "When the exit had ended." },
    "reversedAt": { "type": "string", "format": "date-time" }
  }
}
