{
  "components": {
    "responses": {},
    "schemas": {
      "Credential": {
        "description": "An API key, SMTP credential or IP range of the server. Secrets are never shown again.",
        "properties": {
          "cidr": {
            "description": "The address range (IP range credentials): the network address and prefix, e.g. 10.20.0.0/16",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "api",
              "smtp",
              "ip"
            ],
            "type": "string"
          },
          "last_used_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "description": "Identifies the credential: an API key reads karta_<prefix>_...",
            "type": "string"
          },
          "rate_limit_per_minute": {
            "minimum": 1,
            "type": "integer"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          },
          "scopes": {
            "items": {
              "enum": [
                "messages:send",
                "messages:read",
                "messages:manage",
                "suppressions:read",
                "suppressions:write",
                "credentials:read",
                "credentials:write",
                "webhooks:read",
                "webhooks:write",
                "routes:read",
                "routes:write",
                "messages:list",
                "messages:delete",
                "messages:raw",
                "domains:read"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "tls_required": {
            "description": "Whether a client in the range must connect over TLS (IP range credentials)",
            "type": "boolean"
          },
          "username": {
            "description": "The SMTP user name (SMTP credentials)",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "created_at"
        ],
        "title": "Credential",
        "type": "object"
      },
      "InboundDelivery": {
        "description": "One recipient of a received message, and what became of it.",
        "properties": {
          "address": {
            "type": "string"
          },
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "endpoint_id": {
            "format": "uuid",
            "type": "string"
          },
          "forward_message_id": {
            "description": "The outgoing message that forwarded it",
            "format": "uuid",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_code": {
            "description": "The HTTP status or SMTP reply code of the last attempt",
            "type": "integer"
          },
          "last_details": {
            "type": "string"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "route_id": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "description": "failed: never bounced to the sender",
            "enum": [
              "pending",
              "delivered",
              "failed",
              "accepted",
              "held"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "status",
          "attempts",
          "created_at"
        ],
        "title": "InboundDelivery",
        "type": "object"
      },
      "Attachment": {
        "additionalProperties": false,
        "properties": {
          "content_type": {
            "example": "application/pdf",
            "type": "string"
          },
          "data": {
            "description": "The content, base64",
            "format": "byte",
            "type": "string"
          },
          "filename": {
            "maxLength": 255,
            "minLength": 1,
            "type": "string"
          }
        },
        "required": [
          "content_type",
          "data"
        ],
        "title": "Attachment",
        "type": "object"
      },
      "Message": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "direction": {
            "enum": [
              "incoming",
              "outgoing"
            ],
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "mail_from": {
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/Recipient"
            },
            "type": "array"
          },
          "relay_credential_id": {
            "description": "The IP range credential that let the message in (outgoing messages); absent when it was submitted with AUTH",
            "format": "uuid",
            "type": "string"
          },
          "require_tls": {
            "description": "true when the message was sent with REQUIRETLS",
            "type": "boolean"
          },
          "send_at": {
            "description": "When delivery was to start (a scheduled message)",
            "format": "date-time",
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "subject": {
            "type": "string"
          },
          "tag": {
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "track_clicks": {
            "description": "false when click tracking was switched off for this message",
            "type": "boolean"
          },
          "track_opens": {
            "description": "false when open tracking was switched off for this message",
            "type": "boolean"
          },
          "variables": {
            "additionalProperties": true,
            "description": "As given when it was sent: text values from this API, any JSON value from others",
            "type": "object"
          }
        },
        "required": [
          "id",
          "direction",
          "mail_from",
          "size",
          "created_at",
          "recipients"
        ],
        "title": "Message",
        "type": "object"
      },
      "SendRequest": {
        "additionalProperties": false,
        "description": "A message built from its parts. Addresses are plain (`ann@example.com`) or with a name (`Ann <ann@example.com>`); From and Sender must be at a verified domain of the server's organisation.",
        "properties": {
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/Attachment"
            },
            "type": "array"
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "from": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Further header fields (not those Karta writes itself)",
            "type": "object"
          },
          "html": {
            "type": "string"
          },
          "reply_to": {
            "type": "string"
          },
          "require_tls": {
            "description": "true: REQUIRETLS (RFC 8689). The message is delivered only over TLS with a verified certificate (or DANE) to servers that support REQUIRETLS; a recipient whose servers cannot is bounced, never sent in the clear. Overrides a `TLS-Required: No` header. false or left out: the usual policy",
            "type": "boolean"
          },
          "send_at": {
            "description": "Deliver at this time (with its offset), at most 72 hours ahead; a time that has passed means at once",
            "format": "date-time",
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tag": {
            "description": "One tag: put in front of `tags`",
            "maxLength": 100,
            "type": "string"
          },
          "tags": {
            "description": "Labels for your own use: at most 10 (with `tag`), each 1 to 128 bytes without control characters; the first is the message's `tag`",
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "type": "array"
          },
          "text": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "maxItems": 50,
            "type": "array"
          },
          "track_clicks": {
            "description": "false: no click tracking for this message; true is the server's setting, as when left out",
            "type": "boolean"
          },
          "track_opens": {
            "description": "false: no open tracking for this message; true is the server's setting, as when left out",
            "type": "boolean"
          },
          "variables": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Data for your own use, returned with the message and its events: names of 1 to 128 bytes without control characters, text values, at most 16 KiB as JSON",
            "type": "object"
          }
        },
        "required": [
          "from"
        ],
        "title": "SendRequest",
        "type": "object"
      },
      "InboundRoute": {
        "description": "An address of a verified domain the server receives, and what happens to its mail.",
        "properties": {
          "address": {
            "description": "local_part@domain; *@domain for every other address",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dmarc_reject": {
            "description": "Mail failing DMARC for a domain whose policy is reject is refused (550 5.7.1)",
            "type": "boolean"
          },
          "domain": {
            "type": "string"
          },
          "endpoint_id": {
            "format": "uuid",
            "type": "string"
          },
          "fail_closed": {
            "description": "A scanner that cannot answer refuses the message (451 4.7.1); false: it is accepted and marked",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "local_part": {
            "type": "string"
          },
          "mode": {
            "description": "endpoint: to the endpoint; accept: stored; report: stored and read as a DMARC or TLS report; hold: stored and held; reject: refused when sent",
            "enum": [
              "endpoint",
              "accept",
              "report",
              "hold",
              "reject"
            ],
            "type": "string"
          },
          "plus_addressing": {
            "description": "name+anything is received as name",
            "type": "boolean"
          },
          "spam_mode": {
            "description": "Spam above the threshold is delivered (mark), held until released (hold), or refused (reject)",
            "enum": [
              "mark",
              "hold",
              "reject"
            ],
            "type": "string"
          },
          "spam_threshold": {
            "description": "The spam score from which this route calls a message spam (default 6.0)",
            "type": "number"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "domain",
          "local_part",
          "mode",
          "plus_addressing",
          "dmarc_reject",
          "spam_mode",
          "spam_threshold",
          "fail_closed",
          "created_at",
          "updated_at"
        ],
        "title": "InboundRoute",
        "type": "object"
      },
      "SuppressionPolicy": {
        "additionalProperties": false,
        "description": "When an address goes onto the server's suppression list by itself, and how long an entry of each reason lasts. Days are counted from when an entry takes its reason; 0 (or left out of a PUT) means it never expires. The bounds of the values are checked when the policy is set.",
        "properties": {
          "complaint_days": {
            "description": "How long a complaint lasts (0 to 3650); 0 never expires",
            "type": "integer"
          },
          "hard_bounce_days": {
            "description": "How long a hard bounce lasts (0 to 3650); 0 never expires",
            "type": "integer"
          },
          "manual_days": {
            "description": "How long an entry added by hand lasts (0 to 3650); 0 never expires",
            "type": "integer"
          },
          "soft_bounce_threshold": {
            "description": "Temporary failures of one address within the window that suppress it (0 to 100); 0 never",
            "type": "integer"
          },
          "soft_bounce_window_days": {
            "description": "Days those failures are counted over (1 to 3650)",
            "type": "integer"
          },
          "unsubscribe_days": {
            "description": "How long an unsubscribe lasts (0 to 3650); 0 never expires",
            "type": "integer"
          }
        },
        "title": "SuppressionPolicy",
        "type": "object"
      },
      "NewWebhookSecret": {
        "description": "A webhook with its new signing secret: shown this once. Webhooks in Postal's format have none: their organisation's key signs them, published at the organisation's JWK set; nor have those in Postmark's, which are not signed. In SendGrid's format the private key is never shown: public_key verifies the signatures. An extra authentication header's value is shown once, in the answer that sets it.",
        "properties": {
          "auth_header": {
            "description": "An extra header sent with every request (beside the format's signature), for a receiver that cannot check a signature. https only, except where the instance allows http; it does not protect the body's integrity or a request sent again.",
            "type": "string"
          },
          "auth_header_value": {
            "description": "The extra header's secret value: shown once, in the answer that sets it, and never by a read",
            "type": "string"
          },
          "basic_auth_user": {
            "description": "The user name sent as Basic authentication (the password is never shown)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled_reason": {
            "description": "Why Karta switched the webhook off",
            "enum": [
              "failing"
            ],
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "description": "The event types sent; [\"*\"] for every type, those added later too. One of: domain.dns_failed, message.accepted, message.bounced, message.clicked, message.complained, message.deferred, message.delivered, message.opened, message.suppressed, message.unsubscribed",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "failing_since": {
            "description": "Since when every request has failed",
            "format": "date-time",
            "type": "string"
          },
          "format": {
            "description": "standard: Standard Webhooks; postal, mailgun, sendgrid, postmark: those providers' webhooks",
            "enum": [
              "standard",
              "postal",
              "mailgun",
              "sendgrid",
              "postmark"
            ],
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "previous_secret_expires_at": {
            "description": "Until when the secret before the last rotation signs too",
            "format": "date-time",
            "type": "string"
          },
          "public_key": {
            "description": "sendgrid: the public key that verifies the requests' signatures (base64, as SendGrid shows its verification key)",
            "type": "string"
          },
          "secret": {
            "description": "standard: whsec_ and the base64 of the key (Standard Webhooks); mailgun: the signing key, 64 hexadecimal digits",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "Without the user name and password it was given with",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "format",
          "events",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "title": "NewWebhookSecret",
        "type": "object"
      },
      "BatchRequest": {
        "additionalProperties": false,
        "description": "One message per recipient, built from the same parts and options, each with only its recipient in To and its replacements made. All are checked before any is sent: all are sent, or none.",
        "properties": {
          "attachments": {
            "items": {
              "$ref": "#/components/schemas/Attachment"
            },
            "type": "array"
          },
          "from": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Further header fields (not those Karta writes itself)",
            "type": "object"
          },
          "html": {
            "type": "string"
          },
          "recipients": {
            "description": "At most the instance's batch limit (KARTA_BATCH_MAX_MESSAGES: 100 by default, never more than 1000); more is too_many_recipients.",
            "items": {
              "$ref": "#/components/schemas/BatchRecipient"
            },
            "maxItems": 1000,
            "minItems": 1,
            "type": "array"
          },
          "reply_to": {
            "type": "string"
          },
          "require_tls": {
            "description": "true: REQUIRETLS (RFC 8689). The message is delivered only over TLS with a verified certificate (or DANE) to servers that support REQUIRETLS; a recipient whose servers cannot is bounced, never sent in the clear. Overrides a `TLS-Required: No` header. false or left out: the usual policy",
            "type": "boolean"
          },
          "send_at": {
            "description": "Deliver at this time (with its offset), at most 72 hours ahead; a time that has passed means at once",
            "format": "date-time",
            "type": "string"
          },
          "sender": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "tag": {
            "description": "One tag: put in front of `tags`",
            "maxLength": 100,
            "type": "string"
          },
          "tags": {
            "description": "Labels for your own use: at most 10 (with `tag`), each 1 to 128 bytes without control characters; the first is the message's `tag`",
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "type": "array"
          },
          "text": {
            "type": "string"
          },
          "track_clicks": {
            "description": "false: no click tracking for this message; true is the server's setting, as when left out",
            "type": "boolean"
          },
          "track_opens": {
            "description": "false: no open tracking for this message; true is the server's setting, as when left out",
            "type": "boolean"
          },
          "variables": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Data for your own use, returned with the message and its events: names of 1 to 128 bytes without control characters, text values, at most 16 KiB as JSON",
            "type": "object"
          }
        },
        "required": [
          "from",
          "recipients"
        ],
        "title": "BatchRequest",
        "type": "object"
      },
      "SentBatch": {
        "properties": {
          "data": {
            "description": "The messages, in the order of the recipients",
            "items": {
              "$ref": "#/components/schemas/SentMessage"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "SentBatch",
        "type": "object"
      },
      "Error": {
        "properties": {
          "error": {
            "properties": {
              "code": {
                "description": "A stable, machine-readable code",
                "type": "string"
              },
              "details": {
                "items": {
                  "properties": {
                    "field": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ],
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "title": "Error",
        "type": "object"
      },
      "InboundRouteList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/InboundRoute"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "InboundRouteList",
        "type": "object"
      },
      "RawRequest": {
        "additionalProperties": false,
        "description": "A message given whole, with its envelope. An automatic reply may ask for the null reverse path with auto_reply.",
        "properties": {
          "auto_reply": {
            "description": "true: an automatic reply, sent with the null envelope sender (MAIL FROM:<>); mail_from must be empty or left out, and the message must carry Auto-Submitted: auto-replied or auto-generated",
            "type": "boolean"
          },
          "data": {
            "description": "The message, base64",
            "format": "byte",
            "type": "string"
          },
          "mail_from": {
            "description": "The envelope sender; empty or left out with auto_reply for the null sender",
            "type": "string"
          },
          "rcpt_to": {
            "items": {
              "type": "string"
            },
            "maxItems": 150,
            "minItems": 1,
            "type": "array"
          },
          "require_tls": {
            "description": "true: REQUIRETLS (RFC 8689). The message is delivered only over TLS with a verified certificate (or DANE) to servers that support REQUIRETLS; a recipient whose servers cannot is bounced, never sent in the clear. Overrides a `TLS-Required: No` header. false or left out: the usual policy",
            "type": "boolean"
          },
          "send_at": {
            "description": "Deliver at this time (with its offset), at most 72 hours ahead; a time that has passed means at once",
            "format": "date-time",
            "type": "string"
          },
          "tag": {
            "description": "One tag: put in front of `tags`",
            "maxLength": 100,
            "type": "string"
          },
          "tags": {
            "description": "Labels for your own use: at most 10 (with `tag`), each 1 to 128 bytes without control characters; the first is the message's `tag`",
            "items": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 10,
            "type": "array"
          },
          "track_clicks": {
            "description": "false: no click tracking for this message; true is the server's setting, as when left out",
            "type": "boolean"
          },
          "track_opens": {
            "description": "false: no open tracking for this message; true is the server's setting, as when left out",
            "type": "boolean"
          },
          "variables": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Data for your own use, returned with the message and its events: names of 1 to 128 bytes without control characters, text values, at most 16 KiB as JSON",
            "type": "object"
          }
        },
        "required": [
          "rcpt_to",
          "data"
        ],
        "title": "RawRequest",
        "type": "object"
      },
      "CreateSuppressionRequest": {
        "additionalProperties": false,
        "properties": {
          "address": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "default": "manual",
            "enum": [
              "manual",
              "unsubscribe"
            ],
            "type": "string"
          }
        },
        "required": [
          "address"
        ],
        "title": "CreateSuppressionRequest",
        "type": "object"
      },
      "Suppression": {
        "description": "An address the server does not send to.",
        "properties": {
          "address": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "reason": {
            "enum": [
              "manual",
              "unsubscribe",
              "hard_bounce",
              "complaint"
            ],
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "address",
          "reason",
          "created_at",
          "updated_at"
        ],
        "title": "Suppression",
        "type": "object"
      },
      "WebhookRequest": {
        "description": "One request made for a delivery.",
        "properties": {
          "address": {
            "description": "The address connected to",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "duration_ms": {
            "minimum": 0,
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "number": {
            "minimum": 1,
            "type": "integer"
          },
          "response": {
            "description": "The start of the answer's body",
            "type": "string"
          },
          "status": {
            "description": "The HTTP status of the answer",
            "type": "integer"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "number",
          "url",
          "duration_ms",
          "created_at"
        ],
        "title": "WebhookRequest",
        "type": "object"
      },
      "CredentialList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Credential"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "CredentialList",
        "type": "object"
      },
      "InboundScan": {
        "description": "What the spam and virus scanners said about a received message.",
        "properties": {
          "spam": {
            "$ref": "#/components/schemas/InboundScanSpam"
          },
          "virus": {
            "$ref": "#/components/schemas/InboundScanVirus"
          }
        },
        "required": [
          "spam",
          "virus"
        ],
        "title": "InboundScan",
        "type": "object"
      },
      "CreateWebhookRequest": {
        "additionalProperties": false,
        "properties": {
          "auth_header": {
            "description": "An extra header sent with every request, beside the format's signature (an HTTP token; reserved names are refused)",
            "maxLength": 100,
            "type": "string"
          },
          "auth_header_remove": {
            "default": false,
            "description": "Remove the extra header and its value (cannot go with a header or a value)",
            "type": "boolean"
          },
          "auth_header_value": {
            "description": "The header's secret value (printable ASCII); it is shown once, in this answer",
            "maxLength": 1024,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "events": {
            "description": "The event types to send (those the format has); [\"*\"] (the default) for every type the format has. A name outside the first list is accepted only for the optional modules that add events, while they are on",
            "items": {
              "anyOf": [
                {
                  "enum": [
                    "*",
                    "domain.dns_failed",
                    "message.accepted",
                    "message.bounced",
                    "message.clicked",
                    "message.complained",
                    "message.deferred",
                    "message.delivered",
                    "message.opened",
                    "message.suppressed",
                    "message.unsubscribed"
                  ],
                  "type": "string"
                },
                {
                  "pattern": "^messaging\\.[a-z_.]+$",
                  "type": "string"
                }
              ]
            },
            "minItems": 1,
            "type": "array"
          },
          "format": {
            "default": "standard",
            "description": "The format of the requests; it cannot be changed later",
            "enum": [
              "standard",
              "postal",
              "mailgun",
              "sendgrid",
              "postmark"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 100,
            "type": "string"
          },
          "url": {
            "description": "https (http only where the instance allows it); a user name and password in it (https only) are sent as Basic authentication",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "url"
        ],
        "title": "CreateWebhookRequest",
        "type": "object"
      },
      "InboundScanSymbol": {
        "description": "A rspamd symbol that scored, and why.",
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "score": {
            "type": "number"
          }
        },
        "required": [
          "name",
          "score"
        ],
        "title": "InboundScanSymbol",
        "type": "object"
      },
      "InboundAuthentication": {
        "description": "What Karta found out about the sender when it received the message: SPF, DKIM, DMARC, ARC.",
        "properties": {
          "arc": {
            "description": "The message's ARC chain",
            "properties": {
              "oldest_pass": {
                "description": "The oldest set whose message signature still verifies, 0 when all do (pass only)",
                "type": "integer"
              },
              "reason": {
                "description": "Why it failed",
                "type": "string"
              },
              "result": {
                "enum": [
                  "none",
                  "pass",
                  "fail"
                ],
                "type": "string"
              },
              "sealers": {
                "description": "Each ARC set's sealer, oldest first (pass only)",
                "items": {
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "instance": {
                      "type": "integer"
                    },
                    "selector": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "instance",
                    "domain",
                    "selector"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "sets": {
                "description": "The number of ARC sets",
                "type": "integer"
              }
            },
            "required": [
              "result"
            ],
            "type": "object"
          },
          "authserv_id": {
            "description": "The authserv-id of the Authentication-Results field Karta added",
            "type": "string"
          },
          "dkim": {
            "description": "One per signature",
            "items": {
              "properties": {
                "algorithm": {
                  "enum": [
                    "rsa_sha256",
                    "ed25519_sha256"
                  ],
                  "type": "string"
                },
                "domain": {
                  "description": "d=",
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "result": {
                  "enum": [
                    "pass",
                    "fail",
                    "policy",
                    "neutral",
                    "temperror",
                    "permerror"
                  ],
                  "type": "string"
                },
                "selector": {
                  "description": "s=",
                  "type": "string"
                }
              },
              "required": [
                "result"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "dmarc": {
            "description": "One per author domain",
            "items": {
              "properties": {
                "dkim_aligned": {
                  "type": "boolean"
                },
                "domain": {
                  "description": "The author domain (From:)",
                  "type": "string"
                },
                "override": {
                  "description": "Accepted although it failed: arc (a trusted ARC sealer's results say DMARC passed)",
                  "enum": [
                    "arc"
                  ],
                  "type": "string"
                },
                "policy": {
                  "description": "What the domain asks for mail that fails (milder in test mode)",
                  "enum": [
                    "none",
                    "quarantine",
                    "reject"
                  ],
                  "type": "string"
                },
                "policy_domain": {
                  "description": "Where the policy was found",
                  "type": "string"
                },
                "published": {
                  "properties": {
                    "adkim": {
                      "enum": [
                        "relaxed",
                        "strict"
                      ],
                      "type": "string"
                    },
                    "aspf": {
                      "enum": [
                        "relaxed",
                        "strict"
                      ],
                      "type": "string"
                    },
                    "np": {
                      "enum": [
                        "none",
                        "quarantine",
                        "reject"
                      ],
                      "type": "string"
                    },
                    "p": {
                      "enum": [
                        "none",
                        "quarantine",
                        "reject"
                      ],
                      "type": "string"
                    },
                    "sp": {
                      "enum": [
                        "none",
                        "quarantine",
                        "reject"
                      ],
                      "type": "string"
                    },
                    "t": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "p",
                    "adkim",
                    "aspf",
                    "t"
                  ],
                  "type": "object"
                },
                "reason": {
                  "type": "string"
                },
                "result": {
                  "enum": [
                    "pass",
                    "fail",
                    "none",
                    "temperror",
                    "permerror"
                  ],
                  "type": "string"
                },
                "spf_aligned": {
                  "type": "boolean"
                },
                "testing": {
                  "description": "The policy is in test mode (t=y)",
                  "type": "boolean"
                }
              },
              "required": [
                "result",
                "testing",
                "spf_aligned",
                "dkim_aligned"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "helo": {
            "type": "string"
          },
          "ip": {
            "description": "The client's address",
            "type": "string"
          },
          "mail_from": {
            "type": "string"
          },
          "spf": {
            "description": "SPF for the MAIL FROM identity",
            "properties": {
              "domain": {
                "description": "The domain checked",
                "type": "string"
              },
              "reason": {
                "description": "Why, for temperror and permerror",
                "type": "string"
              },
              "result": {
                "enum": [
                  "pass",
                  "fail",
                  "softfail",
                  "neutral",
                  "none",
                  "temperror",
                  "permerror"
                ],
                "type": "string"
              }
            },
            "required": [
              "result"
            ],
            "type": "object"
          },
          "spf_helo": {
            "description": "SPF for the HELO identity",
            "properties": {
              "domain": {
                "description": "The domain checked",
                "type": "string"
              },
              "reason": {
                "description": "Why, for temperror and permerror",
                "type": "string"
              },
              "result": {
                "enum": [
                  "pass",
                  "fail",
                  "softfail",
                  "neutral",
                  "none",
                  "temperror",
                  "permerror"
                ],
                "type": "string"
              }
            },
            "required": [
              "result"
            ],
            "type": "object"
          }
        },
        "required": [
          "ip",
          "mail_from",
          "spf",
          "dkim",
          "dmarc"
        ],
        "title": "InboundAuthentication",
        "type": "object"
      },
      "ReplayWebhookRequest": {
        "additionalProperties": false,
        "description": "Sends again the webhook's deliveries of events that happened in the range, in the states given (default the failed ones), at most 10,000 at a time.",
        "properties": {
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "states": {
            "default": [
              "failed"
            ],
            "items": {
              "enum": [
                "failed",
                "succeeded"
              ],
              "type": "string"
            },
            "minItems": 1,
            "type": "array"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          }
        },
        "title": "ReplayWebhookRequest",
        "type": "object"
      },
      "DeliveryList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Delivery"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "DeliveryList",
        "type": "object"
      },
      "EventList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "type": "array"
          },
          "next": {
            "description": "When there may be more: pass it as `after` for the next page",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "EventList",
        "type": "object"
      },
      "SuppressionList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Suppression"
            },
            "type": "array"
          },
          "next": {
            "description": "When there may be more: pass it as `after` for the next page",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "SuppressionList",
        "type": "object"
      },
      "SentMessage": {
        "properties": {
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "message_id": {
            "description": "The Message-ID field",
            "type": "string"
          },
          "recipients": {
            "items": {
              "$ref": "#/components/schemas/Recipient"
            },
            "type": "array"
          },
          "send_at": {
            "description": "When delivery starts (a scheduled message)",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "recipients"
        ],
        "title": "SentMessage",
        "type": "object"
      },
      "UpdateInboundRouteRequest": {
        "additionalProperties": false,
        "description": "Only the fields given change (not the domain).",
        "properties": {
          "dmarc_reject": {
            "description": "Refuse mail that fails DMARC for an author domain whose policy is reject; false: accept it, marked as failing",
            "type": "boolean"
          },
          "endpoint_id": {
            "description": "mode endpoint: an endpoint of the server",
            "format": "uuid",
            "type": "string"
          },
          "fail_closed": {
            "description": "A scanner that cannot answer refuses the message with 451 4.7.1 (the default); false accepts it, marked",
            "type": "boolean"
          },
          "local_part": {
            "description": "Letters, digits, '.', '_' and '-' (no '+'); * for every other address of the domain",
            "maxLength": 64,
            "type": "string"
          },
          "mode": {
            "enum": [
              "endpoint",
              "accept",
              "report",
              "hold",
              "reject"
            ],
            "type": "string"
          },
          "plus_addressing": {
            "type": "boolean"
          },
          "spam_mode": {
            "description": "Spam above spam_threshold is delivered (mark), held until released (hold; the route needs an endpoint), or refused with 550 5.7.1 (reject)",
            "enum": [
              "mark",
              "hold",
              "reject"
            ],
            "type": "string"
          },
          "spam_threshold": {
            "description": "The spam score from which this route calls a message spam",
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          }
        },
        "title": "UpdateInboundRouteRequest",
        "type": "object"
      },
      "InboundScanVirus": {
        "description": "What the virus scanner said.",
        "properties": {
          "name": {
            "description": "The signature of an infected message",
            "type": "string"
          },
          "reason": {
            "description": "Why a scanner did not answer",
            "type": "string"
          },
          "status": {
            "enum": [
              "clean",
              "infected",
              "unavailable",
              "too_large",
              "disabled"
            ],
            "type": "string"
          }
        },
        "required": [
          "status"
        ],
        "title": "InboundScanVirus",
        "type": "object"
      },
      "WebhookDelivery": {
        "description": "One event for one webhook, and where its sending stands.",
        "properties": {
          "attempts": {
            "description": "Requests made since it was queued or replayed",
            "minimum": 0,
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_id": {
            "description": "The webhook-id header of its requests",
            "format": "uuid",
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_status": {
            "description": "The HTTP status of the last answer",
            "type": "integer"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "event_id",
          "event_type",
          "occurred_at",
          "state",
          "attempts",
          "created_at"
        ],
        "title": "WebhookDelivery",
        "type": "object"
      },
      "RotateWebhookSecretRequest": {
        "additionalProperties": false,
        "properties": {
          "keep_previous_for": {
            "default": 86400,
            "description": "Seconds the previous secret keeps signing too (0: not at all)",
            "maximum": 604800,
            "minimum": 0,
            "type": "integer"
          }
        },
        "title": "RotateWebhookSecretRequest",
        "type": "object"
      },
      "InboundEndpoint": {
        "description": "Where received mail goes: an HTTP URL, an SMTP server or addresses it is forwarded to. A signing secret is shown only when it is made.",
        "properties": {
          "addresses": {
            "description": "address: where mail is forwarded",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "auth_header": {
            "description": "http: an extra header sent with every request (beside the format's signature), for a receiver that cannot check a signature. https only, except where the instance allows http; it does not protect the body's integrity or a request sent again.",
            "type": "string"
          },
          "auth_header_value": {
            "description": "http: the extra header's secret value, shown once in the answer that sets it and never by a read",
            "type": "string"
          },
          "basic_auth_user": {
            "description": "http: the user name sent as Basic authentication (the password is never shown)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "encoding": {
            "description": "postal and postal_hash: JSON or form data; mailgun: form data, raw MIME, or JSON",
            "enum": [
              "json",
              "form",
              "mime"
            ],
            "type": "string"
          },
          "format": {
            "description": "http: Karta's JSON, the message itself, Postal's RawMessage or Hash, a Mailgun route's post, SendGrid's Inbound Parse, or Postmark's inbound webhook",
            "enum": [
              "karta",
              "raw",
              "postal",
              "postal_hash",
              "mailgun",
              "sendgrid",
              "postmark"
            ],
            "type": "string"
          },
          "host": {
            "description": "smtp: the server's host name or address",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "http",
              "smtp",
              "address"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "tls": {
            "enum": [
              "opportunistic",
              "encrypted",
              "verified"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "http: without the user name and password it was given with",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "created_at",
          "updated_at"
        ],
        "title": "InboundEndpoint",
        "type": "object"
      },
      "InboundScanSpam": {
        "description": "What the spam scanner said: scanned (with the score and rspamd's symbols), or why it did not.",
        "properties": {
          "action": {
            "description": "rspamd's action, or \"unknown\"",
            "type": "string"
          },
          "is_spam": {
            "description": "The score reached the threshold of at least one of the message's routes",
            "type": "boolean"
          },
          "reason": {
            "description": "Why a scanner did not answer",
            "type": "string"
          },
          "required_score": {
            "type": "number"
          },
          "score": {
            "type": "number"
          },
          "status": {
            "enum": [
              "scanned",
              "unavailable",
              "too_large",
              "disabled"
            ],
            "type": "string"
          },
          "symbols": {
            "items": {
              "$ref": "#/components/schemas/InboundScanSymbol"
            },
            "type": "array"
          }
        },
        "required": [
          "status"
        ],
        "title": "InboundScanSpam",
        "type": "object"
      },
      "NewCredential": {
        "description": "A credential just created, with its secret: shown this once.",
        "properties": {
          "cidr": {
            "description": "The address range (IP range credentials): the network address and prefix, e.g. 10.20.0.0/16",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "key": {
            "description": "The API key",
            "type": "string"
          },
          "kind": {
            "enum": [
              "api",
              "smtp",
              "ip"
            ],
            "type": "string"
          },
          "last_used_at": {
            "format": "date-time",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "password": {
            "description": "The SMTP password",
            "type": "string"
          },
          "prefix": {
            "description": "Identifies the credential: an API key reads karta_<prefix>_...",
            "type": "string"
          },
          "rate_limit_per_minute": {
            "minimum": 1,
            "type": "integer"
          },
          "revoked_at": {
            "format": "date-time",
            "type": "string"
          },
          "scopes": {
            "items": {
              "enum": [
                "messages:send",
                "messages:read",
                "messages:manage",
                "suppressions:read",
                "suppressions:write",
                "credentials:read",
                "credentials:write",
                "webhooks:read",
                "webhooks:write",
                "routes:read",
                "routes:write",
                "messages:list",
                "messages:delete",
                "messages:raw",
                "domains:read"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "tls_required": {
            "description": "Whether a client in the range must connect over TLS (IP range credentials)",
            "type": "boolean"
          },
          "username": {
            "description": "The SMTP user name (SMTP credentials)",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "created_at"
        ],
        "title": "NewCredential",
        "type": "object"
      },
      "PostalSigningKey": {
        "description": "The organisation's key that signs its requests in Postal's format (its webhooks and inbound HTTP endpoints). Only public values are shown; the private key never is.",
        "properties": {
          "bits": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "dns_record": {
            "description": "The public key in Postal's DNS record form",
            "type": "string"
          },
          "jwk": {
            "additionalProperties": true,
            "description": "The active key as a public JWK (RS256)",
            "type": "object"
          },
          "jwks_url": {
            "description": "The organisation's JWK set: the active key and those retired in the last week",
            "type": "string"
          },
          "kid": {
            "description": "The key's id, sent as X-Postal-Signature-KID",
            "type": "string"
          }
        },
        "required": [
          "kid",
          "bits",
          "jwks_url",
          "jwk",
          "dns_record"
        ],
        "title": "PostalSigningKey",
        "type": "object"
      },
      "UpdateInboundEndpointRequest": {
        "additionalProperties": false,
        "description": "Only the fields given change (not the kind or the format). A URL given replaces the user name and password.",
        "properties": {
          "addresses": {
            "items": {
              "maxLength": 320,
              "type": "string"
            },
            "maxItems": 10,
            "minItems": 1,
            "type": "array"
          },
          "auth_header": {
            "description": "http: an extra header sent with every request, beside the format's signature (an HTTP token; reserved names are refused)",
            "maxLength": 100,
            "type": "string"
          },
          "auth_header_remove": {
            "default": false,
            "description": "http: remove the extra header and its value (cannot go with a header or a value)",
            "type": "boolean"
          },
          "auth_header_value": {
            "description": "http: the header's secret value (printable ASCII); shown once, in this answer",
            "maxLength": 1024,
            "type": "string"
          },
          "encoding": {
            "description": "postal and postal_hash: json (default) or form; mailgun: form (default), mime (the raw message), or json",
            "enum": [
              "json",
              "form",
              "mime"
            ],
            "type": "string"
          },
          "host": {
            "maxLength": 255,
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "port": {
            "description": "smtp: default 25",
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "tls": {
            "description": "smtp: STARTTLS when offered (default), required, or required with a certificate valid for the host",
            "enum": [
              "opportunistic",
              "encrypted",
              "verified"
            ],
            "type": "string"
          },
          "url": {
            "description": "http: https (http only where the instance allows it); a user name and password in it (https only) are sent as Basic authentication",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "title": "UpdateInboundEndpointRequest",
        "type": "object"
      },
      "Webhook": {
        "description": "Where the server's events are sent, and in which format. The signing secret is shown only when it is made; in SendGrid's format the public key is shown instead, always.",
        "properties": {
          "auth_header": {
            "description": "An extra header sent with every request (beside the format's signature), for a receiver that cannot check a signature. https only, except where the instance allows http; it does not protect the body's integrity or a request sent again.",
            "type": "string"
          },
          "auth_header_value": {
            "description": "The extra header's secret value: shown once, in the answer that sets it, and never by a read",
            "type": "string"
          },
          "basic_auth_user": {
            "description": "The user name sent as Basic authentication (the password is never shown)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled_reason": {
            "description": "Why Karta switched the webhook off",
            "enum": [
              "failing"
            ],
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "description": "The event types sent; [\"*\"] for every type, those added later too. One of: domain.dns_failed, message.accepted, message.bounced, message.clicked, message.complained, message.deferred, message.delivered, message.opened, message.suppressed, message.unsubscribed",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "failing_since": {
            "description": "Since when every request has failed",
            "format": "date-time",
            "type": "string"
          },
          "format": {
            "description": "standard: Standard Webhooks; postal, mailgun, sendgrid, postmark: those providers' webhooks",
            "enum": [
              "standard",
              "postal",
              "mailgun",
              "sendgrid",
              "postmark"
            ],
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "previous_secret_expires_at": {
            "description": "Until when the secret before the last rotation signs too",
            "format": "date-time",
            "type": "string"
          },
          "public_key": {
            "description": "sendgrid: the public key that verifies the requests' signatures (base64, as SendGrid shows its verification key)",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "Without the user name and password it was given with",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "url",
          "format",
          "events",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "title": "Webhook",
        "type": "object"
      },
      "BatchRecipient": {
        "additionalProperties": false,
        "description": "One message of a batch: its recipient, replacements and variables.",
        "properties": {
          "replacements": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "A value for each {{name}} in the subject, text and HTML: names of 1 to 64 ASCII letters, digits, _ or -; tabs and line breaks only as control characters (none in the subject); escaped in the HTML",
            "maxProperties": 100,
            "type": "object"
          },
          "to": {
            "description": "The message's only recipient (To)",
            "type": "string"
          },
          "variables": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Added to the batch's variables, over those of the same name",
            "type": "object"
          }
        },
        "required": [
          "to"
        ],
        "title": "BatchRecipient",
        "type": "object"
      },
      "InboundMessage": {
        "description": "A received message, with a delivery per recipient.",
        "properties": {
          "authentication": {
            "$ref": "#/components/schemas/InboundAuthentication"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/InboundDelivery"
            },
            "type": "array"
          },
          "from": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "mail_from": {
            "description": "The envelope sender; empty for a bounce",
            "type": "string"
          },
          "message_id": {
            "type": "string"
          },
          "rcpt_to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "scan": {
            "$ref": "#/components/schemas/InboundScan"
          },
          "size": {
            "type": "integer"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "mail_from",
          "rcpt_to",
          "size",
          "created_at",
          "deliveries"
        ],
        "title": "InboundMessage",
        "type": "object"
      },
      "WebhookDeliveryList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "type": "array"
          },
          "next": {
            "description": "When there may be more: pass it as `before` for the next page",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "data"
        ],
        "title": "WebhookDeliveryList",
        "type": "object"
      },
      "CreateCredentialRequest": {
        "additionalProperties": false,
        "description": "A new API key may have only scopes the calling key has (default: messages:send and messages:read); an SMTP credential or IP range can send mail, so creating one needs messages:send. The name has at most 100 characters. An IP range is at most as wide as the instance allows (by default /16 of IPv4 or /48 of IPv6) and never the whole address space.",
        "properties": {
          "cidr": {
            "description": "The address range (IP range credentials), in CIDR notation",
            "type": "string"
          },
          "kind": {
            "enum": [
              "api",
              "smtp",
              "ip"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "rate_limit_per_minute": {
            "minimum": 1,
            "type": "integer"
          },
          "scopes": {
            "items": {
              "enum": [
                "messages:send",
                "messages:read",
                "messages:manage",
                "suppressions:read",
                "suppressions:write",
                "credentials:read",
                "credentials:write",
                "webhooks:read",
                "webhooks:write",
                "routes:read",
                "routes:write",
                "messages:list",
                "messages:delete",
                "messages:raw",
                "domains:read"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "tls_required": {
            "description": "Whether a client in the range must connect over TLS; default true",
            "type": "boolean"
          }
        },
        "required": [
          "kind",
          "name"
        ],
        "title": "CreateCredentialRequest",
        "type": "object"
      },
      "InboundEndpointList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/InboundEndpoint"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "InboundEndpointList",
        "type": "object"
      },
      "WebhookList": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Webhook"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "title": "WebhookList",
        "type": "object"
      },
      "Delivery": {
        "description": "One delivery attempt for one recipient.",
        "properties": {
          "attempt": {
            "type": "integer"
          },
          "code": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "enhanced": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "mx_host": {
            "type": "string"
          },
          "recipient_id": {
            "format": "uuid",
            "type": "string"
          },
          "remote_ip": {
            "type": "string"
          },
          "status": {
            "enum": [
              "delivered",
              "deferred",
              "bounced"
            ],
            "type": "string"
          },
          "tls_cipher": {
            "type": "string"
          },
          "tls_version": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "recipient_id",
          "attempt",
          "status",
          "created_at"
        ],
        "title": "Delivery",
        "type": "object"
      },
      "Event": {
        "description": "An open (the tracking pixel was loaded) or a click on a tracked link.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "ip_address": {
            "description": "The client's network: an IPv4 /24 or an IPv6 /48, not its address",
            "type": "string"
          },
          "kind": {
            "enum": [
              "open",
              "click"
            ],
            "type": "string"
          },
          "recipient_id": {
            "format": "uuid",
            "type": "string"
          },
          "url": {
            "description": "The link clicked (clicks only)",
            "type": "string"
          },
          "user_agent": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "recipient_id",
          "created_at"
        ],
        "title": "Event",
        "type": "object"
      },
      "NewInboundEndpoint": {
        "description": "An endpoint with its signing secret, shown this once (HTTP endpoints in Karta's formats and Mailgun's; Postal's formats are signed with the key of the endpoint's organisation).",
        "properties": {
          "addresses": {
            "description": "address: where mail is forwarded",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "auth_header": {
            "description": "http: an extra header sent with every request (beside the format's signature), for a receiver that cannot check a signature. https only, except where the instance allows http; it does not protect the body's integrity or a request sent again.",
            "type": "string"
          },
          "auth_header_value": {
            "description": "http: the extra header's secret value, shown once in the answer that sets it and never by a read",
            "type": "string"
          },
          "basic_auth_user": {
            "description": "http: the user name sent as Basic authentication (the password is never shown)",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "encoding": {
            "description": "postal and postal_hash: JSON or form data; mailgun: form data, raw MIME, or JSON",
            "enum": [
              "json",
              "form",
              "mime"
            ],
            "type": "string"
          },
          "format": {
            "description": "http: Karta's JSON, the message itself, Postal's RawMessage or Hash, a Mailgun route's post, SendGrid's Inbound Parse, or Postmark's inbound webhook",
            "enum": [
              "karta",
              "raw",
              "postal",
              "postal_hash",
              "mailgun",
              "sendgrid",
              "postmark"
            ],
            "type": "string"
          },
          "host": {
            "description": "smtp: the server's host name or address",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "http",
              "smtp",
              "address"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "secret": {
            "description": "whsec_ and the base64 of the key (Standard Webhooks)",
            "type": "string"
          },
          "tls": {
            "enum": [
              "opportunistic",
              "encrypted",
              "verified"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "http: without the user name and password it was given with",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "created_at",
          "updated_at"
        ],
        "title": "NewInboundEndpoint",
        "type": "object"
      },
      "WebhookDeliveryDetail": {
        "properties": {
          "attempts": {
            "description": "Requests made since it was queued or replayed",
            "minimum": 0,
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "event_id": {
            "description": "The webhook-id header of its requests",
            "format": "uuid",
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_status": {
            "description": "The HTTP status of the last answer",
            "type": "integer"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "occurred_at": {
            "format": "date-time",
            "type": "string"
          },
          "payload": {
            "description": "The body of its requests; in Mailgun's format without the signature, made for each request",
            "type": "string"
          },
          "requests": {
            "items": {
              "$ref": "#/components/schemas/WebhookRequest"
            },
            "type": "array"
          },
          "state": {
            "enum": [
              "pending",
              "succeeded",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "event_id",
          "event_type",
          "occurred_at",
          "state",
          "attempts",
          "created_at",
          "payload",
          "requests"
        ],
        "title": "WebhookDeliveryDetail",
        "type": "object"
      },
      "CreateInboundEndpointRequest": {
        "additionalProperties": false,
        "description": "The kind, and an HTTP endpoint's format, cannot be changed later.",
        "properties": {
          "addresses": {
            "items": {
              "maxLength": 320,
              "type": "string"
            },
            "maxItems": 10,
            "minItems": 1,
            "type": "array"
          },
          "auth_header": {
            "description": "http: an extra header sent with every request, beside the format's signature (an HTTP token; reserved names are refused)",
            "maxLength": 100,
            "type": "string"
          },
          "auth_header_remove": {
            "default": false,
            "description": "http: remove the extra header and its value (cannot go with a header or a value)",
            "type": "boolean"
          },
          "auth_header_value": {
            "description": "http: the header's secret value (printable ASCII); shown once, in this answer",
            "maxLength": 1024,
            "type": "string"
          },
          "encoding": {
            "description": "postal and postal_hash: json (default) or form; mailgun: form (default), mime (the raw message), or json",
            "enum": [
              "json",
              "form",
              "mime"
            ],
            "type": "string"
          },
          "format": {
            "default": "karta",
            "enum": [
              "karta",
              "raw",
              "postal",
              "postal_hash",
              "mailgun",
              "sendgrid",
              "postmark"
            ],
            "type": "string"
          },
          "host": {
            "maxLength": 255,
            "type": "string"
          },
          "kind": {
            "enum": [
              "http",
              "smtp",
              "address"
            ],
            "type": "string"
          },
          "name": {
            "maxLength": 200,
            "type": "string"
          },
          "port": {
            "description": "smtp: default 25",
            "maximum": 65535,
            "minimum": 1,
            "type": "integer"
          },
          "tls": {
            "description": "smtp: STARTTLS when offered (default), required, or required with a certificate valid for the host",
            "enum": [
              "opportunistic",
              "encrypted",
              "verified"
            ],
            "type": "string"
          },
          "url": {
            "description": "http: https (http only where the instance allows it); a user name and password in it (https only) are sent as Basic authentication",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "required": [
          "name",
          "kind"
        ],
        "title": "CreateInboundEndpointRequest",
        "type": "object"
      },
      "UpdateWebhookRequest": {
        "additionalProperties": false,
        "description": "Only the fields given change (not the format). Switching a webhook on again clears why it was off. A URL given replaces the user name and password.",
        "properties": {
          "auth_header": {
            "description": "An extra header sent with every request, beside the format's signature (an HTTP token; reserved names are refused)",
            "maxLength": 100,
            "type": "string"
          },
          "auth_header_remove": {
            "default": false,
            "description": "Remove the extra header and its value (cannot go with a header or a value)",
            "type": "boolean"
          },
          "auth_header_value": {
            "description": "The header's secret value (printable ASCII); it is shown once, in this answer",
            "maxLength": 1024,
            "type": "string"
          },
          "enabled": {
            "default": true,
            "type": "boolean"
          },
          "events": {
            "description": "The event types to send (those the format has); [\"*\"] (the default) for every type the format has. A name outside the first list is accepted only for the optional modules that add events, while they are on",
            "items": {
              "anyOf": [
                {
                  "enum": [
                    "*",
                    "domain.dns_failed",
                    "message.accepted",
                    "message.bounced",
                    "message.clicked",
                    "message.complained",
                    "message.deferred",
                    "message.delivered",
                    "message.opened",
                    "message.suppressed",
                    "message.unsubscribed"
                  ],
                  "type": "string"
                },
                {
                  "pattern": "^messaging\\.[a-z_.]+$",
                  "type": "string"
                }
              ]
            },
            "minItems": 1,
            "type": "array"
          },
          "name": {
            "maxLength": 100,
            "type": "string"
          },
          "url": {
            "description": "https (http only where the instance allows it); a user name and password in it (https only) are sent as Basic authentication",
            "maxLength": 2000,
            "type": "string"
          }
        },
        "title": "UpdateWebhookRequest",
        "type": "object"
      },
      "ReplayWebhookResult": {
        "properties": {
          "count": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "count"
        ],
        "title": "ReplayWebhookResult",
        "type": "object"
      },
      "CreateInboundRouteRequest": {
        "additionalProperties": false,
        "properties": {
          "dmarc_reject": {
            "default": true,
            "description": "Refuse mail that fails DMARC for an author domain whose policy is reject; false: accept it, marked as failing",
            "type": "boolean"
          },
          "domain": {
            "description": "A verified domain of the server's organisation; it cannot be changed later",
            "maxLength": 255,
            "type": "string"
          },
          "endpoint_id": {
            "description": "mode endpoint: an endpoint of the server",
            "format": "uuid",
            "type": "string"
          },
          "fail_closed": {
            "default": true,
            "description": "A scanner that cannot answer refuses the message with 451 4.7.1 (the default); false accepts it, marked",
            "type": "boolean"
          },
          "local_part": {
            "description": "Letters, digits, '.', '_' and '-' (no '+'); * for every other address of the domain",
            "maxLength": 64,
            "type": "string"
          },
          "mode": {
            "default": "endpoint",
            "enum": [
              "endpoint",
              "accept",
              "report",
              "hold",
              "reject"
            ],
            "type": "string"
          },
          "plus_addressing": {
            "default": true,
            "type": "boolean"
          },
          "spam_mode": {
            "default": "mark",
            "description": "Spam above spam_threshold is delivered (mark), held until released (hold; the route needs an endpoint), or refused with 550 5.7.1 (reject)",
            "enum": [
              "mark",
              "hold",
              "reject"
            ],
            "type": "string"
          },
          "spam_threshold": {
            "default": 6.0,
            "description": "The spam score from which this route calls a message spam",
            "maximum": 100,
            "minimum": 0,
            "type": "number"
          }
        },
        "required": [
          "domain",
          "local_part"
        ],
        "title": "CreateInboundRouteRequest",
        "type": "object"
      },
      "Recipient": {
        "properties": {
          "address": {
            "type": "string"
          },
          "attempts": {
            "minimum": 0,
            "type": "integer"
          },
          "clicks": {
            "description": "Clicks recorded (in a message read back, not in a send answer)",
            "minimum": 0,
            "type": "integer"
          },
          "held": {
            "description": "True while an operator holds the recipient: nothing is sent until it is released",
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_code": {
            "type": "integer"
          },
          "last_details": {
            "type": "string"
          },
          "last_enhanced": {
            "type": "string"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "opens": {
            "description": "Opens recorded (in a message read back, not in a send answer)",
            "minimum": 0,
            "type": "integer"
          },
          "status": {
            "enum": [
              "queued",
              "deferred",
              "delivered",
              "bounced",
              "suppressed",
              "cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "address",
          "status",
          "attempts"
        ],
        "title": "Recipient",
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearer": {
        "description": "An API key of a mail server: karta_<prefix>_<secret>",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The OpenAPI 3.1 document of `/api/v2`, built from the operations of the\nv2 controllers (`OpenApiSpex.ControllerSpecs`) and served at\n`/api/v2/openapi.json`. Every request is cast and validated against it\n(`OpenApiSpex.Plug.CastAndValidate`), and the tests check every answer\nagainst it.\n\nRequests are authenticated with an API key of a mail server:\n`Authorization: Bearer karta_...`. Each operation needs a scope of the\nkey (`messages:send`, `messages:read`, `credentials:read`,\n`credentials:write`, `suppressions:read`, `suppressions:write`,\n`webhooks:read`, `webhooks:write`, `routes:read`, `routes:write`).\nEverything is scoped to the key's server.\n",
    "title": "Karta API",
    "version": "2"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v2/credentials": {
      "get": {
        "callbacks": {},
        "operationId": "listCredentials",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialList"
                }
              }
            },
            "description": "The credentials"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The server's credentials, revoked ones included",
        "tags": [
          "Credentials"
        ]
      },
      "post": {
        "callbacks": {},
        "operationId": "createCredential",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCredentialRequest"
              }
            }
          },
          "description": "The credential",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewCredential"
                }
              }
            },
            "description": "Created; the secret is shown this once"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an API key, SMTP credential or IP range",
        "tags": [
          "Credentials"
        ]
      }
    },
    "/api/v2/credentials/{id}": {
      "delete": {
        "callbacks": {},
        "operationId": "revokeCredential",
        "parameters": [
          {
            "description": "The credential id",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Credential"
                }
              }
            },
            "description": "The revoked credential"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Revoke a credential",
        "tags": [
          "Credentials"
        ]
      }
    },
    "/api/v2/endpoints": {
      "get": {
        "callbacks": {},
        "operationId": "listInboundEndpoints",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEndpointList"
                }
              }
            },
            "description": "The endpoints"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The server's endpoints",
        "tags": [
          "Receiving mail"
        ]
      },
      "post": {
        "callbacks": {},
        "operationId": "createInboundEndpoint",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInboundEndpointRequest"
              }
            }
          },
          "description": "The endpoint",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewInboundEndpoint"
                }
              }
            },
            "description": "Added; a secret is shown this once"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an endpoint",
        "tags": [
          "Receiving mail"
        ]
      }
    },
    "/api/v2/endpoints/{id}": {
      "delete": {
        "callbacks": {},
        "operationId": "deleteInboundEndpoint",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an endpoint no route uses",
        "tags": [
          "Receiving mail"
        ]
      },
      "get": {
        "callbacks": {},
        "operationId": "getInboundEndpoint",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEndpoint"
                }
              }
            },
            "description": "The endpoint"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "An endpoint",
        "tags": [
          "Receiving mail"
        ]
      },
      "patch": {
        "callbacks": {},
        "operationId": "updateInboundEndpoint",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInboundEndpointRequest"
              }
            }
          },
          "description": "What changes",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundEndpoint"
                }
              }
            },
            "description": "The endpoint"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an endpoint",
        "tags": [
          "Receiving mail"
        ]
      }
    },
    "/api/v2/inbound/messages/{id}": {
      "get": {
        "callbacks": {},
        "operationId": "getInboundMessage",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundMessage"
                }
              }
            },
            "description": "The message"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "A received message, and what became of each recipient",
        "tags": [
          "Receiving mail"
        ]
      }
    },
    "/api/v2/inbound/messages/{id}/release": {
      "post": {
        "callbacks": {},
        "operationId": "releaseInboundMessage",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundMessage"
                }
              }
            },
            "description": "The message, with its deliveries queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Release the held deliveries of a received message",
        "tags": [
          "Receiving mail"
        ]
      }
    },
    "/api/v2/messages": {
      "post": {
        "callbacks": {},
        "operationId": "sendMessage",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendRequest"
              }
            }
          },
          "description": "The message",
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentMessage"
                }
              }
            },
            "description": "Accepted and queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Temporary failure; try again later"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a message built from its parts",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/batch": {
      "post": {
        "callbacks": {},
        "operationId": "sendBatch",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          },
          "description": "The messages",
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentBatch"
                }
              }
            },
            "description": "All accepted and queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Temporary failure; try again later"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send one message per recipient, with replacements",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/raw": {
      "post": {
        "callbacks": {},
        "operationId": "sendRawMessage",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawRequest"
              }
            }
          },
          "description": "The message",
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SentMessage"
                }
              }
            },
            "description": "Accepted and queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Temporary failure; try again later"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a message given whole",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}": {
      "get": {
        "callbacks": {},
        "operationId": "getMessage",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "The message"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "A message and the state of each recipient",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}/cancel": {
      "post": {
        "callbacks": {},
        "description": "Cancels the recipients of a message sent with a time to send that have not been tried; they are never sent.",
        "operationId": "cancelMessage",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "The message after the action"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a scheduled message",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}/deliveries": {
      "get": {
        "callbacks": {},
        "operationId": "listMessageDeliveries",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryList"
                }
              }
            },
            "description": "The attempts, oldest first"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The delivery attempts of a message",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}/events": {
      "get": {
        "callbacks": {},
        "operationId": "listMessageEvents",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Continue after this event",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventList"
                }
              }
            },
            "description": "A page of events"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The opens and clicks of a message, oldest first",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}/hold": {
      "post": {
        "callbacks": {},
        "description": "Nothing is sent to a held recipient until the message is released. A delivery already in progress finishes.",
        "operationId": "holdMessage",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "The message after the action"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Hold a message that is still to be delivered",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}/release": {
      "post": {
        "callbacks": {},
        "description": "Releases the held recipients and queues their delivery.",
        "operationId": "releaseMessage",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "The message after the action"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Release a held message",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/messages/{id}/retry": {
      "post": {
        "callbacks": {},
        "description": "Makes the recipients that are queued or deferred, not held and not being sent, due now. Delivered, bounced, suppressed and cancelled recipients are not touched.",
        "operationId": "retryMessage",
        "parameters": [
          {
            "description": "The message id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "The message after the action"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Try the recipients that wait for a later attempt now",
        "tags": [
          "Messages"
        ]
      }
    },
    "/api/v2/postal-key": {
      "get": {
        "callbacks": {},
        "operationId": "getPostalSigningKey",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PostalSigningKey"
                }
              }
            },
            "description": "The key (public values only)"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The organisation's key that signs requests in Postal's format",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/routes": {
      "get": {
        "callbacks": {},
        "operationId": "listInboundRoutes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundRouteList"
                }
              }
            },
            "description": "The routes"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The server's routes",
        "tags": [
          "Receiving mail"
        ]
      },
      "post": {
        "callbacks": {},
        "operationId": "createInboundRoute",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInboundRouteRequest"
              }
            }
          },
          "description": "The route",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundRoute"
                }
              }
            },
            "description": "Added"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a route",
        "tags": [
          "Receiving mail"
        ]
      }
    },
    "/api/v2/routes/{id}": {
      "delete": {
        "callbacks": {},
        "operationId": "deleteInboundRoute",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a route",
        "tags": [
          "Receiving mail"
        ]
      },
      "get": {
        "callbacks": {},
        "operationId": "getInboundRoute",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundRoute"
                }
              }
            },
            "description": "The route"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "A route",
        "tags": [
          "Receiving mail"
        ]
      },
      "patch": {
        "callbacks": {},
        "operationId": "updateInboundRoute",
        "parameters": [
          {
            "description": "The id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateInboundRouteRequest"
              }
            }
          },
          "description": "What changes",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InboundRoute"
                }
              }
            },
            "description": "The route"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a route",
        "tags": [
          "Receiving mail"
        ]
      }
    },
    "/api/v2/suppression-policy": {
      "get": {
        "callbacks": {},
        "operationId": "getSuppressionPolicy",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionPolicy"
                }
              }
            },
            "description": "The policy"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The server's suppression policy",
        "tags": [
          "Suppressions"
        ]
      },
      "put": {
        "callbacks": {},
        "operationId": "putSuppressionPolicy",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SuppressionPolicy"
              }
            }
          },
          "description": "The whole policy",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionPolicy"
                }
              }
            },
            "description": "The policy"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set the server's suppression policy",
        "tags": [
          "Suppressions"
        ]
      }
    },
    "/api/v2/suppressions": {
      "get": {
        "callbacks": {},
        "operationId": "listSuppressions",
        "parameters": [
          {
            "description": "",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Continue after this address",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SuppressionList"
                }
              }
            },
            "description": "A page of entries"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The suppression list, by address",
        "tags": [
          "Suppressions"
        ]
      },
      "post": {
        "callbacks": {},
        "operationId": "createSuppression",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSuppressionRequest"
              }
            }
          },
          "description": "The entry",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suppression"
                }
              }
            },
            "description": "Updated"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suppression"
                }
              }
            },
            "description": "Added"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an address, or update its entry",
        "tags": [
          "Suppressions"
        ]
      }
    },
    "/api/v2/suppressions/{address}": {
      "delete": {
        "callbacks": {},
        "operationId": "deleteSuppression",
        "parameters": [
          {
            "description": "The address",
            "in": "path",
            "name": "address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an address",
        "tags": [
          "Suppressions"
        ]
      },
      "get": {
        "callbacks": {},
        "operationId": "getSuppression",
        "parameters": [
          {
            "description": "The address",
            "in": "path",
            "name": "address",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Suppression"
                }
              }
            },
            "description": "The entry"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The entry for an address",
        "tags": [
          "Suppressions"
        ]
      }
    },
    "/api/v2/webhooks": {
      "get": {
        "callbacks": {},
        "operationId": "listWebhooks",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            },
            "description": "The webhooks"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "The server's webhooks",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "callbacks": {},
        "operationId": "createWebhook",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookRequest"
              }
            }
          },
          "description": "The webhook",
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewWebhookSecret"
                }
              }
            },
            "description": "Added; the secret is shown this once"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a webhook",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}": {
      "delete": {
        "callbacks": {},
        "operationId": "deleteWebhook",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a webhook with its deliveries",
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "callbacks": {},
        "operationId": "getWebhook",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "The webhook"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "A webhook",
        "tags": [
          "Webhooks"
        ]
      },
      "patch": {
        "callbacks": {},
        "operationId": "updateWebhook",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookRequest"
              }
            }
          },
          "description": "What changes",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Webhook"
                }
              }
            },
            "description": "The webhook"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a webhook, or switch it off or on",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}/deliveries": {
      "get": {
        "callbacks": {},
        "operationId": "listWebhookDeliveries",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "",
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "enum": [
                "pending",
                "succeeded",
                "failed"
              ],
              "type": "string"
            }
          },
          {
            "description": "",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Continue after this delivery",
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            },
            "description": "A page of deliveries"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "A webhook's deliveries, newest first",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}/deliveries/{delivery_id}": {
      "get": {
        "callbacks": {},
        "operationId": "getWebhookDelivery",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The delivery id",
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDetail"
                }
              }
            },
            "description": "The delivery"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "A delivery, the body it sends and every request made for it",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}/deliveries/{delivery_id}/replay": {
      "post": {
        "callbacks": {},
        "operationId": "replayWebhookDelivery",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The delivery id",
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            },
            "description": "Queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a delivery again",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}/replay": {
      "post": {
        "callbacks": {},
        "operationId": "replayWebhookDeliveries",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayWebhookRequest"
              }
            }
          },
          "description": "Which deliveries",
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplayWebhookResult"
                }
              }
            },
            "description": "Queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a webhook's deliveries again: those that failed, in a time range",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}/secret": {
      "post": {
        "callbacks": {},
        "operationId": "rotateWebhookSecret",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateWebhookSecretRequest"
              }
            }
          },
          "description": "How long the previous secret signs too",
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewWebhookSecret"
                }
              }
            },
            "description": "The new secret, shown this once (in SendGrid's format, a new key pair: its public key)"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is invalid"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Give a webhook a new signing secret",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/api/v2/webhooks/{id}/test": {
      "post": {
        "callbacks": {},
        "operationId": "sendWebhookTest",
        "parameters": [
          {
            "description": "The webhook id (a UUID)",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            },
            "description": "Queued"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key, or an invalid one"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The key lacks a scope, or the server is suspended"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not possible in the record's present state"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Rate limit exceeded; see Retry-After"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a webhook.test event to this webhook",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "security": [],
  "servers": [],
  "tags": []
}
