{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tale-dev/json-schema/tale-dev-conversation-delivery-schema.json",
  "title": "ConversationDelivery",
  "description": "One native Inbox reply in a source’s delivery queue, as the listing shows it — never the claim token or the body",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tale-dev-conversations-api-openapi.yml#/components/schemas/ConversationDelivery",
  "type": "object",
  "required": [
    "messageId",
    "conversationId",
    "externalId",
    "status",
    "attempts",
    "availableAt",
    "retryAt",
    "claimedAt",
    "failedAt",
    "lastErrorCode",
    "acknowledgedAt",
    "receiptId"
  ],
  "additionalProperties": false,
  "properties": {
    "messageId": {
      "type": "string"
    },
    "conversationId": {
      "type": "string"
    },
    "externalId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "leased",
        "failed",
        "delivered"
      ],
      "description": "`queued` — waiting (the undo window, a backoff, a lapsed lease); `leased` — a claim’s five-minute lease runs; `failed` — dead-lettered, awaiting a retry or a discard; `delivered` — acknowledged"
    },
    "attempts": {
      "type": "integer",
      "description": "Failure reports so far"
    },
    "availableAt": {
      "type": "integer",
      "minimum": 0,
      "description": "When the undo window closed and the reply became claimable"
    },
    "retryAt": {
      "type": "integer",
      "minimum": 0,
      "description": "When it next becomes claimable: the lease end while leased, the backoff end after a transient failure, in the past (or 0) when due now"
    },
    "claimedAt": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "The first claim; `null` until one"
    },
    "failedAt": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "When it dead-lettered; `null` otherwise"
    },
    "lastErrorCode": {
      "type": [
        "string",
        "null"
      ],
      "description": "The code of the last failure report"
    },
    "acknowledgedAt": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "description": "Epoch milliseconds"
    },
    "receiptId": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}