{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bangermail-com/json-schema/bangermail-com-transactional-send-schema.json",
  "title": "TransactionalSend",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bangermail-com-openapi.json#/components/schemas/TransactionalSend",
  "type": "object",
  "required": [
    "id",
    "mailbox_id",
    "command_id",
    "status",
    "command_status",
    "recipient_count",
    "created_at",
    "updated_at",
    "completed_at"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "mailbox_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "command_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "status": {
      "type": "string"
    },
    "command_status": {
      "type": [
        "string",
        "null"
      ]
    },
    "subject": {
      "type": "string"
    },
    "recipients": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "recipient_count": {
      "type": "integer"
    },
    "error_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "send_intent_id": {
      "type": "string",
      "format": "uuid"
    },
    "provider": {
      "type": [
        "string",
        "null"
      ]
    },
    "route_kind": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": "string"
    },
    "from_address": {
      "type": "string"
    },
    "recipient_states": {
      "type": "object",
      "additionalProperties": {
        "type": "integer"
      }
    },
    "provider_message_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "language": {
      "description": "The language this email went out in; null when it was not translated.",
      "anyOf": [
        {
          "$ref": "#/$defs/SendLanguage"
        },
        {
          "type": "null"
        }
      ]
    },
    "journey": {
      "description": "The Journey step and enrollment that sent this email; null for other sends.",
      "type": [
        "object",
        "null"
      ],
      "required": [
        "journey_id",
        "step_id",
        "enrollment_id"
      ],
      "properties": {
        "journey_id": {
          "type": "string",
          "format": "uuid"
        },
        "step_id": {
          "type": "string",
          "format": "uuid"
        },
        "enrollment_id": {
          "type": "string",
          "format": "uuid"
        }
      }
    },
    "experiment": {
      "description": "The experiment variant this email was; null when none applied.",
      "type": [
        "object",
        "null"
      ],
      "required": [
        "experiment_id",
        "variant_key"
      ],
      "properties": {
        "experiment_id": {
          "type": "string",
          "format": "uuid"
        },
        "variant_key": {
          "type": "string"
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "template_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "template_version": {
      "type": [
        "integer",
        "null"
      ]
    },
    "workspace_revision": {
      "type": [
        "integer",
        "null"
      ]
    },
    "command_result": {
      "type": "object",
      "additionalProperties": true
    },
    "command_started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "command_completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "body_text": {
      "type": "string"
    },
    "body_html": {
      "type": "string"
    },
    "reply_to": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      }
    },
    "headers": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "value"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      }
    }
  },
  "$defs": {
    "SendLanguage": {
      "type": "object",
      "description": "The language a person got an email in. Only translated (managed-content) emails have one.",
      "required": [
        "locale"
      ],
      "properties": {
        "locale": {
          "type": "string",
          "description": "BCP 47 tag of the language the email was written in."
        },
        "requested_locale": {
          "type": "string",
          "description": "Present only on an older send that went out in another language: the language the person should have got."
        },
        "fallback_reason": {
          "type": "string",
          "enum": [
            "translation_missing",
            "translation_pending",
            "translation_review_required",
            "translation_failed",
            "translation_timeout"
          ]
        }
      }
    }
  }
}