{
  "openapi": "3.1.0",
  "info": {
    "title": "Transmitly API",
    "version": "1.51.0",
    "description": "Durable email acceptance, delivery events and inbound routing. Acceptance (202) means committed to Postgres; delivered_to_mx means the remote MX accepted the message, not inbox placement.",
    "contact": {
      "email": "support@transmitly.io"
    }
  },
  "servers": [
    {
      "url": "https://transmitly.io"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key, e.g. txk_..."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        }
      },
      "EmailRequest": {
        "type": "object",
        "required": [
          "from",
          "to",
          "subject"
        ],
        "properties": {
          "from": {
            "type": "string",
            "description": "Display name optional, e.g. 'Notify <notify@mail.acme.com>'. Domain must be verified."
          },
          "to": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 50
              }
            ]
          },
          "reply_to": {
            "type": "string",
            "maxLength": 320,
            "description": "Optional Reply-To address, display name allowed. Takes precedence over a Reply-To header. Must be a valid email address."
          },
          "subject": {
            "type": "string",
            "maxLength": 500
          },
          "html": {
            "type": "string",
            "maxLength": 1048576
          },
          "text": {
            "type": "string"
          },
          "stream": {
            "type": "string",
            "enum": [
              "transactional",
              "marketing"
            ],
            "default": "transactional"
          },
          "tags": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Additional headers. From, To, Subject, Date, Message-ID and Reply-To are managed by the API."
          },
          "template_id": {
            "type": "string",
            "description": "Resolve subject/html/text from a workspace template"
          },
          "template_data": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Values for {{variable}} placeholders"
          },
          "test_mode": {
            "type": "boolean",
            "description": "Accept and record the message without attempting SMTP delivery"
          },
          "cc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bcc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scheduled_at": {
            "type": "string",
            "description": "RFC3339 or \"in N minutes/hours/days\""
          },
          "topic": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "required": [
                "filename"
              ],
              "properties": {
                "filename": {
                  "type": "string"
                },
                "content": {
                  "type": "string",
                  "description": "Base64 content"
                },
                "path": {
                  "type": "string"
                },
                "content_type": {
                  "type": "string"
                },
                "content_id": {
                  "type": "string",
                  "description": "Inline CID"
                }
              }
            }
          }
        }
      },
      "EmailAccepted": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "const": "accepted"
          },
          "recipients": {
            "type": "integer"
          },
          "warning": {
            "type": "string"
          },
          "test_mode": {
            "type": "boolean"
          }
        }
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "recipient": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "sending",
              "delivered",
              "deferred",
              "bounced",
              "complained",
              "suppressed",
              "failed",
              "cancelled"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "provider_id": {
            "type": "string"
          },
          "mx_host": {
            "type": "string"
          },
          "smtp_code": {
            "type": "integer"
          },
          "enhanced_code": {
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "stream": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "recipient_count": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "enum": [
              "api",
              "inbound_forward",
              "inbound_relay",
              "inbox_reply",
              "broadcast"
            ]
          },
          "to": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bcc": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "topic": {
            "type": "string"
          }
        }
      },
      "Suppression": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InboundRoute": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "action": {
            "type": "string",
            "enum": [
              "forward",
              "relay",
              "webhook",
              "drop"
            ]
          },
          "destination": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InboundRouteInput": {
        "type": "object",
        "required": [
          "address",
          "action"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Full address or @domain catch-all"
          },
          "action": {
            "type": "string",
            "enum": [
              "forward",
              "relay",
              "webhook",
              "drop"
            ]
          },
          "destination": {
            "type": "string",
            "description": "Required for forward and relay"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "domain_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "last_success_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "last_failure_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "disabled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "disabled_reason": {
            "type": "string"
          },
          "avg_latency_ms": {
            "type": "integer"
          },
          "latency_alert_ms": {
            "type": "integer"
          }
        }
      },
      "WebhookInput": {
        "type": "object",
        "required": [
          "url",
          "events"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": "string"
          },
          "domain_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Empty means all domains"
          }
        }
      },
      "SuppressionInput": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "manual",
              "unsubscribe",
              "complaint",
              "hard_bounce",
              "invalid"
            ]
          },
          "stream": {
            "type": "string"
          },
          "note": {
            "type": "string"
          }
        }
      },
      "Inbox": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "domain_id": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "disabled"
            ]
          },
          "threads": {
            "type": "integer"
          },
          "unread": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InboxInput": {
        "type": "object",
        "required": [
          "address"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Address on a verified workspace domain"
          },
          "name": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          }
        }
      },
      "InboxThread": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "inbox_id": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "participants": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_message_at": {
            "type": "string",
            "format": "date-time"
          },
          "unread_count": {
            "type": "integer"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "archived"
            ]
          },
          "last_from": {
            "type": "string"
          },
          "last_preview": {
            "type": "string"
          },
          "assignee_id": {
            "type": "string"
          },
          "assignee_name": {
            "type": "string"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "last_direction": {
            "type": "string"
          }
        }
      },
      "InboxMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "from": {
            "type": "string"
          },
          "to": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "in_reply_to": {
            "type": "string"
          },
          "references": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "delivery_status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "filename": {
                  "type": "string"
                },
                "content_type": {
                  "type": "string"
                },
                "size_bytes": {
                  "type": "integer"
                }
              }
            }
          }
        }
      },
      "InboxReplyInput": {
        "type": "object",
        "properties": {
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "required": [
                "filename",
                "data"
              ],
              "properties": {
                "filename": {
                  "type": "string"
                },
                "content_type": {
                  "type": "string"
                },
                "data": {
                  "type": "string",
                  "description": "Base64 content"
                }
              }
            }
          }
        }
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "TemplateInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "Audience": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "contacts": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "double_opt_in": {
            "type": "boolean"
          },
          "confirmation_from": {
            "type": "string"
          }
        }
      },
      "AudienceInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "audience_name": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "unsubscribed": {
            "type": "boolean"
          },
          "source": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active"
            ]
          },
          "confirmed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "confirmation_sent_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "ContactInput": {
        "type": "object",
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "Broadcast": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "audience_name": {
            "type": "string"
          },
          "template_id": {
            "type": "string"
          },
          "from_email": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "sending",
              "sent",
              "cancelled",
              "failed"
            ]
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "recipients": {
            "type": "integer"
          },
          "queued": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "track_opens": {
            "type": "boolean"
          },
          "track_clicks": {
            "type": "boolean"
          },
          "variant_b_subject": {
            "type": "string"
          },
          "variant_b_html": {
            "type": "string"
          },
          "variant_b_text": {
            "type": "string"
          },
          "variant_split_percent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99
          },
          "winner_enabled": {
            "type": "boolean"
          },
          "winner_metric": {
            "type": "string",
            "enum": [
              "open",
              "click"
            ]
          },
          "winner_wait_minutes": {
            "type": "integer"
          },
          "winner_test_percent": {
            "type": "integer"
          },
          "winner_variant": {
            "type": "string",
            "enum": [
              "",
              "a",
              "b"
            ]
          },
          "winner_selected_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "segment_id": {
            "type": "string"
          },
          "segment_name": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "variant_c_subject": {
            "type": "string"
          },
          "variant_c_html": {
            "type": "string"
          },
          "variant_c_text": {
            "type": "string"
          },
          "variant_c_split_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "BroadcastInput": {
        "type": "object",
        "required": [
          "name",
          "from"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "audience_id": {
            "type": "string",
            "description": "Omit to target all contacts"
          },
          "template_id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "track_opens": {
            "type": "boolean"
          },
          "track_clicks": {
            "type": "boolean"
          },
          "variant_b_subject": {
            "type": "string",
            "description": "Optional B variant subject; empty falls back to A"
          },
          "variant_b_html": {
            "type": "string"
          },
          "variant_b_text": {
            "type": "string"
          },
          "variant_split_percent": {
            "type": "integer",
            "minimum": 1,
            "maximum": 99,
            "default": 50
          },
          "winner_enabled": {
            "type": "boolean",
            "description": "Requires a B variant and matching tracking"
          },
          "winner_metric": {
            "type": "string",
            "enum": [
              "open",
              "click"
            ],
            "default": "open"
          },
          "winner_wait_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440,
            "default": 240
          },
          "winner_test_percent": {
            "type": "integer",
            "minimum": 5,
            "maximum": 50,
            "default": 20
          },
          "segment_id": {
            "type": "string",
            "description": "Target a saved segment; overrides audience_id"
          },
          "topic": {
            "type": "string",
            "description": "Optional preference topic; contacts opted out of it are excluded"
          },
          "variant_c_subject": {
            "type": "string"
          },
          "variant_c_html": {
            "type": "string"
          },
          "variant_c_text": {
            "type": "string"
          },
          "variant_c_split_percent": {
            "type": "integer",
            "minimum": 0,
            "maximum": 99
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "BroadcastRecipient": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "broadcast_id": {
            "type": "string"
          },
          "contact_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processing",
              "queued",
              "skipped",
              "failed"
            ]
          },
          "message_id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "variant": {
            "type": "string",
            "enum": [
              "a",
              "b"
            ]
          },
          "phase": {
            "type": "string",
            "enum": [
              "send",
              "test",
              "remainder"
            ]
          }
        }
      },
      "SendingIP": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "node_id": {
            "type": "string"
          },
          "pool_id": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "expected_ptr": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "ptr_verified": {
            "type": "boolean"
          },
          "spf_verified": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "warming",
              "paused",
              "quarantined"
            ]
          },
          "last_checked_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "checks": {
            "type": "object",
            "additionalProperties": true
          },
          "reputation": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "MTANode": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "degraded",
              "unreachable",
              "unknown",
              "disabled"
            ]
          },
          "ips": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SendingIP"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DedicatedAssignment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sending_ip_id": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "node_id": {
            "type": "string"
          },
          "node_name": {
            "type": "string"
          },
          "endpoint": {
            "type": "string"
          },
          "source_name": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "org_name": {
            "type": "string"
          },
          "stream": {
            "type": "string",
            "enum": [
              "transactional",
              "marketing"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "warming",
              "active",
              "paused",
              "released"
            ]
          },
          "warmup_started_at": {
            "type": "string",
            "format": "date-time"
          },
          "warmup_days": {
            "type": "integer"
          },
          "warmup_day": {
            "type": "integer"
          },
          "daily_limit": {
            "type": "integer"
          },
          "sent_today": {
            "type": "integer"
          },
          "last_reset": {
            "type": "string",
            "format": "date-time"
          },
          "assigned_at": {
            "type": "string",
            "format": "date-time"
          },
          "released_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "sent_24h": {
            "type": "integer"
          },
          "delivered_24h": {
            "type": "integer"
          },
          "bounced_24h": {
            "type": "integer"
          },
          "complained_24h": {
            "type": "integer"
          }
        }
      },
      "DedicatedAssignmentInput": {
        "type": "object",
        "required": [
          "sending_ip_id"
        ],
        "properties": {
          "sending_ip_id": {
            "type": "string"
          },
          "stream": {
            "type": "string",
            "enum": [
              "transactional",
              "marketing"
            ]
          },
          "warmup_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 30
          }
        }
      },
      "AuditItem": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pass",
              "warn",
              "fail",
              "info"
            ]
          },
          "detail": {
            "type": "string"
          },
          "fix": {
            "type": "string"
          }
        }
      },
      "DomainAudit": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "org_name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pass",
              "warn",
              "fail"
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditItem"
            }
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BlocklistCheck": {
        "type": "object",
        "properties": {
          "zone": {
            "type": "string"
          },
          "listed": {
            "type": "boolean"
          },
          "response": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "IPAudit": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "node": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "ptr_verified": {
            "type": "boolean"
          },
          "spf_verified": {
            "type": "boolean"
          },
          "blocklists": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlocklistCheck"
            }
          },
          "impact": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pass",
              "warn",
              "fail"
            ]
          }
        }
      },
      "DeliverabilityAudit": {
        "type": "object",
        "properties": {
          "domains": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainAudit"
            }
          },
          "ips": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IPAudit"
            }
          },
          "zones": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "checked_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SendingIPControlInput": {
        "type": "object",
        "properties": {
          "pool_weight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "warming",
              "paused",
              "quarantined"
            ]
          }
        }
      },
      "DMARCSource": {
        "type": "object",
        "properties": {
          "source_ip": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "dkim_pass": {
            "type": "integer"
          },
          "spf_pass": {
            "type": "integer"
          },
          "disposition": {
            "type": "string"
          }
        }
      },
      "DMARCSummary": {
        "type": "object",
        "properties": {
          "domain_id": {
            "type": "string"
          },
          "reports": {
            "type": "integer"
          },
          "messages": {
            "type": "integer"
          },
          "dkim_pass": {
            "type": "integer"
          },
          "spf_pass": {
            "type": "integer"
          },
          "quarantined": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          },
          "last_report_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "sources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DMARCSource"
            }
          },
          "recent": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "trends": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DMARCDay"
            }
          },
          "source_details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DMARCSourceDetail"
            }
          }
        }
      },
      "DMARCDay": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string"
          },
          "messages": {
            "type": "integer"
          },
          "dkim_pass": {
            "type": "integer"
          },
          "spf_pass": {
            "type": "integer"
          },
          "quarantined": {
            "type": "integer"
          },
          "rejected": {
            "type": "integer"
          }
        }
      },
      "DedicatedEligibility": {
        "type": "object",
        "properties": {
          "eligible": {
            "type": "boolean"
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "plan": {
            "type": "string"
          },
          "plan_name": {
            "type": "string"
          },
          "allowance": {
            "type": "integer"
          },
          "assignments": {
            "type": "integer"
          },
          "available_ips": {
            "type": "integer"
          },
          "monthly_volume": {
            "type": "integer"
          },
          "minimum_volume": {
            "type": "integer"
          },
          "org_age_days": {
            "type": "integer"
          },
          "minimum_age_days": {
            "type": "integer"
          },
          "bounce_rate": {
            "type": "number"
          },
          "complaint_rate": {
            "type": "number"
          },
          "active_domains": {
            "type": "integer"
          },
          "pending_request": {
            "type": "boolean"
          },
          "billing_configured": {
            "type": "boolean"
          },
          "subscription_ready": {
            "type": "boolean"
          }
        }
      },
      "DedicatedIPRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "org_name": {
            "type": "string"
          },
          "stream": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "approved",
              "rejected",
              "cancelled"
            ]
          },
          "reason": {
            "type": "string"
          },
          "assignment_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "reviewed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "BroadcastAnalytics": {
        "type": "object",
        "properties": {
          "recipients": {
            "type": "integer"
          },
          "queued": {
            "type": "integer"
          },
          "skipped": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "complained": {
            "type": "integer"
          },
          "in_flight": {
            "type": "integer"
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "opens": {
            "type": "integer"
          },
          "unique_opens": {
            "type": "integer"
          },
          "clicks": {
            "type": "integer"
          },
          "unique_clicks": {
            "type": "integer"
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BroadcastVariantAnalytics"
            }
          },
          "test_variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BroadcastVariantAnalytics"
            }
          }
        }
      },
      "DMARCSourceDetail": {
        "type": "object",
        "properties": {
          "source_ip": {
            "type": "string"
          },
          "dkim_domain": {
            "type": "string"
          },
          "spf_domain": {
            "type": "string"
          },
          "header_from": {
            "type": "string"
          },
          "envelope_from": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "dkim_pass": {
            "type": "integer"
          },
          "spf_pass": {
            "type": "integer"
          },
          "disposition": {
            "type": "string"
          },
          "first_seen": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "last_seen": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "BroadcastVariantAnalytics": {
        "type": "object",
        "properties": {
          "variant": {
            "type": "string",
            "enum": [
              "a",
              "b"
            ]
          },
          "recipients": {
            "type": "integer"
          },
          "delivered": {
            "type": "integer"
          },
          "bounced": {
            "type": "integer"
          },
          "opens": {
            "type": "integer"
          },
          "unique_opens": {
            "type": "integer"
          },
          "clicks": {
            "type": "integer"
          },
          "unique_clicks": {
            "type": "integer"
          }
        }
      },
      "SegmentFilters": {
        "type": "object",
        "properties": {
          "attributes": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "source": {
            "type": "string"
          },
          "opened_within_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "clicked_within_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "include_unsubscribed": {
            "type": "boolean"
          }
        }
      },
      "Segment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "audience_name": {
            "type": "string"
          },
          "filters": {
            "$ref": "#/components/schemas/SegmentFilters"
          },
          "contacts": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SegmentInput": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "filters": {
            "$ref": "#/components/schemas/SegmentFilters"
          }
        }
      },
      "ContactTopic": {
        "type": "object",
        "properties": {
          "topic": {
            "type": "string"
          },
          "subscribed": {
            "type": "boolean"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "PreferenceUpdate": {
        "type": "object",
        "properties": {
          "unsubscribed": {
            "type": "boolean"
          },
          "topics": {
            "type": "object",
            "additionalProperties": {
              "type": "boolean"
            }
          }
        }
      },
      "AudienceUpdate": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "double_opt_in": {
            "type": "boolean"
          },
          "confirmation_from": {
            "type": "string",
            "description": "Verified sender for the confirmation email"
          }
        }
      },
      "AutomationStep": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "enum": [
              "wait",
              "send",
              "route"
            ]
          },
          "delay_minutes": {
            "type": "integer"
          },
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "template_id": {
            "type": "string"
          },
          "condition": {
            "$ref": "#/components/schemas/StepCondition"
          },
          "on_match_automation_id": {
            "type": "string"
          },
          "on_miss_automation_id": {
            "type": "string"
          }
        }
      },
      "Automation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "audience_name": {
            "type": "string"
          },
          "from_email": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "active",
              "paused"
            ]
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationStep"
            }
          },
          "enrolled": {
            "type": "integer"
          },
          "active": {
            "type": "integer"
          },
          "completed": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "trigger": {
            "type": "string",
            "enum": [
              "audience_join",
              "link_clicked",
              "contact_updated",
              "inbound_email",
              "inbound_route"
            ]
          },
          "trigger_url": {
            "type": "string"
          }
        }
      },
      "AutomationInput": {
        "type": "object",
        "required": [
          "name",
          "audience_id",
          "from",
          "steps"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "audience_id": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "from_name": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationStep"
            }
          },
          "trigger": {
            "type": "string",
            "enum": [
              "audience_join",
              "link_clicked",
              "contact_updated",
              "inbound_email",
              "inbound_route"
            ],
            "default": "audience_join"
          },
          "trigger_url": {
            "type": "string",
            "description": "Substring match for tracked click URLs; empty matches any click"
          }
        }
      },
      "StepCondition": {
        "type": "object",
        "properties": {
          "attribute_key": {
            "type": "string"
          },
          "attribute_value": {
            "type": "string"
          },
          "opened_within_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "clicked_within_days": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          }
        }
      },
      "TestModeSimulation": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "test_mode": {
            "type": "boolean"
          },
          "domain": {
            "type": "string"
          },
          "domain_status": {
            "type": "string"
          },
          "would_send": {
            "type": "integer"
          },
          "would_suppress": {
            "type": "integer"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string"
                },
                "suppressed": {
                  "type": "boolean"
                },
                "reason": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Notification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "link": {
            "type": "string"
          },
          "read_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookLatencyPoint": {
        "type": "object",
        "properties": {
          "bucket": {
            "type": "string",
            "format": "date-time"
          },
          "delivered": {
            "type": "integer"
          },
          "avg_ms": {
            "type": "integer"
          },
          "max_ms": {
            "type": "integer"
          }
        }
      },
      "SavedBlock": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "org_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TestScenario": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "payload": {
            "type": "object",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConsentEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "detail": {
            "type": "object",
            "additionalProperties": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TopicStat": {
        "type": "object",
        "properties": {
          "topic": {
            "type": "string"
          },
          "subscribed": {
            "type": "integer"
          },
          "unsubscribed": {
            "type": "integer"
          }
        }
      },
      "ContactStats": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer"
          },
          "active": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "unsubscribed": {
            "type": "integer"
          },
          "topics": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopicStat"
            }
          }
        }
      },
      "BlocklistRemovalCase": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sending_ip_id": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "zone": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "submitted",
              "removed",
              "rejected"
            ]
          },
          "evidence": {
            "type": "object",
            "additionalProperties": true
          },
          "notes": {
            "type": "string"
          },
          "submitted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "resolved_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "BIMIVMCCase": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "domain_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "submitted",
              "issued",
              "published",
              "expired",
              "rejected"
            ]
          },
          "ca_name": {
            "type": "string"
          },
          "trademark_name": {
            "type": "string"
          },
          "certificate_url": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "notes": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Error envelope",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/health": {
      "get": {
        "summary": "Service health",
        "security": [],
        "responses": {
          "200": {
            "description": "Component status"
          }
        }
      }
    },
    "/v1/emails": {
      "post": {
        "summary": "Accept an email",
        "description": "Durably accepts a message. Returns 202 only after the message, deliveries, idempotency key and outbox event commit.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAccepted"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/emails/{id}": {
      "get": {
        "summary": "Get a message with deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "$ref": "#/components/schemas/Message"
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Delivery"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/messages": {
      "get": {
        "summary": "List messages",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stream",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "source",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Message list"
          }
        }
      }
    },
    "/v1/domains": {
      "get": {
        "summary": "List sending domains and the DNS records to publish",
        "responses": {
          "200": {
            "description": "Domains with DNS instructions and plan limits"
          }
        }
      },
      "post": {
        "summary": "Add a sending domain",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domain"
                ],
                "properties": {
                  "domain": {
                    "type": "string",
                    "example": "mail.acme.com"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Domain created with DKIM key and DNS records"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/domains/{id}/verify": {
      "post": {
        "summary": "Verify DNS authentication",
        "description": "Checks ownership TXT, SPF, DKIM and DMARC. ACTIVE requires ownership plus aligned SPF and DKIM.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verification report"
          }
        }
      }
    },
    "/v1/suppressions": {
      "get": {
        "summary": "List suppressions",
        "responses": {
          "200": {
            "description": "Suppressions"
          }
        }
      },
      "post": {
        "summary": "Add a suppression",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string",
                    "enum": [
                      "manual",
                      "unsubscribe",
                      "complaint",
                      "hard_bounce",
                      "invalid"
                    ]
                  },
                  "stream": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Suppression created"
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "summary": "List webhook endpoints",
        "responses": {
          "200": {
            "description": "Endpoints with domain scope"
          }
        }
      },
      "post": {
        "summary": "Create a webhook endpoint",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "description": {
                    "type": "string"
                  },
                  "domain_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Empty means all domains"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Endpoint and signing secret"
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "summary": "Usage ledger and plan limits",
        "responses": {
          "200": {
            "description": "Daily usage plus plan limits"
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "summary": "Recent SMTP events",
        "responses": {
          "200": {
            "description": "Normalised attempts"
          }
        }
      }
    },
    "/v1/messages/{id}/deliveries": {
      "get": {
        "summary": "List deliveries for a message",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deliveries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Delivery"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/suppressions/{id}": {
      "delete": {
        "summary": "Delete a suppression",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "patch": {
        "summary": "Update a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated webhook"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "summary": "Delete a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/webhooks/attempts": {
      "get": {
        "summary": "Recent webhook delivery attempts",
        "responses": {
          "200": {
            "description": "Attempts with status and response codes"
          }
        },
        "parameters": [
          {
            "name": "endpoint",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "event",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ]
      }
    },
    "/v1/inbound/routes": {
      "get": {
        "summary": "List inbound routes",
        "responses": {
          "200": {
            "description": "Routes plus the workspace receiving domains",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "routes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboundRoute"
                      }
                    },
                    "mail_domains": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "bounce_domain": {
                      "type": "string"
                    },
                    "fbl_domain": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an inbound route",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboundRouteInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Route created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "route": {
                      "$ref": "#/components/schemas/InboundRoute"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/inbound/routes/{id}": {
      "patch": {
        "summary": "Update an inbound route action or destination",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboundRouteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated route",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "route": {
                      "$ref": "#/components/schemas/InboundRoute"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      },
      "delete": {
        "summary": "Delete an inbound route",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/inboxes": {
      "get": {
        "summary": "List inboxes",
        "responses": {
          "200": {
            "description": "Inboxes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inboxes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Inbox"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an inbox",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox": {
                      "$ref": "#/components/schemas/Inbox"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/inboxes/{id}": {
      "get": {
        "summary": "Get an inbox and its threads",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search subject, participants, labels and message text"
          }
        ],
        "responses": {
          "200": {
            "description": "Inbox and threads",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox": {
                      "$ref": "#/components/schemas/Inbox"
                    },
                    "threads": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboxThread"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete an inbox",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/inboxes/{id}/threads/{thread}": {
      "get": {
        "summary": "Get a thread and its messages",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Thread",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "inbox": {
                      "$ref": "#/components/schemas/Inbox"
                    },
                    "thread": {
                      "$ref": "#/components/schemas/InboxThread"
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboxMessage"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Mark a thread read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "read": {
                    "type": "boolean"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "archived"
                    ]
                  },
                  "assignee_id": {
                    "type": "string",
                    "description": "Member id; empty string unassigns"
                  },
                  "labels": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/inboxes/{id}/threads/{thread}/reply": {
      "post": {
        "summary": "Reply inside an inbox thread",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "thread",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InboxReplyInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Reply accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "$ref": "#/components/schemas/InboxMessage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/inboxes/{id}/messages/{message}/attachments/{attachment}": {
      "get": {
        "summary": "Download an inbox attachment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "message",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Attachment content"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/v1/templates": {
      "get": {
        "summary": "List templates",
        "responses": {
          "200": {
            "description": "Templates",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "templates": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Template"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a template",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "template": {
                      "$ref": "#/components/schemas/Template"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates/{id}": {
      "get": {
        "summary": "Get a template",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Template"
          }
        }
      },
      "patch": {
        "summary": "Update a template",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      },
      "delete": {
        "summary": "Delete a template",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/audiences": {
      "get": {
        "summary": "List audiences",
        "responses": {
          "200": {
            "description": "Audiences",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "audiences": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Audience"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create an audience",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/v1/audiences/{id}": {
      "get": {
        "summary": "Get an audience",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Audience"
          }
        }
      },
      "delete": {
        "summary": "Delete an audience",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      },
      "patch": {
        "summary": "Update audience settings",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AudienceUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/contacts": {
      "get": {
        "summary": "List contacts",
        "parameters": [
          {
            "name": "audience",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contacts"
          }
        }
      },
      "post": {
        "summary": "Create or update a contact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Saved"
          }
        }
      }
    },
    "/v1/contacts/import": {
      "post": {
        "summary": "Import contacts from CSV",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "audience_id": {
                    "type": "string"
                  },
                  "csv": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import result"
          }
        }
      }
    },
    "/v1/contacts/{id}": {
      "get": {
        "summary": "Get a contact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact"
          }
        }
      },
      "patch": {
        "summary": "Update a contact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "audience_id": {
                    "type": "string"
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "unsubscribed": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      },
      "delete": {
        "summary": "Delete a contact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/broadcasts": {
      "get": {
        "summary": "List broadcasts",
        "responses": {
          "200": {
            "description": "Broadcasts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "broadcasts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Broadcast"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a broadcast draft",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BroadcastInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "broadcast": {
                      "$ref": "#/components/schemas/Broadcast"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/broadcasts/{id}": {
      "get": {
        "summary": "Get a broadcast with recipients",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Broadcast, recipients and delivery analytics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "broadcast": {
                      "$ref": "#/components/schemas/Broadcast"
                    },
                    "recipients": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BroadcastRecipient"
                      }
                    },
                    "analytics": {
                      "$ref": "#/components/schemas/BroadcastAnalytics"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update a draft broadcast",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BroadcastInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      },
      "delete": {
        "summary": "Delete a draft or cancelled broadcast",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/broadcasts/{id}/send": {
      "post": {
        "summary": "Send or schedule a broadcast",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "Omit to send immediately"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Broadcast accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "broadcast": {
                      "$ref": "#/components/schemas/Broadcast"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/broadcasts/{id}/cancel": {
      "post": {
        "summary": "Cancel a broadcast",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cancelled"
          }
        }
      }
    },
    "/v1/mta/nodes": {
      "get": {
        "summary": "List MTA nodes, sending IPs and live health checks (platform admin)",
        "responses": {
          "200": {
            "description": "Node inventory with PTR, SPF and heartbeat checks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nodes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MTANode"
                      }
                    },
                    "checks": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "heartbeats": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "checked_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/mta/assignments": {
      "get": {
        "summary": "List dedicated sending-IP assignments for this workspace (platform admin)",
        "responses": {
          "200": {
            "description": "Assignments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assignments": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DedicatedAssignment"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Assign a dedicated sending IP (platform admin)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DedicatedAssignmentInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Assigned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "assignment": {
                      "$ref": "#/components/schemas/DedicatedAssignment"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Plan limit"
          },
          "409": {
            "description": "IP already assigned"
          }
        }
      }
    },
    "/v1/mta/assignments/{id}": {
      "delete": {
        "summary": "Release a dedicated sending IP (platform admin)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Released"
          }
        }
      }
    },
    "/v1/domains/{id}/audit": {
      "get": {
        "summary": "Run a live deliverability audit for one sending domain",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Domain audit",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "audit": {
                      "$ref": "#/components/schemas/DomainAudit"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/deliverability/audit": {
      "get": {
        "summary": "Run the platform deliverability audit (platform admin)",
        "responses": {
          "200": {
            "description": "Domain and sending-IP audit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliverabilityAudit"
                }
              }
            }
          }
        }
      }
    },
    "/v1/deliverability/blocklists/refresh": {
      "post": {
        "summary": "Refresh DNSBL checks for all sending IPs (platform admin)",
        "responses": {
          "200": {
            "description": "Refresh result"
          }
        }
      }
    },
    "/v1/mta/ips/{id}": {
      "patch": {
        "summary": "Set a sending IP weight or lifecycle status (platform admin)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendingIPControlInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated IP"
          }
        }
      }
    },
    "/v1/domains/{id}/dmarc": {
      "get": {
        "summary": "Summarise DMARC aggregate reports for a domain",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DMARC aggregate summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "summary": {
                      "$ref": "#/components/schemas/DMARCSummary"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/dedicated-ips": {
      "get": {
        "summary": "Get dedicated IP eligibility, assignments and request history",
        "responses": {
          "200": {
            "description": "Dedicated IP state"
          }
        }
      }
    },
    "/v1/dedicated-ips/requests": {
      "post": {
        "summary": "Request a dedicated IP",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "stream": {
                    "type": "string",
                    "enum": [
                      "transactional",
                      "marketing"
                    ]
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Requested"
          },
          "403": {
            "description": "Not eligible"
          }
        }
      }
    },
    "/v1/admin/dedicated-ip-requests": {
      "get": {
        "summary": "List dedicated IP requests (platform admin)",
        "parameters": [
          {
            "name": "pending",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requests"
          }
        }
      }
    },
    "/v1/admin/dedicated-ip-requests/{id}/decision": {
      "post": {
        "summary": "Approve or reject a dedicated IP request (platform admin)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approved",
                      "rejected"
                    ]
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Decision recorded"
          }
        }
      }
    },
    "/v1/broadcasts/{id}/test": {
      "post": {
        "summary": "Send one rendered test copy of a broadcast",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "email"
                  },
                  "variant": {
                    "type": "string",
                    "enum": [
                      "a",
                      "b"
                    ],
                    "default": "a"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Test accepted"
          }
        }
      }
    },
    "/t/o/{token}": {
      "get": {
        "summary": "Record a broadcast open and return a 1x1 pixel",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "GIF pixel"
          }
        }
      }
    },
    "/t/c/{token}": {
      "get": {
        "summary": "Record a tracked click and redirect",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "u",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect"
          }
        }
      }
    },
    "/v1/segments": {
      "get": {
        "summary": "List saved contact segments",
        "responses": {
          "200": {
            "description": "Segments",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "segments": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Segment"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a saved contact segment",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SegmentInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/v1/segments/{id}": {
      "get": {
        "summary": "Read a segment and preview its contacts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Segment"
          }
        }
      },
      "delete": {
        "summary": "Delete a segment",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/marketing/preferences": {
      "get": {
        "summary": "Read contact preferences from a signed link",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Preferences"
          }
        }
      },
      "post": {
        "summary": "Update contact preferences or perform one-click unsubscribe",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreferenceUpdate"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "example": "List-Unsubscribe=One-Click"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved"
          }
        }
      }
    },
    "/v1/contacts/{id}/confirm": {
      "post": {
        "summary": "Queue a double opt-in confirmation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Queued"
          }
        }
      }
    },
    "/v1/marketing/confirm": {
      "get": {
        "summary": "Confirm a double opt-in contact",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Confirmed"
          }
        }
      }
    },
    "/v1/automations": {
      "get": {
        "summary": "List marketing automations",
        "responses": {
          "200": {
            "description": "Automations"
          }
        }
      },
      "post": {
        "summary": "Create a draft automation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/v1/automations/{id}": {
      "get": {
        "summary": "Read an automation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation"
          }
        }
      },
      "delete": {
        "summary": "Delete a draft or paused automation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/automations/{id}/activate": {
      "post": {
        "summary": "Activate an automation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enroll_existing": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Activated"
          }
        }
      }
    },
    "/v1/automations/{id}/pause": {
      "post": {
        "summary": "Pause an automation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paused"
          }
        }
      }
    },
    "/v1/webhooks/{id}/status": {
      "post": {
        "summary": "Enable or disable a webhook endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "disabled"
                    ]
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/test-mode/simulate": {
      "post": {
        "summary": "Validate a message without accepting or sending it",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "from",
                  "to",
                  "subject"
                ],
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "subject": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "stream": {
                    "type": "string",
                    "enum": [
                      "transactional",
                      "marketing"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Simulation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestModeSimulation"
                }
              }
            }
          }
        }
      }
    },
    "/v1/notifications": {
      "get": {
        "summary": "List the current member notifications",
        "responses": {
          "200": {
            "description": "Notifications",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "notifications": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Notification"
                      }
                    },
                    "unread": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/notifications/read-all": {
      "post": {
        "summary": "Mark all notifications read",
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/notifications/{id}/read": {
      "post": {
        "summary": "Mark one notification read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/webhooks/latency": {
      "get": {
        "summary": "Hourly delivered webhook latency",
        "parameters": [
          {
            "name": "endpoint",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hours",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 720
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Latency points",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "points": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/WebhookLatencyPoint"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}/latency": {
      "post": {
        "summary": "Set a slow-endpoint alert threshold",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "latency_alert_ms": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 300000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/member/preferences": {
      "get": {
        "summary": "Read member notification preferences",
        "responses": {
          "200": {
            "description": "Preferences",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "notify_assignments": {
                      "type": "boolean"
                    },
                    "notify_digest": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "patch": {
        "summary": "Update member notification preferences",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "notify_assignments": {
                    "type": "boolean"
                  },
                  "notify_digest": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "notify_assignments": {
                      "type": "boolean"
                    },
                    "notify_digest": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/templates/{id}/preview": {
      "post": {
        "summary": "Render a template with data",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "template_data": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rendered template",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subject": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/saved-blocks": {
      "get": {
        "summary": "List reusable block presets",
        "responses": {
          "200": {
            "description": "Saved blocks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "saved_blocks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SavedBlock"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save a reusable block preset",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "blocks"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "blocks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/v1/saved-blocks/{id}": {
      "delete": {
        "summary": "Delete a reusable block preset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/test-mode/scenarios": {
      "get": {
        "summary": "List saved simulation scenarios",
        "responses": {
          "200": {
            "description": "Scenarios",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "scenarios": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TestScenario"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Save a simulation scenario",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "payload"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "payload": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/v1/test-mode/scenarios/{id}": {
      "delete": {
        "summary": "Delete a simulation scenario",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          }
        }
      }
    },
    "/v1/contacts/{id}/consent": {
      "get": {
        "summary": "Read a contact consent history",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Consent events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "consent": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConsentEvent"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/stats": {
      "get": {
        "summary": "Read contact and topic preference stats",
        "responses": {
          "200": {
            "description": "Stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stats": {
                      "$ref": "#/components/schemas/ContactStats"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/consent/export": {
      "get": {
        "summary": "Export consent events as CSV",
        "responses": {
          "200": {
            "description": "CSV export",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/v1/dashboard/emails": {
      "post": {
        "summary": "Send an email from the dashboard session",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "from",
                  "to",
                  "subject"
                ],
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "cc": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "bcc": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "subject": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "topic": {
                    "type": "string"
                  },
                  "scheduled_at": {
                    "type": "string"
                  },
                  "test_mode": {
                    "type": "boolean"
                  },
                  "attachments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "filename": {
                          "type": "string"
                        },
                        "content": {
                          "type": "string"
                        },
                        "content_type": {
                          "type": "string"
                        },
                        "content_id": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted"
          }
        }
      }
    },
    "/v1/assets": {
      "get": {
        "summary": "List compose assets with usage state",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Assets and total"
          }
        }
      },
      "post": {
        "summary": "Upload an image for the block builder",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "data"
                ],
                "properties": {
                  "filename": {
                    "type": "string"
                  },
                  "content_type": {
                    "type": "string"
                  },
                  "data": {
                    "type": "string",
                    "description": "Base64 image, max 5 MiB"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Uploaded"
          }
        }
      }
    },
    "/v1/assets/{id}": {
      "get": {
        "summary": "Read an uploaded compose asset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Image bytes"
          }
        }
      },
      "delete": {
        "summary": "Delete an unused compose asset",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted"
          },
          "409": {
            "description": "Asset is referenced or recently used"
          }
        }
      }
    },
    "/v1/deliverability/blocklist-cases": {
      "get": {
        "summary": "List blocklist removal cases",
        "responses": {
          "200": {
            "description": "Cases"
          }
        }
      },
      "post": {
        "summary": "Create a removal case with an evidence snapshot",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ip_id",
                  "zone"
                ],
                "properties": {
                  "ip_id": {
                    "type": "string"
                  },
                  "zone": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created"
          }
        }
      }
    },
    "/v1/deliverability/blocklist-cases/{id}/status": {
      "post": {
        "summary": "Update a removal case status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "open",
                      "submitted",
                      "removed",
                      "rejected"
                    ]
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    },
    "/v1/domains/{id}/bimi-case": {
      "get": {
        "summary": "Read the BIMI/VMC acquisition case",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Case or null"
          }
        }
      },
      "put": {
        "summary": "Create or update the BIMI/VMC acquisition case",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "ca_name": {
                    "type": "string"
                  },
                  "trademark_name": {
                    "type": "string"
                  },
                  "certificate_url": {
                    "type": "string"
                  },
                  "expires_at": {
                    "type": "string"
                  },
                  "notes": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated"
          }
        }
      }
    }
  }
}