{
 "openapi": "3.1.0",
 "info": {
  "title": "Email Outbox (Platform)",
  "version": "20261030b",
  "description": "Every message: to whom, about what, and what the mail server said. A failed one is retried on its own; a held one goes as soon as a transport is configured, unless it is three days old by then."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "mail-outbox": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "event_code": {
      "type": "string",
      "description": "Event code",
      "readOnly": true
     },
     "rule_id": {
      "type": "string",
      "format": "uuid",
      "description": "Rule id",
      "readOnly": true
     },
     "module": {
      "type": "string",
      "description": "Module",
      "readOnly": true
     },
     "resource": {
      "type": "string",
      "description": "Resource",
      "readOnly": true
     },
     "record_id": {
      "type": "string",
      "description": "Record id",
      "readOnly": true
     },
     "record_ref": {
      "type": "string",
      "description": "Record ref",
      "readOnly": true
     },
     "to_address": {
      "type": "string",
      "description": "To address",
      "readOnly": true
     },
     "to_name": {
      "type": "string",
      "description": "To name",
      "readOnly": true
     },
     "to_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "To user id",
      "readOnly": true
     },
     "from_email": {
      "type": "string",
      "description": "From email",
      "readOnly": true
     },
     "from_name": {
      "type": "string",
      "description": "From name",
      "readOnly": true
     },
     "reply_to": {
      "type": "string",
      "description": "Reply to",
      "readOnly": true
     },
     "subject": {
      "type": "string",
      "description": "Subject",
      "readOnly": true
     },
     "body_text": {
      "type": "string",
      "description": "Body text",
      "readOnly": true
     },
     "body_html": {
      "type": "string",
      "description": "Body html",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "transport": {
      "type": "string",
      "description": "Transport",
      "readOnly": true
     },
     "attempts": {
      "type": "integer",
      "description": "Attempts",
      "readOnly": true
     },
     "last_error": {
      "type": "string",
      "description": "Last error",
      "readOnly": true
     },
     "external_id": {
      "type": "string",
      "description": "External id",
      "readOnly": true
     },
     "dedupe_key": {
      "type": "string",
      "description": "Dedupe key",
      "readOnly": true
     },
     "next_attempt_at": {
      "type": "string",
      "format": "date-time",
      "description": "Next attempt at",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "sent_at": {
      "type": "string",
      "format": "date-time",
      "description": "Sent at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "unsubscribe_exempt": {
      "type": "string",
      "description": "Unsubscribe exempt",
      "readOnly": true
     },
     "attachments": {
      "type": "object",
      "description": "Attachments",
      "readOnly": true
     },
     "initiated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Initiated by",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/platform/mail-outbox": {
   "get": {
    "summary": "list mail-outbox",
    "operationId": "list_mail_outbox_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post email outbox",
    "operationId": "action_mail_outbox_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/platform/mail-outbox/{id}": {
   "get": {
    "summary": "get mail-outbox",
    "operationId": "get_mail_outbox_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put email outbox",
    "operationId": "action_mail_outbox_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete email outbox",
    "operationId": "action_mail_outbox_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/platform/mail-outbox/{id}/resend": {
   "post": {
    "summary": "Resend",
    "operationId": "action_mail_outbox_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/platform/mail-outbox/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_mail_outbox_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/platform/mail-outbox/{id}/cancel": {
   "post": {
    "summary": "Cancel",
    "operationId": "action_mail_outbox_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}