openapi: 3.1.0
info:
  title: Mailgun API
  description: Mailgun API defined by OpenAPI Specification (OAS) 3.1.0
  version: 3.0.0
servers:
  - url: https://api.mailgun.net
    description: US Mailgun
  - url: https://api.eu.mailgun.net
    description: EU Mailgun
tags:
  - name: Messages
    description: >-
      Send email two ways via our REST API:

      1. Send emails using MIME format using a MIME building library

      2. Submit the individual parts (Text, html, attachments, etc.)


      Reminder: You can also send email via SMTP with Mailgun. Please reference
      the user manual.
    x-displayName: Messages
  - name: Domain Tracking
    description: >-
      Mailgun offers tracking for clicks, unsubscribes, and opens, with optional
      HTTPS protocol support on tracking URLs. To enable HTTPS, Mailgun uses
      Let’s Encrypt with HTTP-01 challenges through your existing tracking CNAME
      record to issue a TLS certificate. This setup also includes support for
      HTTP Strict Transport Security (HSTS) for enhanced security.
    x-displayName: Domain Tracking
  - name: Domain Keys
    description: An authentication standard used to prevent email spoofing.
    x-displayName: Domain Keys
  - name: Domains
    description: Domains API manages domains, domain keys and DNS verification.
    x-displayName: Domains
  - name: Webhooks
    description: >-
      Webhooks API manages domain's webhooks. You can create, access and delete
      webhooks programmatically.
    x-displayName: Webhooks
  - name: DKIM Security
    description: >-
      Automatic Sender Security DKIM Key APIs. To enable this feature please see
      'Update a domain' API docs.
    x-displayName: DKIM Security
  - name: IPs
    description: >-
      The IP API endpoint allows you to access information regarding the IPs
      allocated to your Mailgun account that are used for outbound sending.
    x-displayName: IPs
  - name: IP Pools
    description: >-
      IP Pools allow you to group your dedicated IPs into customized "pools" to
      help manage your sending reputation for different mail sending streams.
    x-displayName: IP Pools
  - name: Dynamic IP Pools
    description: >-
      Dynamic IP Pools allow you to group your dedicated IPs into customized
      "pools" based on sender reputation. Domains enrolled in Dynamic IP Pools
      will be assigned to a pool based on the result of periodic health checks.
    x-displayName: Dynamic IP Pools
  - name: openapi-tower_other
    x-displayName: other
  - name: IP Address Warmup
    x-displayName: IP Address Warmup
  - name: Events
    description: >-
      Mailgun keeps track of every inbound and outbound message event and stores
      this data for at least 3 days.<br><br>WARNING:<i> This API is deprecated
      in favor of our
      [Logs](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Logs/)
      API. </i>
    x-displayName: Events
  - name: Tags
    description: >-
      Mailgun lets you tag each outgoing message with a custom value. When you
      access stats on your messages, they will be aggregated by these
      tags.<br><br>WARNING:<i> This API is deprecated in favor of our new
      [Tags](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Tags-New/)
      API. </i>
    x-displayName: Tags
  - name: Stats
    description: >-
      Mailgun collects many different events and generates event statistics
      which are available in your Control Panel. This data is also available via
      our stats API endpoint.<br><br>WARNING:<i> This API is deprecated in favor
      of our
      [Metrics](https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Metrics/)
      API. </i>
    x-displayName: Stats
  - name: openapi-scout_other
    x-displayName: other
  - name: Metrics
    description: >-
      Mailgun collects many different events and generates event metrics which
      are available in your Control Panel. This data is also available via our
      analytics metrics API endpoint.
    x-displayName: Metrics
  - name: Logs
    description: >-
      Mailgun keeps track of every inbound and outbound message event and stores
      this log data. This data can be queried and filtered to provide insights
      into the health of your email infrastructure.
    x-displayName: Logs
  - name: Tags New
    description: >-
      Mailgun allows you to tag your email with unique identifiers. Tags are
      visible via our analytics tags API endpoint.
    x-displayName: Tags New
  - name: Unsubscribe
    description: >-
      Unsubscribe list stores email addresses of recipients who unsubscribed
      from your mailings by clicking a Mailgun generated unsubscribe link.
    x-displayName: Unsubscribe
  - name: Complaints
    description: >-
      Email addresses of recipients who marked your messages as a spam (for ESPs
      that support FBL).
    x-displayName: Complaints
  - name: Bounces
    description: >-
      Bounces - Bounce list stores events of delivery failures due to permanent
      recipient mailbox errors such as non-existent mailbox. Soft bounces (for
      example, mailbox is full) and other failures (for example, ESP rejects an
      email because it thinks it is spam) are not added to the list.
    x-displayName: Bounces
  - name: Allowlist
    description: >-
      The allowlist API provides the ability to allowlist specific addresses
      from being added to bounce list. You can allowlist by domain name (i.e
      example.com) or by specific address (i.e. alice@example.com). Mailgun
      doesn’t add an address to bounce list if the address is allowlisted. This
      API is very useful if you test against your private services and don’t
      want to constantly clean up bounce lists
    x-displayName: Allowlist
  - name: Routes
    description: >-
      Define a list of routes to handle incoming emails. When a message matches
      a route expression, Mailgun can forward it on to your application via HTTP
      or another email address, or store the message temporarily (3 days) for
      subsequent retrieval.
    x-displayName: Routes
  - name: Mailing Lists
    description: Programatically create mailing lists.
    x-displayName: Mailing Lists
  - name: Templates
    description: >-
      This API allows you to store predefined templates and use them to send
      messages using the Sending API.
    x-displayName: Templates
  - name: Account Management
    description: Perform account-level CRUD operations.
    x-displayName: Account Management
  - name: Custom Message Limit
    description: >-
      The custom message limit imposes a hard limit on how many messages your
      account can send during a calendar month.
    x-displayName: Custom Message Limit
  - name: Subaccounts
    description: >-
      Mailgun supports the creation, modification, and deletion of subaccounts.
      A subaccount is a child account of a parent account. The parent account
      can have multiple subaccounts. The subaccounts are created and managed by
      the parent account.
    x-displayName: Subaccounts
  - name: Keys
    description: The Keys API lets you view and manage api keys.
    x-displayName: Keys
  - name: Credentials
    description: The Credentials API lets you view and manage SMTP credentials.
    x-displayName: Credentials
  - name: IP Allowlist
    description: >-
      The IP Allowlist API lets you view and manage allowlisted IP addresses to
      which api key and SMTP credential usage is restricted.
    x-displayName: IP Allowlist
  - name: Bounce Classification
    x-displayName: Bounce Classification
  - name: Users
    description: Mailgun API supports viewing user entities.
    x-displayName: Users
paths:
  /v3/{domain_name}/messages:
    post:
      tags:
        - Messages
      summary: Send an email
      description: >-
        Pass the components of the messages such as To, From, Subject, HTML,
        text parts, attachments, etc. Mailgun will build a MIME representation
        of the message and send it. In order to send you must provide one of the
        following parameters: 'text', 'html', 'amp-html' or 'template'.
        Important: Send options (parameters starting with o:, h:, v:, or t:) are
        limited to 16KB total
      operationId: POST-v3--domain-name--messages
      parameters:
        - name: domain_name
          in: path
          description: Domain name used to send the message
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domain_name-messages-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-SendMessageResponse
              examples:
                Example:
                  value:
                    id: message-id
                    message: Queued. Thank you.
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: >-
                      A simple message describing the issue - A few examples:'to
                      parameter is not a valid address. please check
                      documentation.' 'Only one parameters 'html' or 'template'
                      is allowed.' 'Need at least one of 'text', 'html',
                      'amp-html' or 'template' parameters specified.' 'from
                      parameter is missing. ''Send options (parameters starting
                      with o:, h:, or v:) are limited to 16KB total'
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value: Forbidden
        '429':
          description: A 429 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: >-
                      Domain example.com is not allowed to send:
                      account-requests-per-sec limit exceeded, try again after
                      120 seconds
        '500':
          description: A 500 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: Internal Server Error
      security:
        - basicAuth: []
  /v3/{domain_name}/messages.mime:
    post:
      tags:
        - Messages
      summary: Send an email in MIME format
      description: >-
        Build a MIME string yourself using a MIME library and submit it to
        Mailgun. Important: Send options (parameters starting with o:, h:, v:,
        or t:) are limited to 16KB total
      operationId: POST-v3--domain-name--messages-mime
      parameters:
        - name: domain_name
          in: path
          description: Domain name used to send the message
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domain_name-messages-mime-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-SendMessageResponse
              examples:
                Example:
                  value:
                    id: message-id
                    message: Queued. Thank you.
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: >-
                      A simple message describing the issue - A few examples:'to
                      parameter is not a valid address. please check
                      documentation.' 'Only one parameters 'html' or 'template'
                      is allowed.' 'Need at least one of 'text', 'html',
                      'amp-html' or 'template' parameters specified.' 'from
                      parameter is missing. ''Send options (parameters starting
                      with o:, h:, or v:) are limited to 16KB total'
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value: Forbidden
        '429':
          description: A 429 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: >-
                      Domain example.com is not allowed to send:
                      account-requests-per-sec limit exceeded, try again after
                      120 seconds
        '500':
          description: A 500 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: Internal Server Error
      security:
        - basicAuth: []
  /v3/domains/{domain_name}/messages/{storage_key}:
    get:
      tags:
        - Messages
      summary: Retrieve a stored email
      description: >-
        Event(s) created from sending an email with Mailgun will contain a
        `storage.key` to use to retrieve the email.
      operationId: GET-v3-domains--domain-name--messages--storage-key-
      parameters:
        - name: domain_name
          in: path
          description: Domain name that was used to send the email
          required: true
          schema:
            type: string
        - name: storage_key
          in: path
          description: >-
            Storage key from the email's associated events (Example:
            Accepted/Delivered events `storage.key` field). Note: Storage keys
            are available for the duration of your domain's message retention
            policy.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseBasicExample
              examples:
                Example:
                  value:
                    Content-Transfer-Encoding: 7bit
                    Content-Type: multipart/form-data; boundary=----SomeFormBoundaryABC123
                    From: foo.bar@my-domain.com
                    Message-Id: <xxxxxxxxxxxxx.111111111111111@my-domain.com>
                    Mime-Version: '1.0'
                    Subject: '"Mailgun is awesome"'
                    To: Cool Bar <cool.barr@cool.com>, bar.baz@gmail.com
                    X-Mailgun-Tag: Earth
                    sender: foo.bar@my-domain.com
                    recipients: cool.barr@cool.com, bar.baz@gmail.com
                    body-html: <html>This is some html</html>
                    body-plain: This is some html
                    stripped-html: <html>This is some html</html>
                    stripped-text: This is some html
                    stripped-signature: >-
                      the signature block stripped from the plain text message
                      (if found)
                    message-headers:
                      - - Mime-Version
                        - '1.0'
                      - - Subject
                        - '"Mailgun is awesome"'
                      - - From
                        - foo.bar@my-domain.com
                      - - To
                        - cool.barr@cool.com, bar.baz@gmail.com
                      - - X-Mailgun-Tag
                        - Earth
                      - - Message-Id
                        - <xxxxxxxxxxxxx.111111111111111@my-domain.com>
                      - - Content-Transfer-Encoding
                        - 7bit
                      - - Content-Type
                        - text/html; charset=ascii
                    X-Mailgun-Template-Name: my-awesome-template
                    X-Mailgun-Template-Variables: '{"name":"Foo","phrase":"Bar"}'
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseBadRequest
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-GetMessageResponseNotFound
              examples:
                Example:
                  value:
                    message: Message not found
      security:
        - basicAuth: []
    post:
      tags:
        - Messages
      summary: Resend an email
      operationId: POST-v3-domains--domain-name--messages--storage-key-
      parameters:
        - name: domain_name
          in: path
          description: Domain name used to send the message
          required: true
          schema:
            type: string
        - name: storage_key
          in: path
          description: >-
            Storage key from the email's associated events (Example:
            Accepted/Delivered events `storage.key` field). Note: Storage keys
            are available for the duration of your domain's message retention
            policy.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domains-domain_name-messages-storage_key-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-influx-httpapi-SendMessageResponse
              examples:
                Example:
                  value:
                    id: message-id
                    message: Queued. Thank you.
      security:
        - basicAuth: []
  /v4/domains:
    get:
      tags:
        - Domains
      summary: Get domains
      description: >-
        Get the list of domains. Can be filtered by state or authority. Sorting
        is optional. The list is paginated and limited to 1000 items per page.
      operationId: GET-v4-domains
      parameters:
        - name: limit
          in: query
          description: 'Max count of items. Max: 1000. Default: 100'
          schema:
            type: integer
        - name: skip
          in: query
          description: 'Get the list of items starting at the nth element. Default: 0'
          schema:
            type: integer
        - name: state
          in: query
          description: >-
            Get only domains with a specific state. Can be either active,
            unverified or disabled.
          schema:
            type: string
        - name: sort
          in: query
          description: >-
            Valid sort options are `name` which defaults to asc order,
            `name:asc`, or `name:desc`. If sorting is not specified domains are
            returned in reverse creation date order.
          schema:
            type: string
        - name: authority
          in: query
          description: >-
            Get only domains with a specific authority. If state is specified
            then only state filtering will be proceed
          schema:
            type: string
        - name: search
          in: query
          description: >-
            Search domains by the given partial or complete name. Does not
            support wildcards
          schema:
            type: string
        - name: include_subaccounts
          in: query
          description: >-
            Search on every domain that belongs to any subaccounts under this
            account. Default to false.
          schema:
            type: boolean
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-ListDomainResponse
              examples:
                200 without subaccount domains:
                  value:
                    total_count: 1
                    items:
                      - created_at: Mon, 02 Jan 2006 15:04:05 MST
                        id: '1'
                        name: example.com
                        state: unverified
                        type: custom
                        web_prefix: email
                        disabled:
                          code: blacklisted
                          note: for debugging
                          permanently: true
                          reason: bad customer
                200 with subaccount domains:
                  value:
                    total_count: 1
                    items:
                      - created_at: Mon, 02 Jan 2006 15:04:05 MST
                        id: '1'
                        name: example.com
                        subaccount_id: 6fr783930fhhriu673
                        state: unverified
                        type: custom
                        web_prefix: email
                        disabled:
                          code: blacklisted
                          note: for debugging
                          permanently: true
                          reason: bad customer
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
      security:
        - basicAuth: []
    post:
      tags:
        - Domains
      summary: Create a domain
      description: Creates a domain for sending emails
      operationId: POST-v4-domains
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v4-domains-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-CreateDomainResp
              examples:
                Example:
                  value:
                    message: Domain DNS records have been created
                    domain:
                      created_at: Thu, 13 Oct 2011 18:02:00 GMT
                      id: '123456789012345678901234'
                      name: example.com
                      require_tls: true
                      smtp_login: postmaster@example.com
                      spam_action: disabled
                      state: active
                      type: sandbox
                      use_automatic_sender_security: true
                      web_prefix: email
                      web_scheme: http
                      encrypt_incoming_message: true
                      message_ttl: 86400
                    receiving_dns_records:
                      - cached: []
                        name: example.com
                        priority: '10'
                        record_type: MX
                        valid: unknown
                    sending_dns_records:
                      - cached:
                          - mxa.example.com
                          - mxb.example.com
                        name: example.com
                        priority: '10'
                        record_type: A
                        valid: valid
                        value: 1.2.3.4
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
      security:
        - basicAuth: []
  /v4/domains/{name}:
    get:
      tags:
        - Domains
      summary: Get domain details
      description: >-
        Fetches json representation of a domain that includes details about the
        domain's state and settings.
      operationId: GET-v4-domains--name-
      parameters:
        - name: name
          in: path
          description: The name of the domain you want to fetch
          required: true
          schema:
            type: string
        - name: h:extended
          in: query
          description: >-
            Default to false. If set to true, domain payload will include
            dkim_host, mailfrom_host and pod
          schema:
            type: boolean
        - name: h:with_dns
          in: query
          description: >-
            Default to true, domain payload will include sending and receiving
            dns records payload
          schema:
            type: boolean
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-FindDomainByNameResp
              examples:
                Example:
                  value:
                    domain:
                      created_at: Thu, 13 Oct 2011 18:02:00 GMT
                      id: '123456789012345678901234'
                      name: example.com
                      require_tls: true
                      smtp_login: postmaster@example.com
                      spam_action: disabled
                      state: active
                      type: sandbox
                      use_automatic_sender_security: true
                      web_prefix: email
                      web_scheme: http
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
    put:
      tags:
        - Domains
      summary: Update domain
      description: >-
        Update domain configuration like smtp credentials, enable/disable
        automatic sender security, spam actions, wildcard, or tracking web
        scheme.
      operationId: PUT-v4-domains--name-
      parameters:
        - name: name
          in: path
          description: The name of the domain you want to update
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v4-domains-name-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-UpdateDomainResp
              examples:
                Example:
                  value:
                    domain:
                      created_at: Thu, 13 Oct 2011 18:02:00 GMT
                      id: '123456789012345678901234'
                      name: example.com
                      require_tls: true
                      smtp_login: postmaster@example.com
                      spam_action: disabled
                      state: active
                      type: sandbox
                      use_automatic_sender_security: true
                      web_prefix: email
                      web_scheme: http
                    receiving_dns_records:
                      - cached: []
                        name: example.com
                        priority: '10'
                        record_type: MX
                        valid: unknown
                    sending_dns_records:
                      - cached:
                          - mxa.example.com
                          - mxb.example.com
                        name: example.com
                        priority: '10'
                        record_type: A
                        valid: valid
                        value: 1.2.3.4
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v4/domains/{name}/verify:
    put:
      tags:
        - Domains
      summary: Verify Domain
      description: >-
        Verify the domains DNS records (includes A, CNAME, SPF, DKIM and MX
        records) to ensure the domain is ready and able to send
      operationId: PUT-v4-domains--name--verify
      parameters:
        - name: name
          in: path
          description: The name of the domain you want to verify
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-VerifyDomainResponse
              examples:
                Example:
                  value:
                    message: Domain DNS records have been updated
                    domain:
                      created_at: Mon, 02 Jan 2006 15:04:05 MST
                      id: '123456789012345678901234'
                      name: example.com
                      require_tls: true
                      smtp_login: postmaster@example.com
                      spam_action: disabled
                      state: unverified
                      type: sandbox
                      use_automatic_sender_security: true
                      web_prefix: email
                      web_scheme: http
                      disabled:
                        code: blacklisted
                        note: for debugging
                        permanently: true
                        reason: bad customer
                    sending_dns_records:
                      - cached:
                          - mxa.example.com
                          - mxb.example.com
                        name: example.com
                        priority: '10'
                        record_type: A
                        valid: valid
                        value: 0.0.0.0
                    receiving_dns_records:
                      - cached:
                          - mxa.example.com
                          - mxb.example.com
                        name: example.com
                        priority: '10'
                        record_type: A
                        valid: valid
                        value: 0.0.0.0
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
        '429':
          description: A 429 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v3/domains/{name}:
    delete:
      tags:
        - Domains
      summary: Delete a domain
      description: >-
        The domain must not be disabled or used as an authority for an other
        domain. Sandbox domain can't be deleted.
      operationId: DELETE-v3-domains--name-
      parameters:
        - name: name
          in: path
          description: The name of the domain to delete
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain will be deleted in the background
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{domain}/webhooks:
    get:
      tags:
        - Webhooks
      summary: Get domain webhooks
      description: Returns all webhooks for the domain.
      operationId: GET-v3-domains--domain--webhooks
      parameters:
        - name: domain
          in: path
          description: Domain name you want webhooks for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-GetAllDomainWebhooksResp
              examples:
                Example:
                  value:
                    webhooks:
                      accepted:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      delivered:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      opened:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      clicked:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      unsubscribed:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      complained:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      temporary_fail:
                        urls:
                          - https://foo.com
                          - https://bar.com
                      permanent_fail:
                        urls:
                          - https://foo.com
                          - https://bar.com
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
    post:
      tags:
        - Webhooks
      summary: Create a domain webhook
      description: >-
        Create a list of webhook URLs you'd like to receive Mailgun's POST
        requests containing event information.
      operationId: POST-v3-domains--domain--webhooks
      parameters:
        - name: domain
          in: path
          description: The domain name to create the webhook for
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domains-domain-webhooks-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-CreateDomainWebhookResp
              examples:
                Example:
                  value:
                    message: Webhook has been created
                    webhook:
                      urls:
                        - https://foo.com
                        - https://bar.com
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: 'https://example.com/ is not a valid url: host not found'
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{domain_name}/webhooks/{webhook_name}:
    get:
      tags:
        - Webhooks
      summary: Get domain webhooks by type
      description: Get the list of url(s) for a webhook identified by its webhook_name.
      operationId: GET-v3-domains--domain-name--webhooks--webhook-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name you want webhooks for
          required: true
          schema:
            type: string
        - name: webhook_name
          in: path
          description: >-
            The webhook type you wish to retrieve. Valid types are `accepted`,
            `clicked`, `opened`, `unsubscribed`, `delivered`, `permanent_fail`,
            `temporary_fail`, `complained`
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-GetDomainWebhookResp
              examples:
                Example:
                  value:
                    webhook:
                      urls:
                        - https://foo.com
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
    put:
      tags:
        - Webhooks
      summary: Update domain webhook
      description: >-
        Replace the list of urls by the given one with the `url` param. Here is
        the list of supported webhook: `accepted`, `opened`, `clicked`,
        `unsubscribed`, `delivered`, `permanent_fail`, `temporary_fail` and
        `complained`.
      operationId: PUT-v3-domains--domain-name--webhooks--webhook-name-
      parameters:
        - name: domain_name
          in: path
          description: The name of the domain you want to get webhook from
          required: true
          schema:
            type: string
        - name: webhook_name
          in: path
          description: The webhook type to update.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-domain_name-webhooks-webhook_name-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-CreateDomainWebhookResp
              examples:
                Example:
                  value:
                    message: Webhook has been updated
                    webhook:
                      urls:
                        - https://foo.com
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: 'https://example.com/ is not a valid url: host not found'
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
    delete:
      tags:
        - Webhooks
      summary: Delete domain webhooks by type
      description: Remove all url(s) for a specified webhook type.
      operationId: DELETE-v3-domains--domain-name--webhooks--webhook-name-
      parameters:
        - name: domain_name
          in: path
          description: The domain name you want to delete the webhook(s) for
          required: true
          schema:
            type: string
        - name: webhook_name
          in: path
          description: >-
            The name of the webhook to delete. Supported webhook names are
            `accepted`, `clicked`, `opened`, `unsubscribed`, `delivered`,
            `permanent_fail`, `temporary_fail`, and `complained`
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-CreateDomainWebhookResp
              examples:
                Example:
                  value:
                    message: Webhook has been deleted
                    webhook:
                      urls:
                        - https://foo.com
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{name}/tracking:
    get:
      tags:
        - Domain Tracking
      summary: Get tracking settings
      description: >-
        Use to check if open, click and unsubscribe tracking are
        active/inactive.
      operationId: GET-v3-domains--name--tracking
      parameters:
        - name: name
          in: path
          description: The name of the domain to fetch tracking details for.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-GetDomainTrackingResp
              examples:
                Example:
                  value:
                    tracking:
                      open:
                        active: true
                      click:
                        active: true
                      unsubscribe:
                        active: true
                        html_footer: 'off'
                        text_footer: 'on'
                      web_scheme: http
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{name}/tracking/click:
    put:
      tags:
        - Domain Tracking
      summary: Update click tracking settings
      description: Use to turn on/off the click tracking at the domain level.
      operationId: PUT-v3-domains--name--tracking-click
      parameters:
        - name: name
          in: path
          description: The name of the domain you want to update
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-name-tracking-click-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-UpdateDomainTrackingClickResp
              examples:
                Example:
                  value:
                    message: Domain tracking settings have been updated
                    click:
                      active: true
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{name}/tracking/open:
    put:
      tags:
        - Domain Tracking
      summary: Update open tracking settings
      description: Use to turn on/off the open tracking at the domain level.
      operationId: PUT-v3-domains--name--tracking-open
      parameters:
        - name: name
          in: path
          description: The name of the domain you want to update
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-name-tracking-open-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-UpdateDomainTrackingOpenResp
              examples:
                Example:
                  value:
                    message: Domain tracking settings have been updated
                    open:
                      active: true
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{name}/tracking/unsubscribe:
    put:
      tags:
        - Domain Tracking
      summary: Update unsubscribe tracking settings
      description: Use to turn on/off the unsubscribe tracking at the domain level.
      operationId: PUT-v3-domains--name--tracking-unsubscribe
      parameters:
        - name: name
          in: path
          description: The name of the domain you want to update
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-name-tracking-unsubscribe-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-UpdateDomainTrackingUnsubscribeResp
              examples:
                Example:
                  value:
                    message: Domain tracking settings have been updated
                    unsubscribe:
                      active: true
                      html_footer: |
                        <br>
                        <p><a href="%unsubscribe_url%">unsubscribe</a></p>
                      text_footer: |+
                        To unsubscribe click: <%unsubscribe_url%>

        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v1/dkim/keys:
    get:
      tags:
        - Domain Keys
      summary: List keys for all domains
      description: >-
        List domain keys, and optionally filter by signing domain or selector.
        The page & limit data is only required when paging through the data.
      operationId: GET-v1-dkim-keys
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/GET-v1-dkim-keys-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-DomainKeyListResponse
              examples:
                Example:
                  value:
                    items:
                      - signing_domain: authority.domain.tld
                        selector: s1
                        dns_record:
                          is_active: true
                          cached:
                            - cached dns value
                          name: s1._domainkey.authority.domain.tld
                          record_type: TXT
                          valid: VALID
                          value: expected dns value
                      - signing_domain: authority.domain.tld
                        selector: s2
                        dns_record:
                          cached:
                            - cached dns value
                          name: s2._domainkey.authority.domain.tld
                          record_type: TXT
                          valid: UNKNOWN
                          value: expected dns value
                    paging:
                      previous: https://....
                      first: https://....
                      next: https://....
                      last: https://....
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
      security:
        - basicAuth: []
    post:
      tags:
        - Domain Keys
      summary: Create a domain key
      description: "Create a domain key. Note that once private keys are created or imported they are never exported.\nAlternatively, you can import an existing PEM file containing a RSA private key in PKCS #1, ASn.1 DER\n\t\t\t   format. Note, the pem can be passed as a file attachment or as a form-string parameter."
      operationId: POST-v1-dkim-keys
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v1-dkim-keys-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-DomainKeyResponse
              examples:
                Example:
                  value:
                    signing_domain: example.com
                    selector: s1
                    dns_record:
                      cached: []
                      name: s1._domainkey.example.com
                      record_type: TXT
                      valid: unknown
                      value: k=rsa; p=<public_key>
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
      security:
        - basicAuth: []
    delete:
      tags:
        - Domain Keys
      summary: Delete a domain key
      description: Domain keys are not recoverable after deletion so use with care
      operationId: DELETE-v1-dkim-keys
      parameters:
        - name: signing_domain
          in: query
          description: Signing Domain
          required: true
          schema:
            type: string
        - name: selector
          in: query
          description: Selector
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: >-
                      cannot delete domain key: must have at least one active
                      domain key
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: domain key not found
      security:
        - basicAuth: []
  /v4/domains/{authority_name}/keys/{selector}/activate:
    put:
      tags:
        - Domain Keys
      summary: Activate a domain key
      description: >-
        Activate a key to be used to DKIM sign emails with. Note: dns records
        must be valid for a domain key to be activated
      operationId: PUT-v4-domains--authority-name--keys--selector--activate
      parameters:
        - name: authority_name
          in: path
          description: >-
            The domain authority name you want to activate. Must be a valid
            domain
          required: true
          schema:
            type: string
        - name: selector
          in: path
          description: >-
            The selector you want to activate for the domain key. Must be a
            valid dot atom
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-UpdateDomainKeyResp
              examples:
                Example:
                  value:
                    message: domain key activated
                    authority: authority.domain.tld
                    selector: selector
                    active: true
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: domain key not found
      security:
        - basicAuth: []
  /v4/domains/{authority_name}/keys:
    get:
      tags:
        - Domain Keys
      summary: List domain keys
      description: >-
        List all domain keys for your domain, including active/inactive and
        valid/invalid ones.
      operationId: GET-v4-domains--authority-name--keys
      parameters:
        - name: authority_name
          in: path
          description: >-
            The domain authority name you want to list the domain keys for. Must
            be a valid domain
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-DomainKeyListResponse
              examples:
                Example:
                  value:
                    items:
                      - signing_domain: authority.domain.tld
                        selector: s1
                        dns_record:
                          is_active: true
                          cached:
                            - cached dns value
                          name: s1._domainkey.authority.domain.tld
                          record_type: TXT
                          valid: VALID
                          value: expected dns value
                      - signing_domain: authority.domain.tld
                        selector: s2
                        dns_record:
                          cached:
                            - cached dns value
                          name: s2._domainkey.authority.domain.tld
                          record_type: TXT
                          valid: UNKNOWN
                          value: expected dns value
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
      security:
        - basicAuth: []
  /v4/domains/{authority_name}/keys/{selector}/deactivate:
    put:
      tags:
        - Domain Keys
      summary: Deactivate a domain key
      description: >-
        Deactivating for a specified authority and/or selector means a key won't
        be used for signing email anymore, even if they are valid.
      operationId: PUT-v4-domains--authority-name--keys--selector--deactivate
      parameters:
        - name: authority_name
          in: path
          description: >-
            The domain authority name you want to deactivate. Must be a valid
            domain
          required: true
          schema:
            type: string
        - name: selector
          in: path
          description: >-
            The selector you want to deactivate for the domain key. Must be a
            valid dot atom
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-UpdateDomainKeyResp
              examples:
                Example:
                  value:
                    message: domain key deactivated
                    authority: authority.domain.tld
                    selector: selector
                    active: true
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: domain key not found
      security:
        - basicAuth: []
  /v3/domains/{name}/dkim_authority:
    put:
      tags:
        - Domain Keys
      summary: Update DKIM authority
      description: >-
        You can delegate the domain authority to an other domain. Domain's
        authority is set to itself by default.
      operationId: PUT-v3-domains--name--dkim-authority
      parameters:
        - name: name
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-name-dkim_authority-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-ReassignDkimAuthorityResp
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{name}/dkim_selector:
    put:
      tags:
        - Domain Keys
      summary: Update a DKIM selector
      description: >-
        Selector is the unique identifier of your key. It has to be different
        from other keys selector.
      operationId: PUT-v3-domains--name--dkim-selector
      parameters:
        - name: name
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-name-dkim_selector-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: DKIM selector changed
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v3/domains/{name}/sending_queues:
    get:
      tags:
        - Messages
      summary: Get messages queue status
      description: Provides default and scheduled message queue information.
      operationId: GET-v3-domains--name--sending-queues
      parameters:
        - name: name
          in: path
          description: The name of the domain you want get sending queues from
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-GetDomainSendingQueuesResp
              examples:
                Example:
                  value:
                    regular:
                      is_disabled: true
                      disabled:
                        until: Mon, 02 Jan 2006 15:04:05 MST
                        reason: You have too many messages in queue
                    scheduled:
                      is_disabled: true
                      disabled:
                        until: Mon, 02 Jan 2006 15:04:05 MST
                        reason: You have too many messages in queue
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Domain not found
      security:
        - basicAuth: []
  /v1/dkim_management/domains/{name}/rotation:
    put:
      tags:
        - DKIM Security
      summary: Update Automatic Sender Security DKIM key rotation for a domain
      description: The minimum allowed interval for rotation is 5 days.
      operationId: PUT-v1-dkim-management-domains--name--rotation
      parameters:
        - name: name
          in: path
          description: The Domain name
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v1-dkim_management-domains-name-rotation-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-pendulum-api-DomainResponse
              examples:
                Example:
                  value:
                    domain:
                      id: '000000000000000000000002'
                      account_id: '000000000000000000000001'
                      sid: '789'
                      name: example.com
                      state: enabled
                      active_selector: pdk1
                      rotation_enabled: 'true'
                      rotation_interval: 24h
                      records:
                        - name: pdk1._domainkey.example.com
                          type: CNAME
                          identifier: DKIM
                          value: pdk1._domainkey.1234567.service.mailgun.com
                          comment: Customer DKIM CNAME Record
                        - name: pdk2._domainkey.example.com
                          type: CNAME
                          identifier: DKIM
                          value: pdk2._domainkey.1234567.service.mailgun.com
                          comment: Customer DKIM CNAME Record
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: >-
                      rotation_interval is not allowed unless also enabling DKIM
                      rotation
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-NotFoundError
              examples:
                Example:
                  value:
                    Description: domain not found
      security:
        - basicAuth: []
  /v1/dkim_management/domains/{name}/rotate:
    post:
      tags:
        - DKIM Security
      summary: Rotate Automatic Sender Security DKIM key for a domain
      description: >-
        Immediately rotate your DKIM key. This will trigger a rotation even if
        auto-rotation is disabled on the domain.
      operationId: POST-v1-dkim-management-domains--name--rotate
      parameters:
        - name: name
          in: path
          description: The Domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: ok
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: >-
                      only domains in enabled can rotate their keys. Current
                      state: wait_verify
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-NotFoundError
              examples:
                Example:
                  value:
                    Description: domain not found
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/ip_pools/all:
    get:
      summary: List DIPPs delegated to subaccounts
      description: >-
        #### Description

        Lists all subaccounts of the parent account to which the parent account
        has

        delegated DIPPs.
      operationId: GET-v5-accounts-subaccounts-ip-pools-all
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tower-api-subaccounts-ListSubaccountDIPPsResponse
              examples:
                Example:
                  value:
                    items:
                      - pool_id: 68d17866ba9d5506cbc2e277
                        subaccount_id: 68d17866ba9d5506cbc2e279
                      - pool_id: 68d17866ba9d5506cbc2e278
                        subaccount_id: 68d17866ba9d5506cbc2e27a
                    total_count: 2
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: account not found
      tags:
        - openapi-tower_other
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/{subaccountId}/ip_pool:
    put:
      summary: Delegate a DIPP to a subaccount
      description: >-
        #### Description

        Initiates the process to delegate a DIPP to a subaccount. If the
        subaccount already

        has a DIPP delegated to it, that DIPP will be replaced. The success of
        this API call

        only indicates that the process has been started; it can still fail
        midway for

        various reasons.


        #### Request Schema

        Request parameters are encoded as form data.


        Name | Description | Required | Type

        --- | --- | --- | ---

        pool_id | Id of the DIPP to delegate | true | string
      operationId: PUT-v5-accounts-subaccounts--subaccountId--ip-pool
      parameters:
        - name: subaccountId
          in: path
          description: Id of the subaccount to delegate the DIPP to
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tower-api-StartSagaResponse
              examples:
                Example:
                  value:
                    message: started
                    reference_id: 68d17866ba9d5506cbc2e27c
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: invalid request parameters
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: account not found
      tags:
        - openapi-tower_other
      security:
        - basicAuth: []
    delete:
      summary: Revoke a DIPP delegated to a subaccount
      description: >-
        #### Description

        Initiates the process to revoke a DIPP delegated to a subaccount. All
        domains linked

        to the DIPP will be unlinked.
      operationId: DELETE-v5-accounts-subaccounts--subaccountId--ip-pool
      parameters:
        - name: subaccountId
          in: path
          description: Id of the subaccount to revoke the DIPP from
          required: true
          schema:
            type: string
        - name: pool_id
          in: query
          description: Id of the DIPP to revoke
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tower-api-StartSagaResponse
              examples:
                Example:
                  value:
                    message: started
                    reference_id: 68d17866ba9d5506cbc2e27b
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: invalid request parameters
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: account not found
      tags:
        - openapi-tower_other
      security:
        - basicAuth: []
  /v3/domains/{name}/ips/{ip}:
    delete:
      tags:
        - IPs
        - IP Pools
      summary: >-
        Remove an IP from the domain pool, unlink a DIPP or remove the domain
        pool
      description: >-
        The behavior of the endpoint depends on the value of the `ip` parameter.
        It can be

        one of the following:
         * a valid IP address: this IP address will be removed from the domain pool.
         * string `all`: the entire domain pool will be removed. As far as the system is
           concerned, such domain will no longer exist.
         * string `ip_pool`: the DIPP which is currently linked to the domain will be
           unlinked.

        ### Removing An IP

        Note that it's impossible to alter domain IPs if a DIPP is linked to the
        domain.


        If the account is not eligible for shared IPs, additional rules apply:
         * removing the last IP from the domain is not allowed;
         * if all of the remaining dedicated IPs are on warmup, an extra IP might be added to
           the domain pool.

        ### Unlinking The DIPP

        The account must have 'DIPPs' feature enabled.


        Either `ip` or `pool_id` query parameter must be specified, but not
        both.


        If the special value `shared` is used for the replacement IP, the
        account must be

        eligible for shared IPs. In this case the system will assign a shared IP
        as the

        replacement.
      operationId: DELETE-v3-domains--name--ips--ip-
      parameters:
        - name: ip
          in: path
          description: 'One of the following: `all`, `ip_pool` or a valid IP address.'
          required: true
          schema:
            type: string
        - name: name
          in: path
          description: >-
            Domain name. Converted to `X-Mailgun-Domain-Id` header by the
            middleware.
          required: true
          schema:
            type: string
        - name: ip
          in: query
          description: Replacement IP or special value `shared`.
          schema:
            type: string
        - name: pool_id
          in: query
          description: Replacement DIPP id.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/domains/{name}/pool/{ip}:
    delete:
      tags:
        - IPs
        - IP Pools
      summary: >-
        Remove an IP from the domain pool, unlink a DIPP or remove the domain
        pool
      description: >-
        The behavior of the endpoint depends on the value of the `ip` parameter.
        It can be

        one of the following:
         * a valid IP address: this IP address will be removed from the domain pool.
         * string `all`: the entire domain pool will be removed. As far as the system is
           concerned, such domain will no longer exist.
         * string `ip_pool`: the DIPP which is currently linked to the domain will be
           unlinked.

        ### Removing An IP

        Note that it's impossible to alter domain IPs if a DIPP is linked to the
        domain.


        If the account is not eligible for shared IPs, additional rules apply:
         * removing the last IP from the domain is not allowed;
         * if all of the remaining dedicated IPs are on warmup, an extra IP might be added to
           the domain pool.

        ### Unlinking The DIPP

        The account must have 'DIPPs' feature enabled.


        Either `ip` or `pool_id` query parameter must be specified, but not
        both.


        If the special value `shared` is used for the replacement IP, the
        account must be

        eligible for shared IPs. In this case the system will assign a shared IP
        as the

        replacement.
      operationId: DELETE-v3-domains--name--pool--ip-
      parameters:
        - name: ip
          in: path
          description: 'One of the following: `all`, `ip_pool` or a valid IP address.'
          required: true
          schema:
            type: string
        - name: name
          in: path
          description: >-
            Domain name. Converted to `X-Mailgun-Domain-Id` header by the
            middleware.
          required: true
          schema:
            type: string
        - name: ip
          in: query
          description: Replacement IP or special value `shared`.
          schema:
            type: string
        - name: pool_id
          in: query
          description: Replacement DIPP id.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/domains/{name}/dynamic_pools:
    post:
      tags:
        - Dynamic IP Pools
      summary: Enroll domain
      description: >-
        Domains enrolled in the Dynamic IP pools feature will be assigned an IP
        pool based on reputation.

        The feature must be enabled and configured before enrolling domains.
      operationId: POST-v3-domains--name--dynamic-pools
      parameters:
        - name: name
          in: path
          description: Domain name
          required: true
          schema:
            type: string
        - name: replacement_ip
          in: query
          description: A valid IP address or 'shared'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
    delete:
      tags:
        - Dynamic IP Pools
      summary: Remove domain from dynamic IP pools
      description: >-
        The behavior of this endpoint depends on the value of the
        `replacement_ip` and `replacement_pool_id` parameters.

        One of these parameters (but not both) must be provided. If
        `replacement_ip` is provided, the IP(s) will be assigned to the domain.

        `replacement_ip` can include one of the following:
         * valid IP(s): this IP address or addresses will be added to the domain
         * string `shared`: if the account is eligible for shared IPs, a suitable shared IP will be chosen and added to the domain
        The 'replacement_ip' parameter cannot include any IPs that are already
        assigned to a Dedicated IP Pool or a Dynamic IP Pool.

        If `replacement_pool_id` is provided, the Dedicated IP Pool will be
        assigned to the domain.
      operationId: DELETE-v3-domains--name--dynamic-pools
      parameters:
        - name: name
          in: path
          description: Domain name
          required: true
          schema:
            type: string
        - name: replacement_ip
          in: query
          description: >-
            A valid IP address or 'shared'. This field can be specified multiple
            times if all provided IPs are dedicated. Cannot be provided if
            providing 'replacement_pool_id' param
          required: true
          schema:
            type: string
        - name: replacement_pool_id
          in: query
          description: >-
            A valid dedicated IP pool ID to assign to the domain. Cannot be
            provided if providing 'replacement_ip' param
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/domains/dynamic_pools/assignable:
    get:
      tags:
        - Dynamic IP Pools
      summary: List assignable domains
      description: Lists all domains that are not already enrolled in dynamic IP pools.
      operationId: GET-v3-domains-dynamic-pools-assignable
      parameters:
        - name: subaccount_id
          in: query
          description: >-
            If provided, queries domains belonging to the subaccount. Must be a
            valid account ID
          schema:
            type: string
        - name: domain
          in: query
          description: Regex search term to query a domain by name
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    items:
                      - account_id: 68d17866ba9d5506cbc2e26f
                        id: 68d17866ba9d5506cbc2e26e
                        name: example.com
      security:
        - basicAuth: []
  /v3/domains/all/dynamic_pools/enroll:
    post:
      tags:
        - Dynamic IP Pools
      summary: Enroll all account domains
      description: >-
        Begins an asynchronous background job to assign all domains to Dynamic
        IP Pools.

        This can also include domains belonging to subaccounts depending on the
        provided parameters.

        The Dynamic IP Pools feature must be enabled for the account and the
        request must come from a parent account user.
      operationId: POST-v3-domains-all-dynamic-pools-enroll
      parameters:
        - name: include_subaccounts
          in: query
          description: >-
            If true, domains belonging to subaccounts will also be enrolled in
            Dynamic IP Pools
          required: true
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: started
      security:
        - basicAuth: []
  /v3/ips:
    get:
      tags:
        - IPs
      summary: List account IPs
      description: >-
        `assignable_to_pool` in response lists which IPs can be assigned to
        DIPPs; this

        field is present only if the account has 'DIPPs' feature enabled.


        `total_count` contains the number of items returned in `items` (this
        depends on the

        filters applied).
      operationId: GET-v3-ips
      parameters:
        - name: dedicated
          in: query
          description: Return only dedicated IPs
          schema:
            type: boolean
        - name: enabled
          in: query
          description: Return only enabled IPs
          schema:
            type: boolean
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    assignable_to_pools:
                      - 5.6.7.8
                    details:
                      - ip: 1.2.3.4
                        is_on_warmup: true
                      - ip: 5.6.7.8
                    items:
                      - 1.2.3.4
                      - 5.6.7.8
                    total_count: 2
      security:
        - basicAuth: []
  /v3/ips/{ip}:
    get:
      tags:
        - IPs
      summary: Get details about account IP
      operationId: GET-v3-ips--ip-
      parameters:
        - name: ip
          in: path
          description: IP address to get details about
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    dedicated: true
                    ip: 1.2.3.4
                    rdns: ip1-2-3-4.mailgun.net
      security:
        - basicAuth: []
  /v3/ips/{ip}/domains:
    get:
      tags:
        - IPs
      summary: Get all domains of an account where a specific IP is assigned
      description: >-
        The IP must belong to the account.


        Matching domains are ordered by increasing id, then the `limit` and
        `skip` parameters

        are applied.


        If the `search` parameter is present, it is used to limit the results to
        domains

        whose names match the search query. The search query is split into words
        by 

        whitespace and punctuation, then the logical OR is applied.
      operationId: GET-v3-ips--ip--domains
      parameters:
        - name: ip
          in: path
          description: The IP to filter on
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: The limit to apply to the returned domains
          required: true
          schema:
            type: integer
        - name: search
          in: query
          description: The search query that the returned domains' names must match
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: The number of matching domains to skip in the response
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tower-api-account-domainsResponse
              examples:
                Example:
                  value:
                    items:
                      - ips:
                          - 1.2.3.4
                          - 5.6.7.8
                        domain: one.example.com
                      - ips:
                          - 1.2.3.4
                        domain: two.example.com
                    total_count: 2
      security:
        - basicAuth: []
    post:
      tags:
        - IPs
      summary: Assign an IP to all account domains
      description: The IP must belong to the account.
      operationId: POST-v3-ips--ip--domains
      parameters:
        - name: ip
          in: path
          description: The IP to Add
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tower-api-StartSagaResponse
              examples:
                Example:
                  value:
                    message: started
                    reference_id: 61926093321d1cba88f3b95b
      security:
        - basicAuth: []
    delete:
      tags:
        - IPs
      summary: Remove an IP from all account domains
      description: >-
        The IP must belong to the account.


        If the `alternative` parameter is present, it is used to replace the
        removed ip on all domains.
      operationId: DELETE-v3-ips--ip--domains
      parameters:
        - name: ip
          in: path
          description: The IP to Remove
          required: true
          schema:
            type: string
        - name: alternative
          in: query
          description: An IP that will replace the removed IP on all domains
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tower-api-StartSagaResponse
              examples:
                Example:
                  value:
                    message: started
                    reference_id: 61926093321d1cba88f3b95b
      security:
        - basicAuth: []
  /v3/ips/{addr}/ip_band:
    post:
      tags:
        - IPs
      summary: Place account IP into a dedicated IP band
      description: |-
        The `Dedicated IP Bands` feature must be enabled for the account.

        The IP must be a dedicated one belonging to the account.
      operationId: POST-v3-ips--addr--ip-band
      parameters:
        - name: addr
          in: path
          description: IP address
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-ips-addr-ip_band-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/ips/request/new:
    get:
      tags:
        - IPs
      summary: Return the number of IPs available to the account per its billing plan
      description: >-
        This endpoint remains active for backwards compatibility. Do not use it
        in new code.


        Field `shared` in the response is deprecated and should not be used.
      operationId: GET-v3-ips-request-new
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    allowed:
                      dedicated: 1
                      shared: 2
      security:
        - basicAuth: []
    post:
      tags:
        - IPs
      summary: Add a new dedicated IP to the account
      description: A new IP can be assigned only if billing limits allow that.
      operationId: POST-v3-ips-request-new
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/dynamic_pools:
    get:
      tags:
        - Dynamic IP Pools
      summary: List all Dynamic IP pools
      description: >-
        Returns the list of IPs belonging to each of the account's Dynamic IP
        Pools.
      operationId: GET-v3-dynamic-pools
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-Response
              examples:
                Example:
                  value:
                    good_reputation:
                      - 1.0.0.1
                      - 1.0.0.2
                    poor_reputation:
                      - 1.0.0.3
                    new_senders:
                      - 1.0.0.4
                    pools:
                      - account_id: 68d17866ba9d5506cbc2e270
                        enabled: true
                        id: 68d17866ba9d5506cbc2e271
                        ips:
                          - 1.0.0.1
                          - 1.0.0.2
                        name: dynamic_good
                      - account_id: 68d17866ba9d5506cbc2e270
                        enabled: true
                        id: 68d17866ba9d5506cbc2e272
                        ips:
                          - 1.0.0.3
                        name: dynamic_poor
                      - account_id: 68d17866ba9d5506cbc2e270
                        enabled: true
                        id: 68d17866ba9d5506cbc2e273
                        ips:
                          - 1.0.0.4
                        name: dynamic_new
      security:
        - basicAuth: []
  /v3/dynamic_pools/all:
    post:
      tags:
        - Dynamic IP Pools
      summary: Initialize/set IPs for all pools
      description: >-
        Any existing IPs in dynamic IP pools will be replaced. All IPs must be
        dedicated IPs and

        belong to the account. Additionally, each dynamic IP pool must contain
        at least 1 IP that

        is not currently warming.
      operationId: POST-v3-dynamic-pools-all
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-dynamic_pools-all-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    good_reputation:
                      - 1.0.0.1
                      - 1.0.0.2
                    poor_reputation:
                      - 1.0.0.3
                    new_senders:
                      - 1.0.0.4
      security:
        - basicAuth: []
    delete:
      tags:
        - Dynamic IP Pools
      summary: Remove all dynamic IP pools
      description: >-
        Removes all dynamic IP pools from the account. All domains on the
        account (and subaccounts, if any) must be removed from dynamic IP pools
        before the pools can be removed. Any standard dedicated IP pools will
        not be modified.
      operationId: DELETE-v3-dynamic-pools-all
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/dynamic_pools/{pool_name}/{ip}:
    post:
      tags:
        - Dynamic IP Pools
      summary: Add IP to Dynamic IP Pool
      description: >-
        Adds a given IP to a Dynamic IP Pool. The IP must be dedicated and
        belong to the account.
      operationId: POST-v3-dynamic-pools--pool-name---ip-
      parameters:
        - name: pool_name
          in: path
          description: >-
            The name of the Dynamic IP Pool to add the IP to (ex: dynamic_good,
            dynamic_poor, etc.)
          required: true
          schema:
            type: string
        - name: ip
          in: path
          description: The ip to add to the given Dynamic IP Pool
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value: >-
                    this is needed just so that examples are included into the
                    output
      security:
        - basicAuth: []
  /v3/dynamic_pools/{pool_name}:
    patch:
      tags:
        - Dynamic IP Pools
      summary: Update pool IPs
      description: |-
        Adds and/or removes IPs to/from the specified dynamic IP pool.
        A given pool is required to have at least 1 IP that is not
        actively warming. Additionally, a single IP cannot be assigned to
        multiple dynamic pools.
      operationId: PATCH-v3-dynamic-pools--pool-name-
      parameters:
        - name: pool_name
          in: path
          description: The name of the dynamic IP pool
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PATCH-v3-dynamic_pools-pool_name-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/ip_pools:
    get:
      tags:
        - IP Pools
      summary: List dedicated IP pools of the account
      description: |-
        #### Description
        Lists all dedicated IP pools of the account. For each pool
        returns its basic properties (name, description, the list of IPs)
        and indicates whether the pool is linked to any domains and
        whether it's an inherited one. Only one pool can be inherited
        from the parent account.
      operationId: GET-v3-ip-pools
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    ip_pools:
                      - description: long description of the dedicated IP pool
                        ips:
                          - 1.0.0.1
                          - 1.0.0.2
                        is_inherited: true
                        is_linked: true
                        name: short name of the dedicated IP pool
                        pool_id: the id of the dedicated IP pool
                    message: success
      security:
        - basicAuth: []
    post:
      tags:
        - IP Pools
      summary: Add a new DIPP to the account
      description: |-
        The account must have 'DIPPs' feature enabled.

        Returns the id of the newly created DIPP.
      operationId: POST-v3-ip-pools
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-ip_pools-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: success
                    pool_id: 658041ae44842b99ee2eaa1b
      security:
        - basicAuth: []
  /v3/ip_pools/{pool_id}:
    get:
      tags:
        - IP Pools
      summary: Get DIPP details
      description: >-
        `is_linked` in the response indicates whether the DIPP is currently
        linked to any

        domains. If it's `true`, `linked_domain` lists those domains.
      operationId: GET-v3-ip-pools--pool-id-
      parameters:
        - name: pool_id
          in: path
          description: Id of the DIPP to get details about
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    details:
                      description: A long description of the DIPP
                      ips:
                        - 1.2.3.4
                        - 5.6.7.8
                      is_linked: true
                      linked_domains:
                        - a.example.com
                        - b.example.com
                      name: DIPP's short name
                      pool_id: 658041ae44842b99ee2eaa1b
                    message: success
      security:
        - basicAuth: []
    delete:
      tags:
        - IP Pools
      summary: Delete the DIPP
      description: >-
        The `DIPPs` feature must be enabled for the account.


        It is not allowed to delete a DIPP inherited from the parent account.


        If the DIPP is delegated to subaccounts, those will also be updated.


        If the replacement DIPP is specified, all domains linked to the deleted
        DIPP will be

        relinked to the replacement DIPP. The latter must contain at least one
        IP.


        If the replacement IP is specified, all domains linked to the deleted
        DIPP will be

        unlinked, and the replacement IP will be assigned to them. It is not
        allowed to

        delete a DIPP inherited from the parent account and replace it with an
        IP

        (subaccounts do not explicitly manage their IPs).


        The replacement IP must be a dedicated one; it can't belong to another
        DIPP. If a

        special value `shared` is used, appropriate shared IPs will be used (the
        account must

        be eligible for shared IPs in this case).


        Omitting both replacement DIPP and replacement IP is allowed only if the
        DIPP being

        deleted contains no IPs.


        The processing of affected domains and subaccounts happens
        asynchronously after the

        endpoint returns a response.
      operationId: DELETE-v3-ip-pools--pool-id-
      parameters:
        - name: pool_id
          in: path
          description: Id of the DIPP to delete
          required: true
          schema:
            type: string
        - name: ip
          in: query
          description: Replacement IP or a special value `shared`
          required: true
          schema:
            type: string
        - name: pool_id
          in: query
          description: Id of the replacement DIPP
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    allowed:
                      dedicated: 1
                      shared: 2
      security:
        - basicAuth: []
    patch:
      tags:
        - IP Pools
      summary: Edit DIPP
      description: >-
        The account must have 'DIPPs' feature enabled.


        It's not allowed to edit a DIPP inherited from the parent account.


        IPs being added to the DIPP must be dedicated ones and belong to the
        account.


        If IPs of the DIPP end up modified, and the DIPP is linked to domains,
        the domains

        will be updated asynchronously (after this endpoint returns response).


        Returns an error if the passed parameters won't result in any changes.
      operationId: PATCH-v3-ip-pools--pool-id-
      parameters:
        - name: pool_id
          in: path
          description: Id of the DIPP to edit
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PATCH-v3-ip_pools-pool_id-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v3/ip_pools/{pool_id}/domains:
    get:
      tags:
        - IP Pools
      summary: Get domains linked to DIPP
      description: |-
        Returns a paginated list of domains that are linked to the specified
        dedicated IP pool.
      operationId: GET-v3-ip-pools--pool-id--domains
      parameters:
        - name: pool_id
          in: path
          description: Id of the DIPP to get details about
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: The maximum number of records to return
          schema:
            type: integer
            maximum: 500
            minimum: 10
            default: 10
        - name: page
          in: query
          description: Encoded page identifier retrieved from previous call
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    paging:
                      first: >-
                        http://api.mailgun.net/v3/ip_pools/68d17866ba9d5506cbc2e274/domains?page=eyJj...
                      next: >-
                        http://api.mailgun.net/v3/ip_pools/68d17866ba9d5506cbc2e274/domains?page=eyJj...
                    domains:
                      - id: 68d17866ba9d5506cbc2e275
                        name: example1.com
                      - id: 68d17866ba9d5506cbc2e276
                        name: example2.com
      security:
        - basicAuth: []
  /v3/ip_pools/{pool_id}/ips/{ip}:
    put:
      tags:
        - IP Pools
      summary: Add an IP to a DIPP
      description: >-
        The account must have 'DIPPs' feature enabled.


        It is not allowed to modify a DIPP inherited from the parent account.


        The IP must be a dedicated one, belong to the account and not belong to
        any other

        DIPP.


        All domains linked to the DIPP will be updated so that their IPs include
        the newly

        added address. If the DIPP is delegated to subaccounts, those will also
        be updated.


        The processing of affected domains and subaccounts happens
        asynchronously after the

        endpoint returns a response.
      operationId: PUT-v3-ip-pools--pool-id--ips--ip-
      parameters:
        - name: ip
          in: path
          description: IP to add to the DIPP
          required: true
          schema:
            type: string
        - name: pool_id
          in: path
          description: Id of the DIPP to update
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: started
      security:
        - basicAuth: []
    delete:
      tags:
        - IP Pools
      summary: Remove an IP from a DIPP
      description: >-
        The account must have 'DIPPs' feature enabled.


        It's not allowed to edit a DIPP inherited from the parent account.


        If the DIPP is linked to domains, the domains will be updated
        asynchronously (after

        this endpoint returns response).
      operationId: DELETE-v3-ip-pools--pool-id--ips--ip-
      parameters:
        - name: ip
          in: path
          description: The IP to remove
          required: true
          schema:
            type: string
        - name: pool_id
          in: path
          description: The id of the DIPP
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: started
      security:
        - basicAuth: []
  /v3/ip_pools/{pool_id}/ips.json:
    post:
      tags:
        - IP Pools
      summary: Add multiple IPs to the DIPP
      description: >-
        The account must have 'DIPPs' feature enabled.


        It is not allowed to modify a DIPP inherited from the parent account.


        All IPs must be dedicated ones, belong to the account and not belong to
        any other

        DIPP.


        All domains linked to the DIPP will be updated so that their IPs include
        the newly

        added addresses. If the DIPP is delegated to subaccounts, those will
        also be updated.


        The processing of affected domains and subaccounts happens
        asynchronously after the

        endpoint returns a response.
      operationId: POST-v3-ip-pools--pool-id--ips-json
      parameters:
        - name: pool_id
          in: path
          description: Id of the DIPP to update
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-tower-api-ip_pools-add_ip-addMultipleIPsRequestBody
            examples:
              Example:
                value:
                  ips:
                    - 1.2.3.4
                    - 5.6.7.8
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value:
                    message: started
      security:
        - basicAuth: []
  /v3/ip_warmups:
    get:
      tags:
        - IP Address Warmup
      summary: Retrieves the list of in-flight IP address warmup statuses.
      description: >-
        Retrieves a list of in-flight IP warmup statuses for dedicated IP
        addresses owned by the account. The response includes pagination URLs
        for navigating through the results.
      operationId: GET-v3-ip-warmups
      parameters:
        - name: page
          in: query
          description: The page to retrieve. If not specified, the first page is returned.
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            The number of results to return per page. Defaults to 10 if not
            specified.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    items:
                      - ip: 1.0.0.1
                        sent_within_stage: 0%
                        throttle: 78
                        stage_number: 3
                        stage_start_volume: 14000
                        stage_start_time: '2025-01-01T00:00:00Z'
                        stage_volume_limit: 4000
                      - ip: 1.0.0.2
                        sent_within_stage: 25%
                        throttle: 90
                        stage_number: 4
                        stage_start_volume: 10000
                        stage_start_time: '2025-01-01T00:00:00Z'
                        stage_volume_limit: 8000
                    paging:
                      first: first
                      next: next
      security:
        - basicAuth: []
  /v3/ip_warmups/{addr}:
    get:
      tags:
        - IP Address Warmup
      summary: Retrieves the status of an in-flight IP warmup
      description: >-
        Retrieves the status of an in-flight IP warmup, which must be a
        dedicated IP owned by the account.
      operationId: GET-v3-ip-warmups--addr-
      parameters:
        - name: addr
          in: path
          description: The IP address to retrieve the warmup status for.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    details:
                      sent_within_stage: 20%
                      throttle: 78
                      start_volume: 10000
                      stage: 2
                      stage_limit: 4000
                      hourly_limit: 100
                      stage_started_at: '2025-01-01T00:00:00Z'
                      hour_started_at: '2025-01-01T00:00:00Z'
                      plan_started_at: '2025-01-01T00:00:00Z'
                      plan_last_updated_at: '2025-01-01T00:00:00Z'
                      total_stages: 15
                      stage_history:
                        - first_updated_at: '0001-01-01T00:00:00Z'
                          completed_at: '2025-06-03T21:33:55.000000123Z'
                          limit: 1000
                        - first_updated_at: '0001-01-01T00:00:00Z'
                          completed_at: '2025-06-04T18:11:20.000000456Z'
                          limit: 2000
                        - first_updated_at: '0001-01-01T00:00:00Z'
                          completed_at: '2025-06-04T14:22:17.000000789Z'
                          limit: 4000
      security:
        - basicAuth: []
    post:
      tags:
        - IP Address Warmup
      summary: Creates a warmup plan for an IP Address
      description: >-
        Creates a new warmup plan for an IP address. The IP must be dedicated
        and owned by the account.
      operationId: POST-v3-ip-warmups--addr-
      parameters:
        - name: addr
          in: path
          description: The IP address to create the warmup plan for.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
    delete:
      tags:
        - IP Address Warmup
      summary: Cancels the warmup plan for an IP address
      description: >-
        Cancels the warmup plan for an IP address. The IP must be dedicated and
        owned by the account.
      operationId: DELETE-v3-ip-warmups--addr-
      parameters:
        - name: addr
          in: path
          description: The IP address to cancel the warmup plan for.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v1/dynamic_pools/domains:
    get:
      tags:
        - Dynamic IP Pools
      summary: List all domains assigned to dynamic IP pools
      description: >-
        Retrieves all domains enrolled in dynamic IP pools across the parent
        account and subaccounts.
      operationId: GET-v1-dynamic-pools-domains
      parameters:
        - name: limit
          in: query
          description: The maximum number of domains to return
          schema:
            type: integer
            maximum: 100
            minimum: 1
        - name: account
          in: query
          description: Filter domains by account ID. Can be specified multiple times.
          schema:
            type: string
        - name: pool
          in: query
          description: >-
            Filter domains to a specific Dynamic IP Pool. Can be specified
            multiple times.
          schema:
            type: string
        - name: sort_by
          in: query
          description: Specify which field to use to sort domains
          schema:
            type: string
            enum:
              - bounce_rate
              - complaint_rate
              - name
            default: name
            x-enumDescriptions:
              bounce_rate: Sort domains by bounce rate
              complaint_rate: Sort domains by complaint rate
              name: Sort domains alphabetically by name
        - name: sort_order
          in: query
          description: Specify which field to use to sort domains
          schema:
            type: string
            enum:
              - ascending
              - descending
            default: ascending
            x-enumDescriptions:
              ascending: Sort domains ascending by the specified sort_by field
              descending: Sort domains descending by the specified sort_by field
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bandersnatch-api-DomainListResponse
              examples:
                Example:
                  value:
                    items:
                      - id: 68d16780d1ffb196ac7b2cc8
                        account_id: 68d16780d1ffb196ac7b2cc9
                        name: example.com
                        registered_at: '0001-01-01T00:00:00Z'
                        pool: dynamic_good
                        bounce_rate: 0.01
                        complaint_rate: 0.1
                        processed_count: 100
                      - id: 68d16780d1ffb196ac7b2cca
                        account_id: 68d16780d1ffb196ac7b2ccb
                        name: example.com
                        registered_at: '0001-01-01T00:00:00Z'
                        pool: dynamic_good
                        bounce_rate: 0.01
                        complaint_rate: 0
                        processed_count: 100
                    total_items: 2
                    paging: {}
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: description of the error
      security:
        - basicAuth: []
  /v1/dynamic_pools/domains/{name}/preview:
    get:
      tags:
        - Dynamic IP Pools
      summary: Preview domain assignment
      description: >-
        Runs a health check on a domain and returns which pool it would be
        placed in. It does NOT enroll the domain or set the band
      operationId: GET-v1-dynamic-pools-domains--name--preview
      parameters:
        - name: name
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-Response
              examples:
                Example:
                  value:
                    pool: dynamic_poor
                    results:
                      bounce_rate:
                        value: 0.25
                        band: dynamic_poor
                      complaint_rate:
                        value: 0.0002
                        band: dynamic_good
                      processed_count:
                        value: 25000
                        band: dynamic_good
      security:
        - basicAuth: []
  /v1/dynamic_pools/domains/{name}/history:
    get:
      tags:
        - Dynamic IP Pools
      summary: List domain history
      description: Retrieves a domain's history records
      operationId: GET-v1-dynamic-pools-domains--name--history
      parameters:
        - name: name
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bandersnatch-model-HistoryRecord
              examples:
                Example:
                  value:
                    id: '000000000000000000000000'
                    owning_account_id: '000000000000000000000000'
                    account_id: 68d16780d1ffb196ac7b2ccd
                    domain_id: 68d16780d1ffb196ac7b2ccc
                    domain_name: test.com
                    new_band: dynamic_good
                    prev_band: dynamic_poor
                    reason: Multiple metrics in good threshold
                    bounce_rate: 0.2
                    complaint_rate: 0.1
                    processed_count: 100
                    timestamp: '2025-09-22T11:13:04.740262-04:00'
      security:
        - basicAuth: []
  /v1/dynamic_pools/domains/{name}/override:
    put:
      tags:
        - Dynamic IP Pools
      summary: Override domain assignment
      description: >-
        Overrides a domain's dynamic IP pool assignment. A domain's pool will
        not be updated by health checks while an override is present.
      operationId: PUT-v1-dynamic-pools-domains--name--override
      parameters:
        - name: name
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v1-dynamic_pools-domains-name-override-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-Response
              examples:
                Example:
                  value:
                    message: success
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-InvalidParameterError
              examples:
                Example:
                  value:
                    Field: pool
                    Value: invalid_name
      security:
        - basicAuth: []
    delete:
      tags:
        - Dynamic IP Pools
      summary: Remove override
      description: >-
        Removes any dynamic IP pool override for a domain. The domain's pool
        assignment will be managed by health checks.
      operationId: DELETE-v1-dynamic-pools-domains--name--override
      parameters:
        - name: name
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-Response
              examples:
                Example:
                  value:
                    message: success
      security:
        - basicAuth: []
  /v1/dynamic_pools/history:
    get:
      tags:
        - Dynamic IP Pools
      summary: List account history
      description: >-
        Retrieve history records for all domains assigned to Dynamic IP Pools
        across the parent and subaccounts.
      operationId: GET-v1-dynamic-pools-history
      parameters:
        - name: Limit
          in: query
          description: The maximum number of events to return
          schema:
            type: integer
            maximum: 100
            minimum: 1
        - name: include_subaccounts
          in: query
          description: >-
            If true, includes events from all subaccounts in addition to events
            from the parent account
          schema:
            type: boolean
        - name: domain
          in: query
          description: Filter events by domain name
          schema:
            type: string
        - name: before
          in: query
          description: >-
            Filter events emitted before a given timestamp (Format: Mon, 02 Jan
            2006 15:04:05 MST)
          schema:
            type: string
        - name: after
          in: query
          description: >-
            Filter events emitted after a given timestamp (Format: Mon, 02 Jan
            2006 15:04:05 MST)
          schema:
            type: string
        - name: moved_to
          in: query
          description: >-
            Filter events by which Dynamic Pool a domain was moved to (ex.
            dynamic_good, dynamic_poor, etc.)
          schema:
            type: string
        - name: moved_from
          in: query
          description: >-
            Filter events by which Dynamic Pool a domain was moved from (ex.
            dynamic_good, dynamic_poor, etc.)
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bandersnatch-api-ListHistoryResponse
              examples:
                Example:
                  value:
                    items:
                      - id: 68d16780d1ffb196ac7b2cce
                        owning_account_id: '000000000000000000000000'
                        account_id: 68d16780d1ffb196ac7b2ccf
                        account_name: My Account
                        domain_id: 68d16780d1ffb196ac7b2cd0
                        domain_name: test.com
                        new_band: dynamic_good
                        prev_band: dynamic_poor
                        reason: bounce_rate in good threshold
                        bounce_rate: 0.04
                        complaint_rate: 0.0001
                        initiated_by: system
                        timestamp: '0001-01-01T00:00:00Z'
                      - id: 68d16780d1ffb196ac7b2cd1
                        owning_account_id: '000000000000000000000000'
                        account_id: 68d16780d1ffb196ac7b2cd2
                        account_name: My Account
                        domain_id: 68d16780d1ffb196ac7b2cd3
                        domain_name: test.com
                        new_band: dynamic_good
                        prev_band: dynamic_new
                        reason: Multiple metrics in good threshold
                        bounce_rate: 0.04
                        complaint_rate: 0.0001
                        initiated_by: system
                        timestamp: '0001-01-01T00:00:00Z'
                    total_items: 2
                    paging: {}
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: description of the error
      security:
        - basicAuth: []
  /v3/{domain_name}/envelopes:
    delete:
      tags:
        - Messages
      summary: Delete scheduled and undelivered mail
      description: >-
        Deletes all scheduled and undelivered mail from the domain queue.  This
        endpoint must be called on the same storage API host as the mail's
        generated storage URL.  e.g.
        https://storage-us-east4.api.mailgun.net/v3/example.com/envelopes


        The storage hosts are: `storage-us-east4.api.mailgun.net`,
        `storage-us-west1.api.mailgun.net`, and
        `storage-europe-west1.api.mailgun.net`.
      operationId: DELETE-v3--domain-name--envelopes
      parameters:
        - name: domain_name
          in: path
          description: The name of the domain you want to delete envelope from
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: done
        '401':
          description: A 401 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid private key
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: domain not found
      security:
        - basicAuth: []
  /v2/x509/{domain}/status:
    get:
      tags:
        - Domain Tracking
      summary: 'Tracking Certificate: Get certificate and status'
      description: Get x509 TLS certificate and status
      operationId: GET-v2-x509--domain--status
      parameters:
        - name: domain
          in: path
          description: >-
            The tracking domain of the TLS certificate, formatted as
            `web_prefix.domain_name` (`web_prefix` is configured in your domains
            settings)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-terminator-httpapi-StatusResponse
              examples:
                Processing:
                  value:
                    status: processing
                    error: Waiting for x509 key pair generation
                Active:
                  value:
                    status: active
                    certificate: '{CERT}'
                Expired:
                  value:
                    status: expired
                    error: x509 certificate has expired
                    certificate: '{CERT}'
                Error:
                  value:
                    status: error
                    error: >-
                      TLS x509 key pair generation failed, please contact
                      support
                    certificate: '{CERT}'
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-NotFoundError
              examples:
                Example:
                  value:
                    Description: >-
                      Please initiate x509 key pair generation at POST
                      /v2/x509/{domain}
      security:
        - basicAuth: []
  /v2/x509/{domain}:
    put:
      tags:
        - Domain Tracking
      summary: 'Tracking Certificate: Regenerate expired certificate'
      description: >-
        Initiates regeneration of an expired TLS certificate for the tracking
        domain in a background task.  Once generation is enqueued, you may poll
        status endpoint in location field to check for success.  This will not
        regenerate an existing certificate that is still valid
      operationId: PUT-v2-x509--domain-
      parameters:
        - name: domain
          in: path
          description: >-
            The tracking domain of the TLS certificate, formatted as
            webPrefix.domainName from domains settings
          required: true
          schema:
            type: string
      responses:
        '202':
          description: A 202 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-terminator-httpapi-GenerateResponse
              examples:
                Example:
                  value:
                    message: Initiated x509 key pair generation
                    location: /v2/x509/example.com/status
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: invalid CNAME record
        '402':
          description: A 402 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: upgrade your account to enable this feature
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-NotFoundError
              examples:
                Example:
                  value:
                    Description: x509 cert not found
        '409':
          description: A 409 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-ConflictError
              examples:
                Example:
                  value:
                    Description: >-
                      x509 certificate is still valid until 2009-11-10 23:00:00
                      +0000 UTC
        '429':
          description: A 429 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-ConflictError
              examples:
                Example:
                  value:
                    Description: >-
                      x509 key pair generation job is already in progress for
                      example.com
      security:
        - basicAuth: []
    post:
      tags:
        - Domain Tracking
      summary: 'Tracking Certificate: Generate'
      description: >-
        Initiates generation of a TLS certificate for the tracking domain in a
        background task.  Once generation is enqueued, you may poll the status
        endpoint in `location` field to check for success
      operationId: POST-v2-x509--domain-
      parameters:
        - name: domain
          in: path
          description: >-
            The tracking domain of the TLS certificate, formatted as
            webPrefix.domainName from domains settings
          required: true
          schema:
            type: string
      responses:
        '202':
          description: A 202 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-terminator-httpapi-GenerateResponse
              examples:
                Example:
                  value:
                    message: Initiated x509 key pair generation
                    location: /v2/x509/example.com/status
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: invalid CNAME record
        '402':
          description: A 402 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericAPIError
              examples:
                Example:
                  value:
                    Reason: upgrade your account to enable this feature
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-NotFoundError
              examples:
                Example:
                  value:
                    Description: x509 cert not found
        '409':
          description: A 409 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-ConflictError
              examples:
                Example:
                  value:
                    Description: >-
                      x509 key pair generation has already been initiated for
                      example.com
      security:
        - basicAuth: []
  /v3/{domain_name}/events:
    get:
      tags:
        - Events
      summary: Retrieves a paginated list of events
      description: >
        Mailgun tracks every inbound and outbound message event and retains this
        data for at least 3 days.

        See [Filter
        expression](https://documentation.mailgun.com/docs/mailgun/user-manual/events/#filter-expression)
        for details about filtering expressions
      operationId: get-v3-domain_name-events
      parameters:
        - name: begin
          in: query
          description: The beginning of the search time range in epoch seconds
          schema:
            type: string
        - name: end
          in: query
          description: The end of the search time range in epoch seconds
          schema:
            type: string
        - name: ascending
          in: query
          description: >-
            Sort direction by time. Must be provided if the range end time is
            not specified. Can be either yes or no
          schema:
            type: string
            enum:
              - 'yes'
              - 'no'
            x-enumDescriptions:
              'yes': Sort by ascending time
              'no': Do not sort
        - name: limit
          in: query
          description: The number of entries to return (300 max)
          schema:
            type: integer
            maximum: 300
        - name: event
          in: query
          description: Filter by event type
          schema:
            type: string
        - name: list
          in: query
          description: >-
            Filter by mailing list email address that message was originally
            sent to
          schema:
            type: string
        - name: attachment
          in: query
          description: Filter by the name of an attached file
          schema:
            type: string
        - name: from
          in: query
          description: Filter by email address mentioned in the From MIME header
          schema:
            type: string
        - name: message-id
          in: query
          description: Filter by Mailgun message id returned by the messages API
          schema:
            type: string
        - name: subject
          in: query
          description: Filter by subject line
          schema:
            type: string
        - name: to
          in: query
          description: Filter by email address mentioned in the To MIME header
          schema:
            type: string
        - name: size
          in: query
          description: >-
            Filter by message size. Mostly intended to be used with range
            filtering expressions
          schema:
            type: string
        - name: recipient
          in: query
          description: >-
            Filter by email address of a recipient. While messages are
            addressable to one or more recipients, each event (with one
            exception) tracks one recipient. See stored events for use of
            recipients
          schema:
            type: string
        - name: recipients
          in: query
          description: >-
            Specific to stored events, this field tracks all of the potential
            message recipients.
          schema:
            type: string
        - name: tags
          in: query
          description: Filter by user defined tags
          schema:
            type: string
        - name: severity
          in: query
          description: >-
            Filter by event severity, if exists. Currently for failed events
            only. See [Tracking
            Failures](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/#tracking-failures)
          schema:
            $ref: '#/components/schemas/EventSeverityType'
        - name: domain_name
          in: path
          description: Filter by sending domain
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/EventResponse'
                  paging:
                    type: object
                    properties:
                      next:
                        type: string
                      previous:
                        type: string
              examples:
                Rejected:
                  value:
                    items:
                      - event: rejected
                        id: OMTXD3-sSmKIQa1gSKkYVA
                        timestamp: 1529704976.104692
                        log-level: warn
                        flags:
                          is-test-mode: false
                        reject:
                          reason: >-
                            Sandbox subdomains are for test purposes only.
                            Please add your own domain or add the address to
                            authorized recipients in Account Settings.
                          description: ''
                        message:
                          headers:
                            to: joan@example.org
                            message-id: >-
                              20180622220256.1.B31A451A2E5422BB@sandbox55887fac92de874df5ae0023b75fd62f1d.mailgun.org
                            from: >-
                              john@sandbox55887fac92de874df5ae0023b75fd62f1d.mailgun.org
                            subject: Test Subject
                          attachments: []
                          size: 867
                        tags: []
                        user-variables: {}
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Stored:
                  value:
                    items:
                      - event: stored
                        id: WRVmVc47QYi4DHth_xpRUA
                        timestamp: 1529692198.691758
                        log-level: info
                        flags:
                          is-test-mode: false
                        message:
                          headers:
                            to: team@example.org
                            message-id: 20180622182958.1.48906CB188F1A454@exmple.org
                            from: sender@example.org
                            subject: Test Subject
                          attachments: []
                          recipients:
                            - team@example.org
                          size: 586
                        storage:
                          url: >-
                            https://se.api.mailgun.net/v3/domains/example.org/messages/eyJwI...
                          key: eyJwI...
                        tags: []
                        user-variables: {}
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Complained:
                  value:
                    items:
                      - event: complained
                        id: ncV2XwymRUKbPek_MIM-Gw
                        timestamp: 1377214260.049634
                        log-level: warn
                        recipient: foo@example.com
                        tags: []
                        user-variables: {}
                        flags:
                          is-test-mode: false
                        message:
                          headers:
                            to: foo@example.com
                            message-id: 20130718032413.263EE2E0926@example.com
                            from: John Doe <sender@example.com>
                            subject: This is the subject.
                          attachments: []
                          size: 18937
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Unsubscribed:
                  value:
                    items:
                      - event: unsubscribed
                        id: W3X4JOhFT-OZidZGKKr9iA
                        timestamp: 1377213791.421473
                        log-level: info
                        recipient: recipient@example.com
                        geolocation:
                          country: US
                          region: TX
                          city: San Antonio
                        tags: []
                        user-variables: {}
                        ip: 23.23.23.345
                        client-info:
                          client-type: browser
                          client-os: OS X
                          device-type: desktop
                          client-name: Chrome
                          user-agent: >-
                            Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4)
                            AppleWebKit/537.36 (KHTML, like Gecko)
                            Chrome/28.0.1500.95 Safari/537.36
                        message:
                          headers:
                            message-id: 20130822232216.13966.79700@samples.mailgun.org
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Clicked:
                  value:
                    items:
                      - event: clicked
                        id: G5zMz2ysS6OxZ2C8xb2Tqg
                        timestamp: 1377075564.094891
                        log-level: info
                        recipient: recipient@example.com
                        geolocation:
                          country: US
                          region: TX
                          city: Austin
                        tags: []
                        url: http://example.com/signup
                        recipient-provider: Gmail
                        ip: 123.123.123.321
                        user-variables: {}
                        client-info:
                          client-type: browser
                          client-os: Linux
                          device-type: desktop
                          client-name: Chromium
                          user-agent: >-
                            Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36
                            (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71
                            Chrome/28.0.1500.71 Safari/537.36
                          bot: ''
                        message:
                          headers:
                            message-id: 20130821085807.30688.67706@samples.mailgun.org
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Opened:
                  value:
                    items:
                      - event: opened
                        id: '-laxIqj9QWubsjY_3pTq_g'
                        timestamp: 1377047343.042277
                        log-level: info
                        recipient: recipient@example.com
                        recipient-provider: Gmail
                        geolocation:
                          country: US
                          region: Texas
                          city: Austin
                        tags: []
                        user-variables: {}
                        ip: 111.111.111.111
                        client-info:
                          client-type: mobile browser
                          client-os: iOS
                          device-type: mobile
                          client-name: Mobile Safari
                          user-agent: >-
                            Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS
                            X) AppleWebKit/536.26 (KHTML, like Gecko)
                            Mobile/10B143
                          bot: ''
                        message:
                          headers:
                            message-id: 20130821005614.19826.35976@samples.mailgun.org
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Failed:
                  value:
                    items:
                      - event: failed
                        id: pl271FzxTTmGRW8Uj3dUWw
                        timestamp: 1529701969.818328
                        log-level: error
                        severity: permanent
                        reason: suppress-bounce
                        envelope:
                          sender: john@example.org
                          transport: smtp
                          targets: joan@example.com
                        flags:
                          is-routed: false
                          is-authenticated: true
                          is-system-test: false
                          is-test-mode: false
                        delivery-status:
                          attempt-no: 1
                          message: ''
                          code: 605
                          description: Not delivering to previously bounced address
                          session-seconds: 0
                        message:
                          headers:
                            to: joan@example.com
                            message-id: 20180622211249.1.2A6098970A380E12@example.org
                            from: john@example.org
                            subject: Test Subject
                          attachments: []
                          size: 867
                        storage:
                          url: >-
                            https://se.api.mailgun.net/v3/domains/example.org/messages/eyJwI...
                          key: eyJwI...
                        recipient: slava@mailgun.com
                        recipient-domain: mailgun.com
                        recipient-provider: Gmail
                        tags: []
                        user-variables: {}
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Delivered:
                  value:
                    items:
                      - event: delivered
                        id: hK7mQVt1QtqRiOfQXta4sw
                        timestamp: 1529692199.626182
                        log-level: info
                        envelope:
                          transport: smtp
                          sender: sender@example.org
                          sending-ip: 123.123.123.123
                          targets: john@example.com
                        flags:
                          is-routed: false
                          is-authenticated: false
                          is-system-test: false
                          is-test-mode: false
                        delivery-status:
                          tls: true
                          mx-host: aspmx.l.example.com
                          code: 250
                          description: ''
                          session-seconds: 0.4367079734802246
                          utf8: true
                          attempt-no: 1
                          message: OK
                          certificate-verified: true
                        message:
                          headers:
                            to: team@example.org
                            message-id: 20180622182958.1.48906CB188F1A454@exmple.org
                            from: sender@exmple.org
                            subject: Test Subject
                          attachments: []
                          size: 586
                        storage:
                          url: >-
                            https://storage-us-west1.api.mailgun.net/v3/domains/...
                          region: us-west1
                          key: AwABB...
                          env: production
                        recipient: john@example.com
                        recipient-domain: example.com
                        recipient-provider: Gmail
                        tags: []
                        user-variables: {}
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
                Accepted:
                  value:
                    items:
                      - event: accepted
                        id: jxVuhYlhReaK3QsggHfFRA
                        timestamp: 1529692198.641821
                        log-level: info
                        method: smtp
                        envelope:
                          targets: team@example.org
                          transport: smtp
                          sender: sender@example.org
                        flags:
                          is-authenticated: false
                        message:
                          headers:
                            to: team@example.org
                            message-id: 20180622182958.1.48906CB188F1A454@exmple.org
                            from: sender@example.org
                            subject: Test Subject
                          attachments: []
                          recipients:
                            - team@example.org
                          size: 586
                        storage:
                          url: >-
                            https://se.api.mailgun.net/v3/domains/example.org/messages/eyJwI...
                          key: eyJwI...
                        recipient: team@example.org
                        recipient-domain: example.org
                        tags: []
                        user-variables: {}
                    paging:
                      next: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/W3siY...
                      previous: >-
                        https://api.mailgun.net/v3/samples.mailgun.org/events/Lkawm...
      security:
        - basicAuth: []
  /v3/{domain}/tags:
    get:
      tags:
        - Tags
      summary: List all tags
      description: List all tags associated with a domain
      deprecated: true
      operationId: GET-v3--domain--tags
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: >-
            The page direction based on the tag parameter; valid choices are
            (first, last, next, prev)
          schema:
            type: string
        - name: limit
          in: query
          description: Limits the number of items returned in a request
          schema:
            type: integer
        - name: tag
          in: query
          description: >-
            The tag that marks the end of the current page and the start of the
            next
          schema:
            type: string
        - name: prefix
          in: query
          description: List only tags that begin with this prefix
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-TagListResponse
              examples:
                Example:
                  value:
                    items:
                      - tag: my-tag-1
                        description: Optional description
                        first-seen: 2023-01-02 02:14:27 +0000 UTC
                        last-seen: 2023-09-06 18:45:51 +0000 UTC
                      - tag: my-tag-2
                        description: Optional description
                        first-seen: 2023-01-02 02:14:27 +0000 UTC
                        last-seen: 2023-09-06 18:45:51 +0000 UTC
                    paging:
                      previous: >-
                        https://api.mailgun.net/v3/example.com/tags?limit=1000&page=prev&tag=
                      first: >-
                        https://api.mailgun.net/v3/example.com/tags?limit=1000&page=first&tag=
                      next: >-
                        https://api.mailgun.net/v3/example.com/tags?limit=1000&page=next&tag=
                      last: >-
                        https://api.mailgun.net/v3/example.com/tags?limit=1000&page=last&tag=
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/tag:
    get:
      tags:
        - Tags
      summary: Get a tag
      description: Get a tag associated with a domain
      deprecated: true
      operationId: GET-v3--domain--tag
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
        - name: tag
          in: query
          description: The name of the tag
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-model-tags-TagItem
              examples:
                Example:
                  value:
                    tag: my-tag-1
                    description: Optional description
                    first-seen: 2023-01-02 02:14:27 +0000 UTC
                    last-seen: 2023-09-06 18:45:51 +0000 UTC
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
    put:
      tags:
        - Tags
      summary: 'Update tag '
      description: Update a tag associated with a domain
      deprecated: true
      operationId: PUT-v3--domain--tag
      parameters:
        - name: domain
          in: path
          description: The domain id
          required: true
          schema:
            type: string
        - name: tag
          in: query
          description: The name of the tag
          required: true
          schema:
            type: string
        - name: description
          in: query
          description: The description of the tag
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Tag updated
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
    delete:
      tags:
        - Tags
      summary: Delete tag
      description: Delete a tag associated with a domain
      deprecated: true
      operationId: DELETE-v3--domain--tag
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
        - name: tag
          in: query
          description: The name of the tag
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Tag deleted
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/tag/stats/aggregates:
    get:
      tags:
        - Tags
      summary: Get aggregate stat types by tag
      description: Returns a list  for a given domain for different event types
      deprecated: true
      operationId: GET-v3--domain--tag-stats-aggregates
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
        - name: tag
          in: query
          description: The name of the tag
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: The type of aggregate (country, device, provider)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-TagAggregateResponse
              examples:
                Example:
                  value:
                    tag: tag1
                    provider:
                      aol.com:
                        accepted: 0
                        clicked: 1
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
                      gmail.com:
                        accepted: 0
                        clicked: 2
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/tag/stats:
    get:
      tags:
        - Tags
      summary: Get stats by tag
      description: Retrieve stats by tag
      deprecated: true
      operationId: GET-v3--domain--tag-stats
      parameters:
        - name: domain
          in: path
          description: The domain id
          required: true
          schema:
            type: string
        - name: start
          in: query
          description: >-
            The start date in RFC 2822 format or unix epoch (default: 7 days
            ago)
          schema:
            type: string
        - name: end
          in: query
          description: >-
            The end date in RFC 2822 format or unix epoch (default: current
            time) 
          schema:
            type: string
        - name: resolution
          in: query
          description: >-
            The gregorian resolution the query is for 'day, month, hour`
            (default: day)
          schema:
            type: string
        - name: duration
          in: query
          description: >-
            If duration is provided than it's calculated from the 'end' date and
            overwrites the 'start' date
          schema:
            type: string
        - name: provider
          in: query
          description: >-
            The provider value; see `GET /v3/domains/1/tag/providers` for
            possible values
          schema:
            type: string
        - name: device
          in: query
          description: >-
            The device value; see `GET /v3/domains/1/tag/devices` for possible
            values
          schema:
            type: string
        - name: country
          in: query
          description: >-
            The country value; see `GET /v3/domains/1/tag/providers` for
            possible values
          schema:
            type: string
        - name: event
          in: query
          description: >-
            Name of the event(s) to receive the stats for (Multiple events are
            allowed). Supported events are: accepted, delivered, failed, opened,
            clicked, unsubscribed, complained, stored
          required: true
          schema:
            type: string
        - name: tag
          in: query
          description: The name of the tag
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatsResponse
              examples:
                Example:
                  value:
                    tag: tag1
                    description: Optional Description
                    start: Tue, 14 Feb 2012 00:00:00 UTC
                    end: Fri, 01 Apr 2012 00:00:00 UTC
                    resolution: month
                    stats:
                      - time: Fri, 01 Apr 2012 00:00:00 UTC
                        accepted:
                          incoming: 2
                          outgoing: 1
                          total: 3
                        delivered:
                          smtp: 15
                          http: 10
                          optimized: 5
                          total: 20
                        opened:
                          total: 20
                          unique: 1
                        clicked:
                          total: 1
                          unique: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/domains/{domain}/tag/devices:
    get:
      summary: List of supported devices
      description: Gets a list of devices scout currently supports
      operationId: GET-v3-domains--domain--tag-devices
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatTypesResponse
              examples:
                Example:
                  value:
                    items:
                      - desktop
                      - mobile
                      - tablet
                      - unknown
      tags:
        - openapi-scout_other
      security:
        - basicAuth: []
  /v3/domains/{domain}/tag/providers:
    get:
      summary: List of supported providers
      description: Gets a list of providers scout currently supports
      operationId: GET-v3-domains--domain--tag-providers
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatTypesResponse
              examples:
                Example:
                  value:
                    items:
                      - gmail.com
                      - yahoo.com
                      - hotmail.com
                      - aol.com
                      - icloud.com
                      - mail.ru
                      - comcast.net
                      - outlook.com
                      - msn.com
                      - live.com
                      - orange.fr
                      - sbcglobal.net
                      - att.net
                      - ymail.com
                      - hotmail.co.uk
                      - verizon.net
                      - bellsouth.net
                      - me.com
                      - yandex.ru
                      - seznam.cz
                      - yahoo.co.uk
                      - hotmail.fr
                      - yahoo.com.tw
                      - rocketmail.com
                      - mailinator.com
                      - qq.com
      tags:
        - openapi-scout_other
      security:
        - basicAuth: []
  /v3/domains/{domain}/tag/countries:
    get:
      summary: List of supported country codes
      description: Gets a list of country codes scout curently supports
      operationId: GET-v3-domains--domain--tag-countries
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        default:
          description: A default response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatTypesResponse
      tags:
        - openapi-scout_other
      security:
        - basicAuth: []
  /v3/stats/total:
    get:
      tags:
        - Stats
      summary: Totals for entire account
      description: Gets stat totals for an entire account
      operationId: GET-v3-stats-total
      parameters:
        - name: start
          in: query
          description: >-
            The start date in RFC 2822 format or unix epoch (default: 7 days
            ago)
          schema:
            type: string
        - name: end
          in: query
          description: >-
            The end date in RFC 2822 format or unix epoch (default: current
            time) 
          schema:
            type: string
        - name: resolution
          in: query
          description: >-
            The gregorian resolution the query is for 'day, month, hour`
            (default: day)
          schema:
            type: string
        - name: duration
          in: query
          description: >-
            If duration is provided than it's calculated from the 'end' date and
            overwrites the 'start' date
          schema:
            type: string
        - name: event
          in: query
          description: >-
            Name of the event(s) to receive the stats for (Multiple events are
            allowed). Supported events are: accepted, delivered, failed, opened,
            clicked, unsubscribed, complained, stored
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatsResponse
              examples:
                Example:
                  value:
                    description: Optional Description
                    start: Tue, 14 Feb 2012 00:00:00 UTC
                    end: Fri, 01 Apr 2012 00:00:00 UTC
                    resolution: month
                    stats:
                      - time: Fri, 01 Apr 2012 00:00:00 UTC
                        accepted:
                          incoming: 2
                          outgoing: 1
                          total: 3
                        delivered:
                          smtp: 15
                          http: 10
                          optimized: 5
                          total: 20
                        opened:
                          total: 20
                          unique: 1
                        clicked:
                          total: 1
                          unique: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/stats/total:
    get:
      tags:
        - Stats
      summary: Totals for entire domain
      description: Gets stat totals for an entire domain
      operationId: GET-v3--domain--stats-total
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
        - name: start
          in: query
          description: >-
            The start date in RFC 2822 format or unix epoch (default: 7 days
            ago)
          schema:
            type: string
        - name: end
          in: query
          description: >-
            The end date in RFC 2822 format or unix epoch (default: current
            time) 
          schema:
            type: string
        - name: resolution
          in: query
          description: >-
            The gregorian resolution the query is for 'day, month, hour`
            (default: day)
          schema:
            type: string
        - name: duration
          in: query
          description: >-
            If duration is provided than it's calculated from the 'end' date and
            overwrites the 'start' date
          schema:
            type: string
        - name: event
          in: query
          description: >-
            Name of the event(s) to receive the stats for (Multiple events are
            allowed). Supported events are: accepted, delivered, failed, opened,
            clicked, unsubscribed, complained, stored
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatsResponse
              examples:
                Example:
                  value:
                    description: Optional Description
                    start: Tue, 14 Feb 2012 00:00:00 UTC
                    end: Fri, 01 Apr 2012 00:00:00 UTC
                    resolution: month
                    stats:
                      - time: Fri, 01 Apr 2012 00:00:00 UTC
                        accepted:
                          incoming: 2
                          outgoing: 1
                          total: 3
                        delivered:
                          smtp: 15
                          http: 10
                          optimized: 5
                          total: 20
                        opened:
                          total: 20
                          unique: 1
                        clicked:
                          total: 1
                          unique: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/stats/total/domains:
    get:
      tags:
        - Stats
      summary: Totals for account domains for a single time resolution
      description: Gets stat  totals for domains in an account for a single time resolution
      operationId: GET-v3-stats-total-domains
      parameters:
        - name: event
          in: query
          description: >-
            Name of the event(s) to receive the stats for (Multiple events are
            allowed). Supported events are: accepted, delivered, failed, opened,
            clicked, unsubscribed, complained, stored
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Skip x number of domains; used to page through large numbers of
            domains
          schema:
            type: string
        - name: resolution
          in: query
          description: >-
            The gregorian resolution the query is for 'day, month, hour`
            (default: day)
          schema:
            type: string
        - name: timestamp
          in: query
          description: The date/time of the 'resolution' we are retrieving
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatsResponse
              examples:
                Example:
                  value:
                    description: Optional Description
                    start: Tue, 14 Feb 2012 00:00:00 UTC
                    end: Fri, 01 Apr 2012 00:00:00 UTC
                    resolution: month
                    stats:
                      - time: Fri, 01 Apr 2012 00:00:00 UTC
                        accepted:
                          incoming: 2
                          outgoing: 1
                          total: 3
                        delivered:
                          smtp: 15
                          http: 10
                          optimized: 5
                          total: 20
                        opened:
                          total: 20
                          unique: 1
                        clicked:
                          total: 1
                          unique: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/stats/filter:
    get:
      tags:
        - Stats
      summary: Filtered/grouped totals for entire account
      description: Gets filtered and group stat totals for an entire account
      operationId: GET-v3-stats-filter
      parameters:
        - name: start
          in: query
          description: >-
            The start date in RFC 2822 format or unix epoch (default: 7 days
            ago)
          schema:
            type: string
        - name: end
          in: query
          description: >-
            The end date in RFC 2822 format or unix epoch (default: current
            time) 
          schema:
            type: string
        - name: resolution
          in: query
          description: >-
            The gregorian resolution the query is for 'day, month, hour`
            (default: day)
          schema:
            type: string
        - name: duration
          in: query
          description: >-
            If duration is provided than it's calculated from the 'end' date and
            overwrites the 'start' date
          schema:
            type: string
        - name: event
          in: query
          description: >-
            Name of the event(s) to receive the stats for (Multiple events are
            allowed). Supported events are: accepted, delivered, failed, opened,
            clicked, unsubscribed, complained, stored
          required: true
          schema:
            type: string
        - name: filter
          in: query
          description: >-
            A filter for account level metrics such as
            filter=domain:my.example.com
          schema:
            type: string
        - name: group
          in: query
          description: >-
            The key to group metrics by.  Must be one of total, time, day,
            month, domain, ip, provider, tag, country
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-StatsResponse
              examples:
                Example:
                  value:
                    description: Optional Description
                    start: Tue, 14 Feb 2012 00:00:00 UTC
                    end: Fri, 01 Apr 2012 00:00:00 UTC
                    resolution: month
                    stats:
                      - time: Fri, 01 Apr 2012 00:00:00 UTC
                        accepted:
                          incoming: 2
                          outgoing: 1
                          total: 3
                        delivered:
                          smtp: 15
                          http: 10
                          optimized: 5
                          total: 20
                        opened:
                          total: 20
                          unique: 1
                        clicked:
                          total: 1
                          unique: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/domains/{domain}/limits/tag:
    get:
      tags:
        - Tags
      summary: Get tag limits
      description: Get tag limits by domain
      deprecated: true
      operationId: GET-v3-domains--domain--limits-tag
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-model-types-TagLimitItem
              examples:
                Example:
                  value:
                    limit: 20000
                    count: 1500
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/aggregates/providers:
    get:
      tags:
        - Stats
      summary: Aggregate counts by ESP
      description: Gets aggregate counts by email service provider
      operationId: GET-v3--domain--aggregates-providers
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-ProvidersAggregateResponse
              examples:
                Example:
                  value:
                    providers:
                      aol.com:
                        accepted: 0
                        clicked: 1
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
                      gmail.com:
                        accepted: 0
                        clicked: 2
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/aggregates/devices:
    get:
      tags:
        - Stats
      summary: 'Aggregate counts by devices triggering events '
      description: >-
        Gets  aggregate counts on devices that triggered events ('tablet',
        'phone', 'pc', etc…)
      operationId: GET-v3--domain--aggregates-devices
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-DevicesAggregateResponse
              examples:
                Example:
                  value:
                    devices:
                      desktop:
                        accepted: 0
                        clicked: 1
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
                      mobile:
                        accepted: 0
                        clicked: 2
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
                      tablet:
                        accepted: 0
                        clicked: 2
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
                      unknown:
                        accepted: 0
                        clicked: 2
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v3/{domain}/aggregates/countries:
    get:
      tags:
        - Stats
      summary: Aggregate counts by country
      description: Gets aggregate counts by country (USA, RUS, etc…)
      operationId: GET-v3--domain--aggregates-countries
      parameters:
        - name: domain
          in: path
          description: The domain name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scout-api-CountriesAggregateResponse
              examples:
                Example:
                  value:
                    countries:
                      ru:
                        accepted: 0
                        clicked: 2
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
                      us:
                        accepted: 0
                        clicked: 1
                        opened: 1
                        unique_clicked: 1
                        unsubscribed: 0
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v1/analytics/metrics:
    post:
      tags:
        - Metrics
      summary: Post query to get account metrics
      description: Gets filtered metrics for an account
      operationId: POST-v1-analytics-metrics
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-analytics-client-golang-Query
            examples:
              Example:
                value:
                  start: Mon, 13 Nov 2023 20:56:50 -0600
                  end: Wed, 20 Dec 2023 20:56:50 -0600
                  resolution: month
                  duration: 1m
                  dimensions:
                    - time
                  metrics:
                    - accepted_count
                    - delivered_count
                    - clicked_rate
                    - opened_rate
                  filter:
                    AND:
                      - attribute: domain
                        comparator: '='
                        values:
                          - label: example.com
                            value: example.com
                  include_subaccounts: true
                  include_aggregates: true
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-analytics-internal-api-RegularMetricsResponse
              examples:
                Example:
                  value:
                    start: Mon, 13 Nov 2023 20:56:50 -0600
                    end: Wed, 20 Dec 2023 20:56:50 -0600
                    resolution: month
                    duration: 1m
                    pagination:
                      sort: timestamp:asc
                      skip: 1
                      limit: 10
                      total: 1000
                    items:
                      - dimensions:
                          - dimension: time
                            value: Wed, 01 Nov 2023 00:00:00 +0000
                            display_value: Wed, 01 Nov 2023 00:00:00 +0000
                        metrics:
                          accepted_incoming_count: 10
                          accepted_outgoing_count: 30
                          accepted_count: 40
                          delivered_smtp_count: 40
                          delivered_http_count: 20
                          delivered_optimized_count: 0
                          delivered_count: 60
                          opened_count: 55
                          clicked_count: 50
                          clicked_rate: '0.8300'
                      - dimensions:
                          - dimension: time
                            value: Fri, 01 Dec 2023 00:00:00 +0000
                            display_value: Fri, 01 Dec 2023 00:00:00 +0000
                        metrics:
                          accepted_incoming_count: 10
                          accepted_outgoing_count: 30
                          accepted_count: 40
                          delivered_smtp_count: 40
                          delivered_http_count: 20
                          delivered_optimized_count: 0
                          delivered_count: 60
                          opened_count: 55
                          clicked_count: 50
                          clicked_rate: '0.8300'
                    aggregates:
                      metrics: {}
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v1/analytics/usage/metrics:
    post:
      tags:
        - Metrics
      summary: Post query to get account usage metrics
      description: Gets filtered usage metrics for an account
      operationId: POST-v1-analytics-usage-metrics
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-analytics-client-golang-Query
            examples:
              Example:
                value:
                  start: Mon, 13 Nov 2023 20:56:50 -0600
                  end: Wed, 20 Dec 2023 20:56:50 -0600
                  resolution: month
                  duration: 1m
                  dimensions:
                    - time
                  metrics:
                    - accessibility_count
                    - accessibility_failed_count
                    - domain_blocklist_monitoring_count
                    - email_preview_count
                    - email_preview_failed_count
                    - email_validation_bulk_count
                    - email_validation_count
                    - email_validation_list_count
                    - email_validation_mailgun_count
                    - email_validation_mailjet_count
                    - email_validation_public_count
                    - email_validation_single_count
                    - email_validation_valid_count
                    - image_validation_count
                    - image_validation_failed_count
                    - ip_blocklist_monitoring_count
                    - link_validation_count
                    - link_validation_failed_count
                    - processed_count
                    - seed_test_count
                  filter:
                    AND:
                      - attribute: subaccount
                        comparator: '='
                        values:
                          - label: '12345'
                            value: '12345'
                  include_subaccounts: true
                  include_aggregates: true
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-analytics-internal-api-UsageMetricsResponse
              examples:
                Example:
                  value:
                    start: Mon, 13 Nov 2023 20:56:50 -0600
                    end: Wed, 20 Dec 2023 20:56:50 -0600
                    resolution: month
                    duration: 1m
                    pagination:
                      sort: timestamp:asc
                      skip: 1
                      limit: 10
                      total: 1000
                    items:
                      - dimensions:
                          - dimension: time
                            value: Wed, 01 Nov 2023 00:00:00 +0000
                            display_value: Wed, 01 Nov 2023 00:00:00 +0000
                        metrics:
                          processed_count: 3
                          email_validation_count: 50
                          email_validation_public_count: 55
                          email_validation_valid_count: 10
                          email_validation_single_count: 30
                          email_validation_bulk_count: 40
                          email_validation_list_count: 20
                          email_validation_mailgun_count: 40
                          email_validation_mailjet_count: 5
                          email_preview_count: 60
                          email_preview_failed_count: 16
                          link_validation_count: 5
                          link_validation_failed_count: 7
                          seed_test_count: 9
                          ip_blocklist_monitoring_count: 42
                          domain_blocklist_monitoring_count: 1001
                      - dimensions:
                          - dimension: time
                            value: Fri, 01 Dec 2023 00:00:00 +0000
                            display_value: Fri, 01 Dec 2023 00:00:00 +0000
                        metrics:
                          processed_count: 3
                          email_validation_count: 50
                          email_validation_public_count: 55
                          email_validation_valid_count: 10
                          email_validation_single_count: 30
                          email_validation_bulk_count: 40
                          email_validation_list_count: 20
                          email_validation_mailgun_count: 40
                          email_validation_mailjet_count: 5
                          email_preview_count: 60
                          email_preview_failed_count: 16
                          link_validation_count: 5
                          link_validation_failed_count: 7
                          seed_test_count: 9
                          ip_blocklist_monitoring_count: 42
                          domain_blocklist_monitoring_count: 1001
                    aggregates:
                      metrics: {}
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
  /v1/analytics/logs:
    post:
      tags:
        - Logs
      summary: List logs
      description: Gets customer event logs for an account
      operationId: POST-v1-analytics-logs
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-LogsRequest
            examples:
              Example:
                value:
                  start: Mon, 08 Jul 2024 00:00:00 -0000
                  end: Fri, 12 Jul 2024 00:00:00 -0000
                  filter:
                    AND:
                      - attribute: domain
                        comparator: '='
                        values:
                          - label: example.com
                            value: example.com
                  include_subaccounts: true
                  pagination:
                    sort: timestamp:asc
                    token: cjsijbijewbu78t678tVTYUYU76754fyuiksin865g
                    limit: 50
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-LogsResponse
              examples:
                Example:
                  value:
                    start: Mon, 08 Jul 2024 00:00:00 -0000
                    end: Fri, 12 Jul 2024 00:00:00 -0000
                    items:
                      - id: JDhSWf9mT5OFxCkZfpDU5d
                        event: failed
                        '@timestamp': '2024-07-08T16:30:18.530Z'
                        account:
                          id: '12345'
                        delivery-status:
                          message: 'Turret client: server connection failed'
                          attempt-no: 5
                          code: 680
                          session-seconds: 15.026
                          retry-seconds: 145
                        domain:
                          name: example.com
                        recipient: example@gmail.com
                        recipient-domain: gmail.com
                        recipient-provider: Gmail
                        envelope:
                          sender: bob@example.com
                          transport: smtp
                          sending-ip: 198.52.100.1
                          targets: bob@example.com
                    pagination:
                      previous: cjsijbijewbu78t678tVTYUYU76754fyuiksi23h75
                      next: cjsijbijewbu78t678tVTYUYU76754fyuiksin98hh
                      first: cjsijbijewbu78t678tVTYUYU76754fyuiksin865g
                      last: 875bunjnWkmis75bjklnsdk0s7jksnjknlknc64aTR
                      total: 100
                    aggregates: {}
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
        - basicAuth: []
  /v1/analytics/tags:
    put:
      tags:
        - Tags New
      summary: Update account tag
      description: Updates the tag description for an account
      operationId: PUT-v1-analytics-tags
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-UpdateTagRequest
            examples:
              Example:
                value:
                  tag: name-of-tag-to-update
                  description: updated tag description
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value: Tag updated
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
    post:
      tags:
        - Tags New
      summary: Post query to list account tags or search for single tag
      description: Gets the list of all tags, or filtered by tag prefix, for an account
      operationId: POST-v1-analytics-tags
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-ListTagsRequest
            examples:
              Example:
                value:
                  pagination:
                    sort: lastseen:desc
                    limit: 10
                  include_subaccounts: true
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-TagsResponse
              examples:
                Example:
                  value:
                    items:
                      - account_id: '12345'
                        parent_account_id: '12345'
                        tag: tag1
                        description: tag used to identify campaign 1
                        first_seen: {}
                        last_seen: {}
                        metrics: {}
                        account_name: account1
                      - account_id: '67890'
                        parent_account_id: '12345'
                        tag: tag2
                        description: tag used to identify campaign 2
                        first_seen: {}
                        last_seen: {}
                        metrics: {}
                        account_name: account2
                    pagination:
                      sort: lastseen:desc
                      limit: 10
                      total: 2
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: reason for bad request
      security:
        - basicAuth: []
    delete:
      tags:
        - Tags New
      summary: Delete account tag
      description: Deletes the tag for an account
      operationId: DELETE-v1-analytics-tags
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-DeleteTagRequest
            examples:
              Example:
                value:
                  tag: name-of-tag-to-delete
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/string'
              examples:
                Example:
                  value: Tag deleted
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v1/analytics/tags/limits:
    get:
      tags:
        - Tags New
      summary: Get account tag limit information
      description: Gets the tag limit and current number of unique tags for an account
      operationId: GET-v1-analytics-tags-limits
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-TagLimitCountResponse
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v3/{domainID}/unsubscribes/import:
    post:
      tags:
        - Unsubscribe
      summary: Import unsubscribe list
      description: >-
        Import a CSV file containing a list of addresses to add to the
        unsubscribe list. The CSV file must be 25MB or under and can contain the
        following column headers: address, tags, created_at. address is a valid
        email address (required). tags is tag to unsubscribe from, use * to
        unsubscribe an address from all domain's correspondence (optional,
        default: *). created_at is timestamp of unsubscribe event in RFC2822
        format (optional, default: current time)
      operationId: POST-v3--domainID--unsubscribes-import
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to update
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be `multipart/form-data`
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-unsubscribes-import-multipart-form-data-RequestBody
        required: true
      responses:
        '202':
          description: A 202 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: file uploaded successfully for processing. standby...
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: while reading csv header
        '500':
          description: A 500 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Internal Server Error
      security:
        - basicAuth: []
  /v3/{domainID}/bounces/import:
    post:
      tags:
        - Bounces
      summary: Import list of bounces
      description: >-
        Import a CSV file containing a list of addresses to add to the bounce
        list. The CSV file must be 25MB or under and must contain the following
        column headers: address, code, error, created_at. address is a valid
        email address. code is error code (optional, default: 550). error is
        error description (optional, default: empty string). created_at is
        timestamp of bounce event in RFC2822 format (optional, default: current
        time)
      operationId: POST-v3--domainID--bounces-import
      parameters:
        - name: domainID
          in: path
          description: The ID of the domain you want to update
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be `multipart/form-data`
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-bounces-import-multipart-form-data-RequestBody
        required: true
      responses:
        '202':
          description: A 202 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: file uploaded successfully for processing. standby...
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Internal Server Error
        '500':
          description: A 500 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: while reading csv header
      security:
        - basicAuth: []
  /v3/{domainID}/complaints/import:
    post:
      tags:
        - Complaints
      summary: Import complaint list
      description: >-
        Import a CSV file containing a list of addresses to add to the complaint
        list. The CSV file must be 25MB or under and can contain the following
        column headers: address, created_at. address is a valid email address
        (required). created_at is timestamp of complaint event in RFC2822 format
        (optional, default: current time)
      operationId: POST-v3--domainID--complaints-import
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to update
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be `multipart/form-data`
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-complaints-import-multipart-form-data-RequestBody
        required: true
      responses:
        '202':
          description: A 202 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: ffile uploaded successfully for processing. standby...
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: while reading csv header
        '500':
          description: A 500 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Internal Server Error
      security:
        - basicAuth: []
  /v3/{domainID}/whitelists/import:
    post:
      tags:
        - Allowlist
      summary: Import allowlist
      description: >-
        Import a CSV file containing a list of addresses and/or domains to add
        to the allowlist. The CSV file must be 25MB or under and must contain
        the following column headers: address, domain. For each row provide
        either an address or a domain, but not both - choose one, keep the other
        blank.
      operationId: POST-v3--domainID--whitelists-import
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to update
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be `multipart/form-data`
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-whitelists-import-multipart-form-data-RequestBody
        required: true
      responses:
        '202':
          description: A 202 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: file uploaded successfully for processing. standby...
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: while reading csv header
        '500':
          description: A 500 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Internal Server Error
      security:
        - basicAuth: []
  /v3/{domainID}/bounces/{address}:
    get:
      tags:
        - Bounces
      summary: Lookup bounce record
      description: Fetch a single bounce event by a given email address.
      operationId: GET-v3--domainID--bounces--address-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to get bounce from
          required: true
          schema:
            type: string
        - name: address
          in: path
          description: The address to search for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Bounce'
              examples:
                Example:
                  value:
                    address: foo@bar.com
                    code: '550'
                    error: No such mailbox
                    created_at: Tue, 12 Aug 2025 20:00:06 UTC
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Address not found in bounces table
      security:
        - basicAuth: []
    delete:
      tags:
        - Bounces
      summary: Remove bounce
      description: Delivery to the deleted email address resumes until it bounces again.
      operationId: DELETE-v3--domainID--bounces--address-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete a bounce from
          required: true
          schema:
            type: string
        - name: address
          in: path
          description: The address to remove
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-suppressionResponse
              examples:
                Example:
                  value:
                    message: Bounced addresses for this domain have been removed
                    address: foo@bar.com
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Address not found in bounces table
      security:
        - basicAuth: []
  /v3/{domainID}/bounces:
    get:
      tags:
        - Bounces
      summary: List all bounces
      description: Paginate over a list of bounces for a domain.
      operationId: GET-v3--domainID--bounces
      parameters:
        - name: domainID
          in: path
          description: The name of the domain you want to get bounces from
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of records to return (optional, default: 100, max:
            1000)
          required: true
          schema:
            type: integer
        - name: page
          in: query
          description: >-
            Page direction relative to the above address, can be `next`,
            `previous` or `last`, if empty, returns the first page
          required: true
          schema:
            type: string
        - name: term
          in: query
          description: >-
            Filter records based on addresses that start with the specified
            substring.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-getBouncesPaginationResponse
              examples:
                Example:
                  value:
                    items:
                      - address: foo@bar.com
                        code: '550'
                        error: No such mailbox
                        created_at: Tue, 12 Aug 2025 20:00:06 UTC
                    paging:
                      previous: <previous page url>
                      first: <first page url>
                      next: <next page url>
                      last: <last page url>
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
    post:
      tags:
        - Bounces
      summary: Add bounces
      description: >-
        Request body is expected to be a valid JSON encoded sting containing up
        to 1000 bounce records or a single bounce record as
        application/form-data
      operationId: POST-v3--domainID--bounces
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to insert bounces
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: >-
            Content-Type must be `application/json` if inserting using JSON, no
            header necessary for form-data insertion
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-blackbook-api-BouncesList
            examples:
              Example:
                value:
                  - address: alice@example.com
                    code: '550'
                    error: Bounced
                    createdat: Tue, 12 Aug 2025 20:00:06 UTC
                    messagehash: ''
                  - address: bob@example.com
                    code: '550'
                    error: Bounced
                    createdat: Mon, 01 Jan 0001 00:00:00 UTC
                    messagehash: ''
                  - address: carol@example.com
                    code: '550'
                    error: ''
                    createdat: Mon, 01 Jan 0001 00:00:00 UTC
                    messagehash: ''
                  - address: dan@example.com
                    code: ''
                    error: ''
                    createdat: Mon, 01 Jan 0001 00:00:00 UTC
                    messagehash: ''
          application/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-bounces-application-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: 4 addresses have been added to the bounces table
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Batch size should be less than 1000
      security:
        - basicAuth: []
    delete:
      tags:
        - Bounces
      summary: Clear all bounces
      description: >-
        Clears all email addresses with bounces from the domain. Delivery to the
        deleted email addresses will longer be suppressed.
      operationId: DELETE-v3--domainID--bounces
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete bounces from
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Bounced addresses for this domain have been removed
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v3/{domainID}/unsubscribes/{address}:
    get:
      tags:
        - Unsubscribe
      summary: Lookup unsubscribe record
      description: >-
        Fetch a single unsubscribe record to check if a given address is present
        in a list of unsubscribed users.
      operationId: GET-v3--domainID--unsubscribes--address-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to fetch an unsubscribe from
          required: true
          schema:
            type: string
        - name: address
          in: path
          description: The address to search for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-model-Unsubscribe
              examples:
                Example:
                  value:
                    address: alice@example.com
                    tags:
                      - some tag
                    created_at: Tue, 12 Aug 2025 20:00:06 UTC
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Address not found in unsubscribers table
      security:
        - basicAuth: []
    delete:
      tags:
        - Unsubscribe
      summary: Remove unsubscribe
      description: >-
        Delivery to the deleted email address resumes until it unsubscribes
        again.
      operationId: DELETE-v3--domainID--unsubscribes--address-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete a unsubscribe from
          required: true
          schema:
            type: string
        - name: address
          in: path
          description: The address to remove
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-suppressionResponse
              examples:
                Example:
                  value:
                    message: Unsubscribe event has been removed
                    address: foo@bar.com
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Unsubscribe event for this tag does not exist
      security:
        - basicAuth: []
  /v3/{domainID}/unsubscribes:
    get:
      tags:
        - Unsubscribe
      summary: List all unsubscribes
      description: Paginate over a list of unsubscribes for domain.
      operationId: GET-v3--domainID--unsubscribes
      parameters:
        - name: domainID
          in: path
          description: The name of the domain you want to get unsubscribes from
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of records to return (optional, default: 100, max:
            1000)
          schema:
            type: integer
        - name: page
          in: query
          description: >-
            Page direction relative to the above address, can be `next`,
            `previous` or `last`, if empty, returns the first page
          schema:
            type: string
        - name: address
          in: query
          description: address serving as a "divider" between pages
          required: true
          schema:
            type: string
        - name: term
          in: query
          description: >-
            Filter records based on addresses that start with the specified
            substring.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-getUnsubscribesPaginationResponse
              examples:
                Example:
                  value:
                    items:
                      - address: alice@example.com
                        tags:
                          - some tag
                        created_at: Tue, 12 Aug 2025 20:00:06 UTC
                    paging:
                      previous: <previous page url>
                      first: <first page url>
                      next: <next page url>
                      last: <last page url>
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
    post:
      tags:
        - Unsubscribe
      summary: Add unsubscribes
      description: >-
        Request body is expected to be a valid JSON encoded sting containing up
        to 1000 unsubscribe records or a single unsubscribe record as
        application/form-data
      operationId: POST-v3--domainID--unsubscribes
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to insert unsubscribes
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: >-
            Content-Type must be `application/json` if inserting using JSON, no
            header necessary for form-data insertion
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-blackbook-api-UnsubscribesList
            examples:
              Example:
                value:
                  - address: alice@example.com
                    tags:
                      - some tag
                    createdat: Tue, 12 Aug 2025 20:00:06 UTC
                  - address: bob@example.com
                    tags:
                      - '*'
                    createdat: Mon, 01 Jan 0001 00:00:00 UTC
                  - address: carol@example.com
                    tags: []
                    createdat: Mon, 01 Jan 0001 00:00:00 UTC
          application/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-unsubscribes-application-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: 4 addresses have been added to the unsubscribes table
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Batch size should be less than 1000
      security:
        - basicAuth: []
    delete:
      tags:
        - Unsubscribe
      summary: Clear all unsubscribes
      description: >-
        Clear all unsubscribe email addresses for the domain. Delivery to the
        deleted email addresses will no longer be suppressed.
      operationId: DELETE-v3--domainID--unsubscribes
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete unsubscribes from
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Unsubscribe addresses for this domain have been removed
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v3/{domainID}/complaints/{address}:
    get:
      tags:
        - Complaints
      summary: Lookup complaint record
      description: >-
        Fetch a single complaint records to check if a given address is present
        in the list of complaints.
      operationId: GET-v3--domainID--complaints--address-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to fetch a complaint from
          required: true
          schema:
            type: string
        - name: address
          in: path
          description: The address to search for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-model-Complaint
              examples:
                Example:
                  value:
                    address: alice@example.com
                    created_at: Tue, 12 Aug 2025 20:00:06 UTC
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: No spam complaints found for this address
      security:
        - basicAuth: []
    delete:
      tags:
        - Complaints
      summary: Remove complaint
      description: >-
        Delivery to the deleted email address resumes until there is another
        complaint.
      operationId: DELETE-v3--domainID--complaints--address-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete a complaint from
          required: true
          schema:
            type: string
        - name: address
          in: path
          description: The address to remove
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-suppressionResponse
              examples:
                Example:
                  value:
                    message: Complaint addresses for this domain have been removed
                    address: foo@bar.com
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: No spam complaints found for this address
      security:
        - basicAuth: []
  /v3/{domainID}/complaints:
    get:
      tags:
        - Complaints
      summary: List all complaints
      description: Paginate a list of complaints for the domain.
      operationId: GET-v3--domainID--complaints
      parameters:
        - name: domainID
          in: path
          description: The name of the domain you want to get complaints from
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of records to return (optional, default: 100, max:
            1000)
          schema:
            type: integer
        - name: page
          in: query
          description: >-
            Page direction relative to the above address, can be `next`,
            `previous` or `last`, if empty, returns the first page
          schema:
            type: string
        - name: address
          in: query
          description: address serving as a "divider" between pages
          required: true
          schema:
            type: string
        - name: term
          in: query
          description: >-
            Filter records based on addresses that start with the specified
            substring.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-getComplaintsPaginationResponse
              examples:
                Example:
                  value:
                    items:
                      - address: alice@example.com
                        created_at: Tue, 12 Aug 2025 20:00:06 UTC
                    paging:
                      previous: <previous page url>
                      first: <first page url>
                      next: <next page url>
                      last: <last page url>
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
    post:
      tags:
        - Complaints
      summary: Add complaints
      description: >-
        Request body is expected to be a valid JSON encoded sting containing up
        to 1000 complaint records or a single complaint record as
        application/form-data
      operationId: POST-v3--domainID--complaints
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to insert complaints
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: >-
            Content-Type must be `application/json` if inserting using JSON, no
            header necessary for form-data insertion
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-blackbook-api-ComplaintsList
            examples:
              Example:
                value:
                  - address: alice@example.com
                    createdat: Tue, 12 Aug 2025 20:00:06 UTC
                  - address: bob@example.com
                    createdat: Mon, 01 Jan 0001 00:00:00 UTC
          application/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-complaints-application-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: >-
                      2 complaint addresses have been added to the complaints
                      table
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Batch size should be less than 1000
      security:
        - basicAuth: []
    delete:
      tags:
        - Complaints
      summary: Clear all complaints
      description: >-
        Clears all email addresses with complaints from the domain. Delivery to
        the deleted email addresses will longer be suppressed.
      operationId: DELETE-v3--domainID--complaints
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete complaints from
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Complaint addresses for this domain have been removed
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v3/{domainID}/whitelists/{value}:
    get:
      tags:
        - Allowlist
      summary: Lookup allowlist record
      description: >-
        Fetch a single allowlist record to check if a given address or domain is
        present.
      operationId: GET-v3--domainID--whitelists--value-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want the allowlist record for
          required: true
          schema:
            type: string
        - name: value
          in: path
          description: The address to search for
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-model-Whitelist
              examples:
                Example:
                  value:
                    type: domain
                    value: alice@example.com
                    createdAt: Tue, 12 Aug 2025 20:00:06 UTC
                    reason: why the record was created
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Address/Domain not found in allowlist table
      security:
        - basicAuth: []
    delete:
      tags:
        - Allowlist
      summary: Remove entry from allowlist
      description: Remove a single entry from the allowlist
      operationId: DELETE-v3--domainID--whitelists--value-
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete an allowlisted record
          required: true
          schema:
            type: string
        - name: value
          in: path
          description: The address to remove
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-deleteWhitelistRecordResponse
              examples:
                Example:
                  value:
                    message: Allowlist address/domain has been removed
                    value: example.com
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Address/Domain not found in allowlist table
      security:
        - basicAuth: []
  /v3/{domainID}/whitelists:
    get:
      tags:
        - Allowlist
      summary: List allowlist records for domain
      description: Paginate over  all allowlist records for a domain.
      operationId: GET-v3--domainID--whitelists
      parameters:
        - name: domainID
          in: path
          description: The name of the domain you want to get allowlist from
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of records to return (optional, default: 100, max:
            1000)
          schema:
            type: integer
        - name: page
          in: query
          description: >-
            Page direction relative to the above address, can be `next`,
            `previous` or `last`, if empty, returns the first page
          schema:
            type: string
        - name: address
          in: query
          description: address serving as a "divider" between pages
          required: true
          schema:
            type: string
        - name: term
          in: query
          description: >-
            Filter records based on addresses that start with the specified
            substring.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-getWhitelistPaginationResponse
              examples:
                Example:
                  value:
                    items:
                      - type: domain
                        value: alice@example.com
                        createdAt: Tue, 12 Aug 2025 20:00:06 UTC
                        reason: why the record was created
                    paging:
                      previous: <previous page url>
                      first: <first page url>
                      next: <next page url>
                      last: <last page url>
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
    post:
      tags:
        - Allowlist
      summary: Add allowlist record
      description: Add an address or domain to the allowlist table
      operationId: POST-v3--domainID--whitelists
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to allowlist from
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domainID-whitelists-application-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-blackbook-api-insertWhitelistRecordResponse
              examples:
                Example:
                  value:
                    message: Address/Domain has been added to the allowlists table
                    type: domain
                    value: example.com
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: 'Missing mandatory parameter: address/domain'
      security:
        - basicAuth: []
    delete:
      tags:
        - Allowlist
      summary: Clear allowlist
      description: Delete an entire allowlist for a domain
      operationId: DELETE-v3--domainID--whitelists
      parameters:
        - name: domainID
          in: path
          description: The id of the domain you want to delete allowlist table from
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: >-
                      Allowlist addresses/domains for this domain have been
                      removed
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      security:
        - basicAuth: []
  /v3/routes:
    post:
      tags:
        - Routes
      summary: Create a route
      description: Adds a new route to the account
      operationId: post-v3-routes
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                priority:
                  type: integer
                  description: >-
                    Smaller number indicates higher priority. Higher priority
                    routes are handled first. Defaults to 0.
                description:
                  type: string
                  description: An arbitrary string.
                expression:
                  type: string
                  description: The filtering rule.
                action:
                  type: array
                  description: >-
                    This action is executed when the expression evaluates to
                    True. You can pass multiple parameters.
                  items:
                    type: string
              required:
                - expression
            encoding:
              action:
                style: form
                explode: true
            examples:
              Example:
                value:
                  priority: 0
                  description: it's a new route
                  expression: match_recipient('.*@gmail.com')
                  action:
                    - forward("http://myhost.com/messages/")
                    - stop()
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the result of the operation
                  route:
                    $ref: '#/components/schemas/RouteResponse'
                    description: The created route
              examples:
                Example:
                  value:
                    message: Route has been created
                    route:
                      id: 4f3bad2335335426750048c6
                      priority: 0
                      description: it's a new route
                      expression: match_recipient('.*@gmail.com')
                      actions:
                        - forward("http://myhost.com/messages/")
                      created_at: Wed, 15 Feb 2012 13:03:31 GMT
      security:
        - basicAuth: []
    get:
      tags:
        - Routes
      summary: Get all routes
      description: >-
        Get the list of routes. Note that routes are defined globally, per
        account, not per domain.
      operationId: get-v3-routes
      parameters:
        - name: skip
          in: query
          description: Number of records to skip. Defaults to 0.
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum number of records to return. Defaults to 100.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_count:
                    type: integer
                    description: Total number of routes in the account
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/RouteResponse'
                    description: List of routes
              examples:
                Example:
                  value:
                    total_count: 1
                    items:
                      - id: 4f3bad2335335426750048c6
                        priority: 0
                        description: Sample route
                        expression: match_recipient(".*@samples.mailgun.org")
                        actions:
                          - forward("http://myhost.com/messages/")
                          - stop()
                        created_at: Wed, 15 Feb 2012 13:03:31 GMT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the error
              examples:
                Example:
                  value:
                    message: The 'limit' parameter can't be larger than 1000
      security:
        - basicAuth: []
  /v3/routes/{id}:
    get:
      tags:
        - Routes
      summary: Get a route
      description: Returns a detailed view of the route
      operationId: get-v3-routes-id
      parameters:
        - name: id
          in: path
          description: The unique identifier of the route
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  route:
                    $ref: '#/components/schemas/RouteResponse'
              examples:
                Example:
                  value:
                    route:
                      id: 4f3bad2335335426750048c6
                      priority: 0
                      description: Sample route
                      expression: match_recipient(".*@samples.mailgun.org")
                      actions:
                        - forward("http://myhost.com/messages/")
                        - stop()
                      created_at: Wed, 15 Feb 2012 13:03:31 GMT
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the error
              examples:
                Example:
                  value:
                    message: string
      security:
        - basicAuth: []
    put:
      tags:
        - Routes
      summary: Update a route
      description: >-
        Updates a given route. All parameters are optional. This only updates
        the specified fields, leaving others unchanged.
      operationId: put-v3-routes-id
      parameters:
        - name: id
          in: path
          description: ID of the route
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: Unique identifier of the route
                priority:
                  type: integer
                  description: >-
                    Smaller number indicates higher priority. Higher priority
                    routes are handled first.
                description:
                  type: string
                  description: An arbitrary string.
                expression:
                  type: string
                  description: The filtering rule.
                action:
                  type: array
                  description: >-
                    This action is executed when the expression evaluates to
                    True. You can pass multiple parameters.
                  items:
                    type: string
            examples:
              Example:
                value:
                  priority: 0
                  description: Sample route
                  expression: match_recipient(".*@samples.mailgun.org")
                  action:
                    - forward("http://myhost.com/messages/")
                    - stop()
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the result of the operation
                  route:
                    $ref: '#/components/schemas/RouteResponse'
              examples:
                Example:
                  value:
                    message: Route has been updated
                    route:
                      id: 4f3bad2335335426750048c6
                      priority: 0
                      description: Sample route
                      expression: match_recipient(".*@samples.mailgun.org")
                      actions:
                        - forward("http://myhost.com/messages/")
                        - stop()
                      created_at: Wed, 15 Feb 2012 13:03:31 GMT
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the error
              examples:
                Example:
                  value:
                    message: Route not found
      security:
        - basicAuth: []
    delete:
      tags:
        - Routes
      summary: Delete a route
      description: Remove the rotue from the account.
      operationId: delete-v3-routes-id
      parameters:
        - name: id
          in: path
          description: ID of the route
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the result of the operation
                  id:
                    type: string
                    description: ID of the deleted route
              examples:
                Example:
                  value:
                    message: Route has been deleted
                    id: 4f3bad2335335426750048c6
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              examples:
                Example:
                  value:
                    message: Route not found
      security:
        - basicAuth: []
  /v3/routes/match:
    get:
      tags:
        - Routes
      summary: Match address to route
      description: Checks if an address matches at least one route.
      operationId: get-v3-routes-match
      parameters:
        - name: address
          in: query
          description: address to match routes on
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  route:
                    $ref: '#/components/schemas/RouteResponse'
              examples:
                Example:
                  value:
                    route:
                      id: 4f3bad2335335426750048c6
                      priority: 0
                      description: Sample route
                      expression: match_recipient(".*@samples.mailgun.org")
                      actions:
                        - forward("http://myhost.com/messages/")
                        - stop()
                      created_at: Wed, 15 Feb 2012 13:03:31 GMT
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: A string describing the error
              examples:
                Example:
                  value:
                    message: Route not found
      security:
        - basicAuth: []
  /v3/lists:
    post:
      tags:
        - Mailing Lists
      summary: Create a mailing list
      description: Adds a mailing list to the account.
      operationId: post-v3-lists
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: >-
                    A valid email address for the mailing list, e.g.
                    developers@mailgun.net, or Developers <devs@mg.net>
                name:
                  type: string
                  description: Mailing list name, e.g. Developers
                description:
                  type: string
                  description: A description
                access_level:
                  type: string
                  description: >-
                    List access level, one of: readonly, members, everyone.
                    Defaults to readonly
                reply_preference:
                  type: string
                  description: >-
                    Set where replies should go: list or sender. Defaults to
                    list
              required:
                - address
            examples:
              Example:
                value:
                  address: developers@mailgun.net
                  name: Developers
                  description: Describe the mailing list
                  access_level: readonly
                  reply_preference: list
      responses:
        '201':
          description: Mailing list creation success
          content:
            application/json:
              schema:
                type: object
                properties:
                  list:
                    $ref: '#/components/schemas/MailingListResponse'
              examples:
                Example:
                  value:
                    list:
                      address: developers@mailgun.net
                      name: Developers
                      description: Describe the mailing list
                      access_level: readonly
                      reply_preference: list
                      created_at: Tue, 09 Aug 2011 20:50:27 -0000
                      members_count: 2
                    message: Mailing list has been created
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example 1:
                  value:
                    message: >-
                      Invalid access level 'fake_access_level'. It can be any
                      of: 'readonly', 'members', 'everyone'.
                Example 2:
                  value:
                    message: >-
                      Invalid reply preference 'wrong_preference'. It can be any
                      of: 'sender', 'list'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
    get:
      tags:
        - Mailing Lists
      summary: Get mailing lists
      description: >-
        A mailing list is a group of members (recipients) which itself has an
        email address. This address becomes an ID for this mailing list.
      operationId: get-v3-lists
      parameters:
        - name: limit
          in: query
          description: Set limit for the list length returned. Defaults to 100.
          schema:
            type: string
        - name: skip
          in: query
          description: Skip the first n values in the list. Defaults to 0.
          schema:
            type: string
        - name: address
          in: query
          description: Filter mailing lists matching a specific address
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_count:
                    type: integer
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/MailingListResponse'
              examples:
                Example:
                  value:
                    total_count: 1
                    items:
                      - address: developers@mailgun.net
                        name: Developers
                        description: Describe the mailing list
                        access_level: readonly
                        reply_preference: list
                        created_at: Tue, 09 Aug 2011 20:50:27 -0000
                        members_count: 2
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/{list_address}/members:
    get:
      tags:
        - Mailing Lists
      summary: Get mailing lists members
      description: Lists members in a given mailing list
      operationId: get-lists-string:list_address-members
      parameters:
        - name: address
          in: query
          description: A valid email address specification.
          schema:
            type: string
        - name: subscribed
          in: query
          description: Filtering list on whether the member is subscribed or not.
          schema:
            type: boolean
        - name: limit
          in: query
          description: Maximum number of records to return. Max is 100. Defaults to 100.
          schema:
            type: integer
        - name: skip
          in: query
          schema:
            type: integer
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  total_count:
                    type: integer
                    description: Total number of members in the mailing list
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/ListMemberResponse'
              examples:
                Example:
                  value:
                    total_count: 1
                    items:
                      - address: alice@example.com
                        name: Alice
                        vars:
                          gender: female
                          age: 27
                        subscribed: true
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
    post:
      tags:
        - Mailing Lists
      summary: Create a mailing list member
      description: >-
        Adds a new member to the mailing list.  For adding many list members,
        consider bulk upload endpoints "POST
        /v3/lists/{list_address}/members.json" or "members.csv".
      operationId: post-lists-string:list_address-members
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: Valid email address specification.
                name:
                  type: string
                  description: An optional member name.
                vars:
                  type: object
                  description: JSON-encoded dictionary string with arbitrary parameters.
                subscribed:
                  type: boolean
                  description: Set the member as subscribed or not. Defaults to true.
                upsert:
                  type: boolean
                  description: >-
                    Set to True to update member if present, False to raise
                    error in case of a duplicate member. Defaults to false.
            examples:
              Example:
                value:
                  address: alice@example.com
                  name: Alice
                  vars:
                    gender: female
                    age: 27
                  subscribed: true
                  upsert: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    $ref: '#/components/schemas/ListMemberResponse'
                  message:
                    type: string
                    description: Success message
              examples:
                Example:
                  value:
                    member:
                      address: alice@example.com
                      name: Alice
                      vars:
                        gender: female
                        age: 27
                      subscribed: true
                    message: Mailing list member has been created
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Address already exists 'alice@example.com'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/{list_address}/members.json:
    post:
      tags:
        - Mailing Lists
      summary: Bulk upload members to a mailing list (JSON)
      description: >
        Adds multiple members, up to 1000 per call, to a mailing list, using
        JSON array format.

        If the request includes more than 100 entries, the mailing list will be
        updated asynchronously.
      operationId: post-lists-list_address-members.json
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
        - name: members
          in: query
          description: >-
            Mailing list recipients in JSON array format. Can be, either, an
            array of string addresses or an array of ListMemberRequest JSON
            objects.
          required: true
          schema:
            oneOf:
              - type: string
              - items:
                  type: array
                  items:
                    $ref: '#/components/schemas/ListMemberRequest'
        - name: upsert
          in: query
          description: If true, an existing member will be updated. Defaults to false.
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  list:
                    $ref: '#/components/schemas/MailingListResponse'
                  task-id:
                    type: string
                    description: Unique identifier for the background upload task
                  message:
                    type: string
                    description: Success message
              examples:
                Async update:
                  value:
                    list:
                      address: developers@mailgun.net
                      name: Developers
                      description: Describe the mailing list
                      access_level: readonly
                      reply_preference: list
                      created_at: Tue, 09 Aug 2011 20:50:27 -0000
                      members_count: 2
                    task-id: '4321'
                    message: Mailing list upload started in background
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Mailing list 'devs@mg.net' not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/{list_address}/members.csv:
    post:
      tags:
        - Mailing Lists
      summary: Bulk upload members to a mailing list (CSV)
      description: >-
        Adds multiple members, up to 1000 per call, to a mailing list via CSV
        file.
      operationId: post-lists-list_address-members.csv
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      requestBody:
        description: ''
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                subscribed:
                  type: boolean
                upsert:
                  type: boolean
                members:
                  type: string
                  description: Absolute path to the CSV file
            examples:
              Example:
                value:
                  upsert: true
                  members: absolute/path/to/file/members.csv
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  list:
                    $ref: '#/components/schemas/MailingListResponse'
                  task-id:
                    type: string
                    description: Unique identifier for the background upload task
                  message:
                    type: string
                    description: Success message
              examples:
                Example:
                  value:
                    list:
                      address: developers@mailgun.net
                      name: Developers
                      description: Describe the mailing list
                      access_level: readonly
                      reply_preference: list
                      created_at: Tue, 09 Aug 2011 20:50:27 -0000
                      members_count: 2
                    task-id: '4321'
                    message: Mailing list upload started in background
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: CSV file is too big, max allowed size is 5 MB
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Mailing list 'devs@mg.net' not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/{list_address}/members/{member_address}:
    get:
      tags:
        - Mailing Lists
      summary: Get a member
      description: Get details about a specific mailing list member
      operationId: get-lists-list_address-members-member_address
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
        - name: member_address
          in: path
          description: The member's address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListMemberResponse'
              examples:
                Example:
                  value:
                    address: alice@example.com
                    name: Alice
                    vars:
                      gender: female
                      age: 27
                    subscribed: true
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
    put:
      tags:
        - Mailing Lists
      summary: Update a mailing list member
      description: >-
        Updates a mailing list member with the given properties. Existing
        properties not included in the request will not be changed.
      operationId: put-lists-list_address-members-member_address
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
        - name: member_address
          in: path
          description: The member's address
          required: true
          schema:
            type: string
      requestBody:
        description: ''
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: A valid email address specification.
                name:
                  type: string
                  description: An optional member name.
                vars:
                  type: object
                  description: JSON-encoded dictionary string with arbitrary parameters.
                subscribed:
                  type: boolean
                  description: Set the member to subscribed or not. Defaults to True.
            examples:
              Example:
                value:
                  address: alice@example.com
                  name: Alice
                  vars:
                    gender: female
                    age: 27
                  subscribed: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    $ref: '#/components/schemas/ListMemberResponse'
                  message:
                    type: string
                    description: Success message
              examples:
                Example:
                  value:
                    member:
                      address: alice@example.com
                      name: Alice
                      vars:
                        gender: female
                        age: 27
                      subscribed: true
                    message: Mailing list member has been updated
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
    delete:
      tags:
        - Mailing Lists
      summary: Delete a member
      description: Deletes a member from a mailing list
      operationId: delete-lists-list_address-members-member_address
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
        - name: member_address
          in: path
          description: The member's address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  member:
                    type: object
                    properties:
                      address:
                        type: string
                        description: The email address of the member
              examples:
                Example:
                  value:
                    member:
                      address: alice@example.com
                    message: Mailing list member has been deleted
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: >-
                      Member dev@example.com of mailing list alice@example.com
                      not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/{list_address}:
    put:
      tags:
        - Mailing Lists
      summary: Update a mailing list
      description: Update mailing list properties, such as address, description or name
      operationId: put-v3-lists-address
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                address:
                  type: string
                  description: The new mailing list address.
                description:
                  type: string
                name:
                  type: string
                access_level:
                  type: string
                  description: 'One of: readonly, members, everyone. Defaults to readonly.'
                reply_reference:
                  type: string
                  description: >-
                    Set where replies should go. Can be list or sender. Defaults
                    to list.
                list-id:
                  type: string
            examples:
              Example:
                value:
                  address: developers@mailgun.net
                  name: Developers
                  description: Describe the mailing list
                  access_level: readonly
                  reply_preference: list
                  list_id: '123'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Success message
                  list:
                    $ref: '#/components/schemas/MailingListResponse'
              examples:
                Example:
                  value:
                    message: Mailing list has been updated
                    list:
                      address: developers@mailgun.net
                      name: Developers
                      description: Describe the mailing list
                      access_level: readonly
                      reply_preference: list
                      created_at: Tue, 09 Aug 2011 20:50:27 -0000
                      members_count: 2
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Mailing list developers@mailgun.net not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
    delete:
      tags:
        - Mailing Lists
      summary: Delete a mailing list
      description: Deletes a mailing list
      operationId: delete-v3-lists-address
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  address:
                    type: string
                    description: The email address of the mailing list
                  message:
                    type: string
                    description: Success message
              examples:
                Example:
                  value:
                    address: developers@mailgun.net
                    message: Mailing list has been removed
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Mailing list developers@mailgun.net not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
    get:
      tags:
        - Mailing Lists
      summary: Get a mailing list by address
      description: Returns the matching mailing list for the given address
      operationId: get-v3-lists-address
      parameters:
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  list:
                    $ref: '#/components/schemas/MailingListResponse'
              examples:
                Example:
                  value:
                    list:
                      address: developers@mailgun.net
                      name: Developers
                      description: Describe the mailing list
                      access_level: readonly
                      reply_preference: list
                      created_at: Tue, 09 Aug 2011 20:50:27 -0000
                      members_count: 2
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Mailing list developers@mailgun.net not found
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/pages:
    get:
      tags:
        - Mailing Lists
      summary: Get mailing lists by page
      description: Paginate over mailing lists
      operationId: get-v3-lists-pages
      parameters:
        - name: limit
          in: query
          description: Set limit for the list length returned. Defaults to 100.
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginateMailingListResponse'
              examples:
                Example:
                  value:
                    paging:
                      first: https://url_to_first_page
                      last: https://url_to_last_page
                      next: https://url_to_next_page
                      previous: https://url_to_previous_page
                    items:
                      - access_level: everyone
                        address: dev@samples.mailgun.org
                        created_at: Tue, 06 Mar 2012 05:44:45 GMT
                        description: Mailgun developers list
                        members_count: 1
                        name: ''
                      - access_level: readonly
                        address: bar@example.com
                        created_at: Wed, 06 Mar 2013 11:39:51 GMT
                        description: ''
                        members_count: 2
                        name: ''
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/lists/{list_address}/members/pages:
    get:
      tags:
        - Mailing Lists
      summary: Get members by page
      description: Paginate over list members in a given mailing list in ascending order
      operationId: get-lists-list_address-members-pages
      parameters:
        - name: subscribed
          in: query
          description: Filtering list on whether the member is subscribed or not.
          schema:
            type: boolean
        - name: limit
          in: query
          description: Set limit for the list length returned. Defaults to 100.
          schema:
            type: integer
        - name: address
          in: query
          description: Use as pivot for pagination.
          schema:
            type: string
        - name: page
          in: query
          description: 'Could be either: first, last, next or prev'
          schema:
            type: string
        - name: list_address
          in: path
          description: The mailing list's address
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginateListMemberResponse'
              examples:
                Example:
                  value:
                    paging:
                      first: https://url_to_first_page
                      last: https://url_to_last_page
                      next: https://url_to_next_page
                      previous: https://url_to_previous_page
                    items:
                      - access_level: everyone
                        address: dev@samples.mailgun.org
                        created_at: Tue, 06 Mar 2012 05:44:45 GMT
                        description: Mailgun developers list
                        members_count: 1
                        name: ''
                      - access_level: readonly
                        address: bar@example.com
                        created_at: Wed, 06 Mar 2013 11:39:51 GMT
                        description: ''
                        members_count: 2
                        name: ''
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message
              examples:
                Example:
                  value:
                    message: Too Many Requests
      security:
        - basicAuth: []
  /v3/{domain_name}/templates:
    get:
      tags:
        - Templates
      summary: Get templates
      description: Returns a list of templates for the domain.
      operationId: GET-v3--domain-name--templates
      parameters:
        - name: domain_name
          in: path
          description: Domain name to fetch the templates for.
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: >-
            Name of the page to retrieve. Value can be `first`, `last`, `next`,
            or `previous`. Defaults to `first`.
          schema:
            type: string
            enum:
              - first
              - last
              - next
              - previous
            x-enumDescriptions:
              first: Get the first list's page
              last: Get the last list's page
              next: Get the next list's page
              previous: Get the previous list's page
        - name: limit
          in: query
          description: Number of templates to retrieve. Default and max limit is 100.
          schema:
            type: integer
        - name: p
          in: query
          description: Pivot used to retrieve the next page of templates.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-getPageResponse
              examples:
                Example:
                  value:
                    items:
                      - name: template.0
                        description: template description
                        createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                        createdBy: ''
                        id: 48d63154-8c8f-4104-ab14-687d01dbf296
                        version: null
                        versions: null
                      - name: template.1
                        description: template description
                        createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                        createdBy: ''
                        id: 8d9c0f0d-7bf7-43a4-92a9-791a854d12a4
                        version: null
                        versions: null
                    paging:
                      previous: >-
                        https://api.mailgun.net/v3/{domain}/templates?page=prev&p=template.0&limit=10
                      first: https://api.mailgun.net/v3/{domain}/templates?limit=10
                      next: >-
                        https://api.mailgun.net/v3/{domain}/templates?page=next&p=template.2&limit=10
                      last: >-
                        https://api.mailgun.net/v3/{domain}/templates?page=last&limit=10
      security:
        - basicAuth: []
    post:
      tags:
        - Templates
      summary: Create a template
      description: >-
        Store a new template, including its name, description and (optionally)
        the template content. If the template content is provided, a new version
        is automatically created and becomes the active version.
      operationId: POST-v3--domain-name--templates
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domain_name-templates-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-createTemplateOrVersionResponse
              examples:
                Example:
                  value:
                    message: template has been stored
                    template:
                      name: template_name
                      description: This is the description of the template
                      createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                      createdBy: user-supplied-value
                      id: 46565d87-68b6-4edb-8b3c-34554af4bb77
                      version:
                        tag: tag
                        template: <html>template content</html>
                        engine: handlebars
                        createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                        comment: Version comment
                        active: true
                        id: 3efd2b85-0f41-4a1d-9898-05d7e7459c4a
                        headers:
                          From: from@header.tld
                          Reply-To: reply-to@header.tld
                          Subject: Subject Value
      security:
        - basicAuth: []
    delete:
      tags:
        - Templates
      summary: Delete all templates
      description: Delete all templates and their versions for the domain.
      operationId: DELETE-v3--domain-name--templates
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: templates have been deleted
      security:
        - basicAuth: []
  /v3/{domain_name}/templates/{template_name}/versions:
    get:
      tags:
        - Templates
      summary: Get all template versions
      description: Returns a paginated list of template versions.
      operationId: GET-v3--domain-name--templates--template-name--versions
      parameters:
        - name: domain_name
          in: path
          description: Domain name to fetch the templates for.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name to fetch the versions for.
          required: true
          schema:
            type: string
        - name: page
          in: query
          description: >-
            Name of the page to retrieve. Value can be `first`, `last`, `next`,
            or `previous`. Defaults to `first`.
          schema:
            type: string
            enum:
              - first
              - last
              - next
              - previous
            x-enumDescriptions:
              first: Get the first list's page
              last: Get the last list's page
              next: Get the next list's page
              previous: Get the previous list's page
        - name: limit
          in: query
          description: Number of templates to retrieve. Default and max limit is 100.
          schema:
            type: integer
        - name: p
          in: query
          description: Pivot used to retrieve the next page of templates.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-getVersionsPageResponse
              examples:
                Example:
                  value:
                    template:
                      name: template_name
                      description: This is the description of the template
                      createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                      createdBy: user-supplied-value
                      id: 46565d87-68b6-4edb-8b3c-34554af4bb77
                      versions:
                        - tag: v0
                          template: ''
                          engine: handlebars
                          mjml: ''
                          createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                          comment: version comment
                          active: false
                          id: 71bd07b8-fe81-4199-8fcf-67c956ccdc34
                          headers: {}
                          parsedhandlebar: null
                        - tag: v1
                          template: ''
                          engine: handlebars
                          mjml: ''
                          createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                          comment: version comment
                          active: true
                          id: d4a36e91-1b5f-44e0-bf5a-3542ea712b62
                          headers: {}
                          parsedhandlebar: null
                        - tag: v2
                          template: ''
                          engine: handlebars
                          mjml: ''
                          createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                          comment: version comment
                          active: true
                          id: d4a36e91-1b5f-44e0-bf5a-3542ea712b62
                          headers: {}
                          parsedhandlebar: null
                    paging:
                      previous: >-
                        https://api.mailgun.net/v3/{domain}/templates/z4ujt7CiEeik0RJbspqxaQ/versions?page=prev&p=v0&limit=10
                      first: >-
                        https://api.mailgun.net/v3/{domain}/templates/z4ujt7CiEeik0RJbspqxaQ/versions?limit=10
                      next: >-
                        https://api.mailgun.net/v3/{domain}/templates/z4ujt7CiEeik0RJbspqxaQ/versions?page=next&p=v2&limit=10
                      last: >-
                        https://api.mailgun.net/v3/{domain}/templates/z4ujt7CiEeik0RJbspqxaQ/versions?page=last&limit=10
      security:
        - basicAuth: []
    post:
      tags:
        - Templates
      summary: Create a template version
      description: >-
        Adds a new template version. If the template doesn’t contain any other
        versions, the first version becomes active. A template can store up to
        40 versions.
      operationId: POST-v3--domain-name--templates--template-name--versions
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name to create the new version for.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domain_name-templates-template_name-versions-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-createTemplateOrVersionResponse
              examples:
                Example:
                  value:
                    message: new version of the template has been stored
                    template:
                      name: template_name
                      description: This is the description of the template
                      createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                      createdBy: user-supplied-value
                      id: 46565d87-68b6-4edb-8b3c-34554af4bb77
                      version:
                        tag: tag
                        template: <html>template content</html>
                        engine: handlebars
                        createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                        comment: Version comment
                        active: true
                        id: 3efd2b85-0f41-4a1d-9898-05d7e7459c4a
                        headers:
                          From: from@header.tld
                          Reply-To: reply-to@header.tld
                          Subject: Subject Value
      security:
        - basicAuth: []
  /v3/{domain_name}/templates/{template_name}:
    get:
      tags:
        - Templates
      summary: Get template
      description: >-
        Returns metadata information about the stored template specified in the
        url. If the active flag is provided, the content of the active version
        of the template is returned.
      operationId: GET-v3--domain-name--templates--template-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is stored under.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: Template name to fetch.
          required: true
          schema:
            type: string
        - name: active
          in: query
          description: >-
            If this flag is set to yes the active version of the template is
            included in the response.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-getTemplateOrVersionResponse
              examples:
                Example:
                  value:
                    template:
                      name: template_name
                      description: This is the description of the template
                      createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                      createdBy: user-supplied-value
                      id: 46565d87-68b6-4edb-8b3c-34554af4bb77
                      version:
                        tag: tag
                        template: <html>template content</html>
                        engine: handlebars
                        createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                        comment: Version comment
                        active: true
                        id: 3efd2b85-0f41-4a1d-9898-05d7e7459c4a
                        headers:
                          From: from@header.tld
                          Reply-To: reply-to@header.tld
                          Subject: Subject Value
      security:
        - basicAuth: []
    put:
      tags:
        - Templates
      summary: Update template
      description: Update the description of a template.
      operationId: PUT-v3--domain-name--templates--template-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: The template name.
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domain_name-templates-template_name-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-updateOrDeleteTempateOrVersionResponse
              examples:
                Example:
                  value:
                    message: template has been updated
                    template:
                      name: template_name
      security:
        - basicAuth: []
    delete:
      tags:
        - Templates
      summary: Delete a template
      description: >-
        Delete the template specified in the url. NOTE: This method deletes all
        versions of the specified template.
      operationId: DELETE-v3--domain-name--templates--template-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name to be deleted.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-updateOrDeleteTempateOrVersionResponse
              examples:
                Example:
                  value:
                    message: template has been deleted
                    template:
                      name: template_name
      security:
        - basicAuth: []
  /v3/{domain_name}/templates/{template_name}/versions/{version_name}:
    get:
      tags:
        - Templates
      summary: Get a version
      description: >-
        Retrieve the information and content of the specified version of a
        template.
      operationId: GET-v3--domain-name--templates--template-name--versions--version-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is stored under.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name the version is for.
          required: true
          schema:
            type: string
        - name: version_name
          in: path
          description: Tag of the version of the template to fetch.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-getTemplateOrVersionResponse
              examples:
                Example:
                  value:
                    template:
                      name: template_name
                      description: This is the description of the template
                      createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                      createdBy: user-supplied-value
                      id: 46565d87-68b6-4edb-8b3c-34554af4bb77
                      version:
                        tag: tag
                        template: <html>template content</html>
                        engine: handlebars
                        createdAt: Sat, 12 Nov 1955 06:38:00 UTC
                        comment: Version comment
                        active: true
                        id: 3efd2b85-0f41-4a1d-9898-05d7e7459c4a
                        headers:
                          From: from@header.tld
                          Reply-To: reply-to@header.tld
                          Subject: Subject Value
      security:
        - basicAuth: []
    put:
      tags:
        - Templates
      summary: Update a version
      description: >-
        Update information or content of the specific template version. Existing
        fields not included in the request will not be changed
      operationId: PUT-v3--domain-name--templates--template-name--versions--version-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name the version is stored under.
          required: true
          schema:
            type: string
        - name: version_name
          in: path
          description: Tag of the version of the template to be updated
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domain_name-templates-template_name-versions-version_name-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-updateOrDeleteTempateOrVersionResponse
              examples:
                Example:
                  value:
                    message: version has been updated
                    template:
                      name: template_name
                      version:
                        tag: tag
      security:
        - basicAuth: []
    delete:
      tags:
        - Templates
      summary: Delete a version
      description: Delete a specific template version.
      operationId: >-
        DELETE-v3--domain-name--templates--template-name--versions--version-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name the version is stored under.
          required: true
          schema:
            type: string
        - name: version_name
          in: path
          description: Tag of the version of the template to be deleted.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-updateOrDeleteTempateOrVersionResponse
              examples:
                Example:
                  value:
                    message: version has been deleted
                    template:
                      name: template_name
                      version:
                        tag: tag
      security:
        - basicAuth: []
  /v3/{domain_name}/templates/{template_name}/versions/{version_name}/copy/{new_version_name}:
    put:
      tags:
        - Templates
      summary: Copy a version
      description: Copies an existing version into a new version with the provided name.
      operationId: >-
        PUT-v3--domain-name--templates--template-name--versions--version-name--copy--new-version-name-
      parameters:
        - name: domain_name
          in: path
          description: Domain name the template is associated with.
          required: true
          schema:
            type: string
        - name: template_name
          in: path
          description: template name the version is stored under.
          required: true
          schema:
            type: string
        - name: version_name
          in: path
          description: Tag of the version to copy.
          required: true
          schema:
            type: string
        - name: new_version_name
          in: path
          description: >-
            The name for the new version. If the version name already exists, it
            will be overridden.
          required: true
          schema:
            type: string
        - name: comment
          in: query
          description: Comment to be used for the new version.
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-temple-httpapi-versionCopyResponse
              examples:
                Example:
                  value:
                    message: version has been copied
                    version:
                      tag: cloned version
                      template: <p>{{firstname}} {{lastname}}</p>
                      engine: handlebars
                      createdAt: Fri, 21 Mar 2025 15:00:44 UTC
                      comment: a comment value from copy
                      id: 95658c55-e93a-40d5-a02f-a4fadfbbb3ca
      security:
        - basicAuth: []
  /v5/accounts:
    put:
      tags:
        - Account Management
      summary: Update variable account settings
      description: Update variable account settings
      operationId: put-v5-accounts
      parameters:
        - name: name
          in: query
          description: The new account organization name
          required: false
          schema:
            type: string
        - name: inactive_session_timeout
          in: query
          description: The login session timeout period for inactivity
          required: false
          schema:
            type: integer
        - name: absolute_session_timeout
          in: query
          description: The login session timeout period limit
          required: false
          schema:
            type: integer
        - name: logout_redirect_url
          in: query
          description: The url to redirect to upon logout
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successfully updated the account setting(s)
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Account info has been updated
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: >-
                      Either `name`, `absolute_timeout`, `inactive_timeout`, or
                      `logout_redirect_url` must be provided to update account
                      info.
      security:
        - basicAuth: []
  /v5/accounts/http_signing_key:
    get:
      tags:
        - Account Management
      summary: Get webhook signing key saved on the account
      description: Get webhook signing key saved on the account
      operationId: get-v5-accounts-http_signing_key
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-HTTPSigningKey
              examples:
                Example:
                  value:
                    http_signing_key: key-55c5c5c5c55f55ca5cd5f55d5c555c55
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: could not get HSK for account
      security:
        - basicAuth: []
    post:
      tags:
        - Account Management
      summary: Create or regenerate webhook signing key on an account
      description: Create or regenerate webhook signing key on an account
      operationId: post-v5-accounts-http_signing_key
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-HTTPSigningKey
              examples:
                Example:
                  value:
                    message: regenerated HTTP signing key for account
                    http_signing_key: key-55c5c5c5c55f55ca5cd5f55d5c555c55
      security:
        - basicAuth: []
  /v5/sandbox/auth_recipients:
    get:
      tags:
        - Account Management
      summary: Get authorized email recipients for a sandbox domain
      description: Get webhook signing key saved on the account
      operationId: get-v5-sandbox-auth_recipients
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  recipients:
                    type: array
                    items:
                      $ref: >-
                        #/components/schemas/github.com-mailgun-accounts-api-RecipientResponse
              examples:
                Example:
                  value:
                    recipients:
                      - email: test_recipient@sandbox.com
                        activated: true
      security:
        - basicAuth: []
    post:
      tags:
        - Account Management
      summary: Add authorized email recipient for a sandbox domain
      description: Add authorized email recipient for a sandbox domain
      operationId: post-v5-sandbox-auth_recipients
      parameters:
        - name: email
          in: query
          description: The email address of the new recipient
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                type: object
                properties:
                  recipient:
                    $ref: >-
                      #/components/schemas/github.com-mailgun-accounts-api-RecipientResponse
              examples:
                Example:
                  value:
                    recipient:
                      email: test_recipient@sandbox.com
                      activated: false
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Only 5 sandbox recipients are allowed
      security:
        - basicAuth: []
  /v5/sandbox/auth_recipients/{email}:
    delete:
      tags:
        - Account Management
      summary: Remove an authorized sandbox domain email recipient
      description: Remove an authorized sandbox domain email recipient
      operationId: delete-v5-sandbox-auth_recipients-email
      parameters:
        - name: email
          in: path
          description: The email address of the authorized recipient to be removed
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Sandbox recipient deleted.
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Invalid email address.
      security:
        - basicAuth: []
  /v5/accounts/resend_activation_email:
    post:
      tags:
        - Account Management
      summary: Resend account activation email to the account owner
      description: Resend account activation email to the account owner
      operationId: post-v5-accounts-resend_activation_email
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericSuccess
              examples:
                Example:
                  value:
                    success: true
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/{subaccount_id}:
    get:
      tags:
        - Subaccounts
      summary: Get a single subaccount
      description: Fetch the details of a single subaccount
      operationId: get-v5-accounts-subaccounts-subaccount_id
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-SubaccountResponse
              examples:
                Example:
                  value:
                    subaccount:
                      id: '123'
                      name: My subaccount
                      created_at: Wed, 06 Nov 2024 19:48:29 GMT
                      updated_at: Wed, 28 May 2025 20:03:05 GMT
                      status: open
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Not Found
      security:
        - basicAuth: []
  /v5/accounts/subaccounts:
    get:
      tags:
        - Subaccounts
      summary: List all subaccounts
      description: Fetch all subaccounts
      operationId: get-v5-accounts-subaccounts
      parameters:
        - name: sort
          in: query
          description: Sort order
          schema:
            type: string
            enum:
              - asc
              - desc
            x-enumDescriptions:
              asc: Sort by ascending order of name field
              desc: Sort by descending order of name field
          required: false
        - name: filter
          in: query
          description: Name of account to filter by
          schema:
            type: string
          required: false
        - name: limit
          in: query
          description: Number of subaccounts to return
          schema:
            type: integer
            default: 10
            minimum: 1
            maximum: 1000
          required: false
        - name: skip
          in: query
          description: Number of subaccounts to skip
          schema:
            type: integer
            default: 0
          required: false
        - name: enabled
          in: query
          description: >-
            Indicate to include enabled subaccounts (true) or disabled accounts
            (false). Leave unspecified to allow for either, depending on other
            parameters provided.
          schema:
            type: boolean
          required: false
        - name: closed
          in: query
          description: >-
            Indicate to include closed subaccounts (true) or exclude closed
            accounts (false). Leave unspecified to allow for either, depending
            on other parameters provided.
          schema:
            type: boolean
          required: false
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-SubaccountListResponse
              examples:
                Example:
                  value:
                    subaccounts:
                      - id: '123'
                        name: My subaccount
                        status: open
                        created_at: Wed, 06 Nov 2024 19:48:29 GMT
                        updated_at: Wed, 28 May 2025 20:03:05 GMT
                    total: 1
      security:
        - basicAuth: []
    post:
      tags:
        - Subaccounts
      summary: Create a subaccount
      description: Create a subaccount
      operationId: post-v5-accounts-subaccounts
      parameters:
        - name: name
          in: query
          description: The name of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully created a subaccount
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-SubaccountResponse
              examples:
                Example:
                  value:
                    subaccount:
                      id: '123'
                      name: My subaccount
                      created_at: Wed, 06 Nov 2024 19:48:29 GMT
                      updated_at: Wed, 28 May 2025 20:03:05 GMT
                      status: open
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Bad request
      security:
        - basicAuth: []
    delete:
      tags:
        - Subaccounts
      summary: Delete a subaccount
      description: Delete a subaccount
      operationId: delete-v5-accounts-subaccounts-subaccount_id
      parameters:
        - name: X-Mailgun-On-Behalf-Of
          in: header
          description: The ID of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Subaccount successfully deleted
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Bad request
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Forbidden
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/{subaccount_id}/disable:
    post:
      tags:
        - Subaccounts
      summary: Disable a subaccount
      description: Disable a subaccount
      operationId: post-v5-accounts-subaccounts-subaccount_id-disable
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
        - name: reason
          in: query
          description: The reason for disabling the subaccount
          required: false
          schema:
            type: string
        - name: note
          in: query
          description: A note for the subaccount
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Subaccount disabled successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-SubaccountResponse
              examples:
                Example:
                  value:
                    subaccount:
                      id: '123'
                      name: My subaccount
                      created_at: Wed, 06 Nov 2024 19:48:29 GMT
                      updated_at: Wed, 28 May 2025 20:03:05 GMT
                      status: disabled
        '400':
          description: Subaccount is already disabled
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: subaccount is already disabled
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Not Found
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/{subaccount_id}/enable:
    post:
      tags:
        - Subaccounts
      summary: Enable a subaccount
      description: Enable a subaccount
      operationId: post-v5-accounts-subaccounts-subaccount_id-enable
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Subaccount enabled successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-SubaccountResponse
              examples:
                Example:
                  value:
                    subaccount:
                      id: '123'
                      name: My subaccount
                      created_at: Wed, 06 Nov 2024 19:48:29 GMT
                      updated_at: Wed, 28 May 2025 20:03:05 GMT
                      status: open
        '400':
          description: Cannot enable due to limit reached
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Parent account has reached its allotted child limit
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Not Found
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/{subaccount_id}/limit/custom/monthly:
    get:
      tags:
        - Subaccounts
      summary: Get current custom sending limit
      description: Fetch the details of custom sending limit on the account
      operationId: get-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-CustomMessageLimitResponse
              examples:
                Example:
                  value:
                    limit: 10000
                    current: 0
                    period: 1m
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Not a subaccount
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: >-
                      Forbidden - user does not have permission to view this
                      resource
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: No threshold for account
      security:
        - basicAuth: []
    put:
      tags:
        - Subaccounts
      summary: Set a custom sending limit
      description: Set a custom sending limit
      operationId: put-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: The limit to set
          required: true
          schema:
            type: number
      responses:
        '200':
          description: Successfully set the sending limit
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericSuccess
              examples:
                Example:
                  value:
                    success: true
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Invalid subaccount ID
      security:
        - basicAuth: []
    delete:
      tags:
        - Subaccounts
      summary: Delete a custom sending limit
      description: Delete a custom sending limit
      operationId: delete-v5-accounts-subaccounts-subaccount_id-limit-custom-monthly
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully deleted the sending limit
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericSuccess
              examples:
                Example:
                  value:
                    success: true
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Could not delete threshold for account
      security:
        - basicAuth: []
  /v5/accounts/limit/custom/monthly:
    get:
      tags:
        - Custom Message Limit
      summary: Get current custom sending limit
      description: Fetch the details of custom sending limit on the account
      operationId: get-v5-accounts-limit-custom-monthly
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-CustomMessageLimitResponse
              examples:
                Example:
                  value:
                    limit: 10000
                    current: 0
                    period: 1m
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: No threshold for account
      security:
        - basicAuth: []
    put:
      tags:
        - Custom Message Limit
      summary: Set a custom sending limit
      description: Set a custom sending limit
      operationId: put-v5-accounts-limit-custom-monthly
      parameters:
        - name: limit
          in: query
          description: The limit to set
          required: true
          schema:
            type: number
      responses:
        '200':
          description: Successfully set the sending limit
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericSuccess
              examples:
                Example:
                  value:
                    success: true
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: The limit parameter minumum is 1000
      security:
        - basicAuth: []
    delete:
      tags:
        - Custom Message Limit
      summary: Delete a custom sending limit
      description: Delete a custom sending limit
      operationId: delete-v5-accounts-limit-custom-monthly
      responses:
        '200':
          description: Successfully deleted the sending limit
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericSuccess
              examples:
                Example:
                  value:
                    success: true
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Could not delete threshold for account
      security:
        - basicAuth: []
  /v5/accounts/limit/custom/enable:
    put:
      tags:
        - Custom Message Limit
      summary: Re-enable account disabled for hitting send limit
      description: >-
        Re-enable an account that was disabled for reaching the custom sending
        limit
      operationId: put-v5-accounts-limit-custom-enable
      responses:
        '200':
          description: Successfully re-enabled the account
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericSuccess
              examples:
                Example:
                  value:
                    success: true
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: >-
                      Unable to re-enable account with current account
                      disablement
      security:
        - basicAuth: []
  /v5/accounts/subaccounts/{subaccount_id}/features:
    put:
      tags:
        - Subaccounts
      summary: Update subaccount feature
      description: Update subaccount feature
      operationId: put-v5-accounts-subaccounts-subaccount_id-features
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                email_preview:
                  $ref: >-
                    #/components/schemas/github.com-mailgun-accounts-api-FeatureOverrideEnabledParam
                inbox_placement:
                  $ref: >-
                    #/components/schemas/github.com-mailgun-accounts-api-FeatureOverrideEnabledParam
                sending:
                  $ref: >-
                    #/components/schemas/github.com-mailgun-accounts-api-FeatureOverrideEnabledParam
                validations:
                  $ref: >-
                    #/components/schemas/github.com-mailgun-accounts-api-FeatureOverrideEnabledParam
                validations_bulk:
                  $ref: >-
                    #/components/schemas/github.com-mailgun-accounts-api-FeatureOverrideEnabledParam
            encoding:
              email_preview:
                contentType: application/json
              inbox_placement:
                contentType: application/json
              sending:
                contentType: application/json
              validations:
                contentType: application/json
              validations_bulk:
                contentType: application/json
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully updated subaccount features
          content:
            application/json:
              schema:
                type: object
                properties:
                  features:
                    $ref: >-
                      #/components/schemas/github.com-mailgun-accounts-api-FeaturesResponse
              examples:
                Example:
                  value:
                    features:
                      validations:
                        enabled: true
        '400':
          description: Error response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: No valid updates provided
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-accounts-api-GenericMessage
              examples:
                Example:
                  value:
                    message: Not Found
      security:
        - basicAuth: []
  /v1/keys:
    get:
      tags:
        - Keys
      summary: List Mailgun API keys
      description: List Mailgun API keys
      operationId: api.(*KeysAPI).ListKeys-fm-6
      parameters:
        - name: domain_name
          in: query
          description: Domain name filter for domain keys
          schema:
            type: string
        - name: kind
          in: query
          description: Key kind filter
          schema:
            type: string
            enum:
              - domain
              - user
              - web
            x-enumDescriptions:
              domain: Filter for domain keys
              user: Filter for user keys
              web: Filter for web keys
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github.com-mailgun-cerberus-keys-KeysResp'
              examples:
                Example:
                  value:
                    items:
                      - created_at: '2006-01-02T15:04:05'
                        description: api key
                        id: e2153fd0-e0277777
                        kind: user
                        requestor: janedoe@example.com
                        role: admin
                        updated_at: '2006-01-02T15:04:05'
                        user_name: Jane Doe
                        domain_name: null
                        is_disabled: false
                    total_count: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: >-
                      expected `kind` param to be one of [domain user web] or
                      absent
      security:
        - basicAuth: []
    post:
      tags:
        - Keys
      summary: Create Mailgun API key
      description: Create Mailgun API key
      operationId: api.(*KeysAPI).CreateKey-fm-7
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v1-keys-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-keys-CreateKeyResp
              examples:
                Example:
                  value:
                    key:
                      description: api key
                      kind: domain
                      role: sending
                      created_at: '2006-01-02T15:04:05'
                      updated_at: '2006-01-02T15:04:05'
                      domain_name: example.com
                      id: f2153fd0-f1277777
                      user_name: null
                      requestor: null
                      is_disabled: false
                    message: great success
        '403':
          description: A 403 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: could not create key, account limit reached
      security:
        - basicAuth: []
  /v1/keys/{key_id}:
    delete:
      tags:
        - Keys
      summary: Delete Mailgun API key
      description: Delete Mailgun API key
      operationId: api.(*KeysAPI).DeleteKey-fm-8
      parameters:
        - name: key_id
          in: path
          description: The Key ID generated by Mailgun on key creation
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: key deleted
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: no key matching id
      security:
        - basicAuth: []
  /v1/keys/public:
    post:
      tags:
        - Keys
      summary: Regenerate Mailgun Public API key
      description: Regenerate Mailgun Public API key
      operationId: api.(*KeysAPI).RegeneratePublicKey-fm-9
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-keys-PublicKeyResp
              examples:
                Example:
                  value:
                    key: pubkey-626b31f321228ddddddddddcc5a7a1c9
                    message: The public API key has been successfully regenerated.
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Forbidden
      security:
        - basicAuth: []
  /v3/domains/{domain_name}/credentials:
    get:
      tags:
        - Credentials
      summary: List Mailgun SMTP credential metadata for a given domain
      description: List Mailgun SMTP credential metadata for a given domain
      operationId: api.(*CredsAPI).ListCreds-fm-12
      parameters:
        - name: domain_name
          in: path
          description: Hostname filter for credential results
          required: true
          schema:
            type: string
        - name: skip
          in: query
          description: Number of results to skip, to help with pagination
          schema:
            type: integer
            default: 0
        - name: limit
          in: query
          description: Limit results to this many
          schema:
            type: integer
            default: 100
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-credentials-ListCredsResp
              examples:
                Example:
                  value:
                    items:
                      - created_at: Wed, 08 Mar 2023 23:34:57 +0000
                        login: someone@example.com
                        mailbox: someone@example.com
                        size_bytes: null
                    total_count: 1
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Limit parameter can't be larger than 1000
      security:
        - basicAuth: []
    post:
      tags:
        - Credentials
      summary: Create Mailgun SMTP credentials for a given domain
      description: Create Mailgun SMTP credentials for a given domain
      operationId: api.(*CredsAPI).CreateCreds-fm-13
      parameters:
        - name: domain_name
          in: path
          description: Hostname for new credentials
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v3-domains-domain_name-credentials-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-credentials-CreateCredsResp
              examples:
                Example:
                  value:
                    message: Created 1 credentials pair(s)
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Parameter 'login' is missing
      security:
        - basicAuth: []
    delete:
      tags:
        - Credentials
      summary: Delete all Mailgun SMTP credentials for a domain
      description: Delete Mailgun SMTP credentials for a given domain
      operationId: api.(*CredsAPI).DeleteDomainCreds-fm-16
      parameters:
        - name: domain_name
          in: path
          description: Hostname of credentials to be deleted
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-credentials-DeleteDomainCredsResp
              examples:
                Example:
                  value:
                    message: All domain credentials have been deleted
                    count: 2
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: an error occurred, please try again later
      security:
        - basicAuth: []
  /v3/domains/{domain_name}/credentials/{spec}:
    put:
      tags:
        - Credentials
      summary: Update Mailgun SMTP credentials
      description: Update Mailgun SMTP credentials for a given domain and SMTP user
      operationId: api.(*CredsAPI).UpdateCreds-fm-14
      parameters:
        - name: domain_name
          in: path
          description: Hostname of credentials to be updated
          required: true
          schema:
            type: string
        - name: spec
          in: path
          description: Login specification of credentials to be updated (email address)
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domains-domain_name-credentials-spec-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-credentials-CreateCredsResp
              examples:
                Example:
                  value:
                    message: Created 1 credentials pair(s)
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Credentials not found
      security:
        - basicAuth: []
    delete:
      tags:
        - Credentials
      summary: Delete Mailgun SMTP credentials
      description: Delete Mailgun SMTP credentials for a given domain and SMTP user
      operationId: api.(*CredsAPI).DeleteCreds-fm-17
      parameters:
        - name: domain_name
          in: path
          description: Hostname of credentials to be deleted
          required: true
          schema:
            type: string
        - name: spec
          in: path
          description: Login specification of credentials to be deleted (email address)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-credentials-DeleteCredsResp
              examples:
                Example:
                  value:
                    message: Credentials have been deleted
                    spec: someone@example.com
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: 'Cannot delete system mailbox: postmaster@example.com'
      security:
        - basicAuth: []
  /v3/{domain_name}/mailboxes/{spec}:
    put:
      tags:
        - Credentials
      summary: Update Mailgun SMTP credentials
      description: Update Mailgun SMTP credentials for a given domain and SMTP user
      operationId: api.(*CredsAPI).UpdateCreds-fm-15
      parameters:
        - name: domain_name
          in: path
          description: Hostname of credentials to be updated
          required: true
          schema:
            type: string
        - name: spec
          in: path
          description: Login specification of credentials to be updated (email address)
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v3-domain_name-mailboxes-spec-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-credentials-CreateCredsResp
              examples:
                Example:
                  value:
                    message: Created 1 credentials pair(s)
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Credentials not found
      security:
        - basicAuth: []
  /v2/ip_whitelist:
    get:
      tags:
        - IP Allowlist
      summary: List Mailgun account IP allowlist entries
      description: List Mailgun account IP allowlist entries
      operationId: api.(*WhitelistAPI).ListWhitelistV2-fm-21
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-whitelist-V2WhitelistResp
              examples:
                Example:
                  value:
                    addresses:
                      - description: OnPrem Server
                        ip_address: 10.11.11.111
        '403':
          description: A 403 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Forbidden
      security:
        - basicAuth: []
    put:
      tags:
        - IP Allowlist
      summary: Update individual Mailgun account IP allowlist entry's description
      description: Update individual Mailgun account IP allowlist entry's description
      operationId: api.(*WhitelistAPI).UpdateWhitelistV2-fm-23
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/PUT-v2-ip_whitelist-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-whitelist-V2WhitelistResp
              examples:
                Example:
                  value:
                    addresses:
                      - description: OnPrem Server 1
                        ip_address: 10.11.11.111
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: IP not found
      security:
        - basicAuth: []
    post:
      tags:
        - IP Allowlist
      summary: Add Mailgun account IP allowlist entry
      description: Add Mailgun account IP allowlist entry
      operationId: api.(*WhitelistAPI).AddWhitelistV2-fm-22
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: >-
                #/components/schemas/POST-v2-ip_whitelist-multipart-form-data-RequestBody
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-whitelist-V2WhitelistResp
              examples:
                Example:
                  value:
                    addresses:
                      - description: OnPrem Server
                        ip_address: 10.11.11.111
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: Invalid IP Address or CIDR
      security:
        - basicAuth: []
    delete:
      tags:
        - IP Allowlist
      summary: Delete Mailgun account IP allowlist entry
      description: Delete Mailgun account IP allowlist entry
      operationId: api.(*WhitelistAPI).DeleteWhitelistV2-fm-24
      parameters:
        - name: address
          in: query
          description: Address to be deleted from allowlist
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-cerberus-whitelist-V2WhitelistResp
              examples:
                Example:
                  value:
                    addresses: []
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
              examples:
                Example:
                  value:
                    message: IP address can not be blank
      security:
        - basicAuth: []
  /v1/bounce-classification/stats:
    get:
      tags:
        - Bounce Classification
      summary: List statistics, ordered by total bounces
      description: 'Deprecated: use POST /v2/bounce-classification/metrics instead'
      operationId: GET-v1-bounce-classification-stats
      parameters:
        - name: group
          in: query
          description: >-
            Group response by fields: subaccount.id, domain.name, entity-id,
            rule-id
          schema:
            type: string
        - name: limit
          in: query
          description: Limits the number of items returned in a response
          schema:
            type: integer
        - name: include_subaccounts
          in: query
          description: Include subaccounts
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-api-ListStatsResp
              examples:
                Example:
                  value:
                    items:
                      - subaccount:
                          id: subaccount_id
                        domain:
                          name: example.com
                        rule-id: 55ff
                        entity-id: spamhaus
                        short-explanation: You're listed on Spamhaus!
                        bounced:
                          total: 4
                    _duration: 0s
      deprecated: true
      security:
        - basicAuth: []
  /v1/bounce-classification/domains:
    get:
      tags:
        - Bounce Classification
      summary: List domains statistic per account
      description: 'Deprecated: use POST /v2/bounce-classification/metrics'
      operationId: GET-v1-bounce-classification-domains
      parameters:
        - name: limit
          in: query
          description: Limits the number of items returned in a response
          schema:
            type: integer
        - name: skip
          in: query
          description: Skips N items in a response
          schema:
            type: integer
        - name: query
          in: query
          description: 'Query filter, e.g.: ''domain.name:example.com'''
          schema:
            type: string
        - name: include_subaccounts
          in: query
          description: Include subaccounts
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-api-ListAccountStatsResp
              examples:
                Example:
                  value:
                    items:
                      - domain:
                          name: mailgun.net
                        bounced:
                          total: 4
                    total: 1
      deprecated: true
      security:
        - basicAuth: []
  /v1/bounce-classification/domains/{domain}/entities:
    get:
      tags:
        - Bounce Classification
      summary: List statistic per domain
      description: 'Deprecated: use POST /v2/bounce-classification/metrics'
      operationId: GET-v1-bounce-classification-domains--domain--entities
      parameters:
        - name: domain
          in: path
          description: The sender domain name
          required: true
          schema:
            type: string
        - name: include_subaccounts
          in: query
          description: Include subaccounts
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-api-ListDomainStatsResp
              examples:
                Example:
                  value:
                    items:
                      - entity-id: gmail
                        entity-name: Gmail
                        bounced:
                          total: 1
                      - entity-id: hotmail
                        entity-name: Microsoft (Hotmail)
                        bounced:
                          total: 3
      deprecated: true
      security:
        - basicAuth: []
  /v1/bounce-classification/domains/{domain}/entities/{entity-id}/rules:
    get:
      tags:
        - Bounce Classification
      summary: List statistic per entity
      description: 'Deprecated: use POST /v2/bounce-classification/metrics'
      operationId: GET-v1-bounce-classification-domains--domain--entities--entity-id--rules
      parameters:
        - name: domain
          in: path
          description: The sender domain name
          required: true
          schema:
            type: string
        - name: entity-id
          in: path
          description: The entity ID(Email Service Entity or Spam Filter / BL)
          required: true
          schema:
            type: string
        - name: include_subaccounts
          in: query
          description: Include subaccounts
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-api-ListEntityStatsResp
              examples:
                Example:
                  value:
                    items:
                      - rule-id: 55ff
                        category: ESPBLOCK
                        severity: PERMANENT
                        sample-text: '5.4.1 recipient address rejected: access denied.'
                        explanation: Access denied
                        bounced:
                          total: 3
        '403':
          description: A 403 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      deprecated: true
      security:
        - basicAuth: []
  /v1/bounce-classification/domains/{domain}/events:
    get:
      tags:
        - Bounce Classification
      summary: List Bounce Logs
      description: >-
        Deprecated: use POST /v1/analytics/logs -
        https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Logs/
      operationId: GET-v1-bounce-classification-domains--domain--events
      parameters:
        - name: domain
          in: path
          description: The sender domain name
          required: true
          schema:
            type: string
        - name: rule-id
          in: query
          description: Optional if 'page' is passed
          schema:
            type: string
        - name: entity-id
          in: query
          description: The entity ID(Email Service Entity or Spam Filter / BL)
          schema:
            type: string
        - name: sort
          in: query
          description: Sort field and order. Default is '@timestamp:asc'
          schema:
            type: string
        - name: page
          in: query
          description: Encoded paging information, provided via 'next', 'previous' links
          schema:
            type: string
        - name: limit
          in: query
          description: Limits the number of items returned in a response
          schema:
            type: integer
      responses:
        '403':
          description: A 403 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
        '410':
          description: A 410 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-scaffold-httpapi-GenericResponse
      deprecated: true
      security:
        - basicAuth: []
  /v1/bounce-classification/config/entities:
    get:
      tags:
        - Bounce Classification
      summary: List entities
      description: 'Deprecated: use POST /v2/bounce-classification/metrics'
      operationId: GET-v1-bounce-classification-config-entities
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-config-Entities
              examples:
                Example: {}
      deprecated: true
      security:
        - basicAuth: []
  /v1/bounce-classification/config/rules:
    get:
      tags:
        - Bounce Classification
      summary: List rules
      description: 'Deprecated: use GET /v2/bounce-classification/config/groups/{group-id}'
      operationId: GET-v1-bounce-classification-config-rules
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-config-Rules
              examples:
                Example: {}
      deprecated: true
      security:
        - basicAuth: []
  /v2/bounce-classification/metrics:
    post:
      tags:
        - Bounce Classification
      summary: List statistic v2
      description: >-
        Items that have no bounces and no delays(classified_failures_count==0)
        are not returned.
      operationId: POST-v2-bounce-classification-metrics
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-internal-api-MetricsRequest
            examples:
              Example:
                value:
                  start: Sun, 01 Jan 2006 22:04:05 UTC
                  end: Mon, 02 Jan 2006 22:04:05 UTC
                  resolution: day
                  duration: 24h0m0s
                  dimensions:
                    - entity-name
                    - domain.name
                  metrics:
                    - critical_bounce_count
                    - non_critical_bounce_count
                    - critical_delay_count
                    - non_critical_delay_count
                    - delivered_smtp_count
                    - classified_failures_count
                    - critical_bounce_rate
                    - non_critical_bounce_rate
                    - critical_delay_rate
                    - non_critical_delay_rate
                  filter:
                    AND:
                      - attribute: domain.name
                        comparator: '='
                        values:
                          - value: example.com
                  include_subaccounts: true
                  pagination:
                    sort: entity-name:asc
                    limit: 10
        required: true
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-internal-api-MetricsResponse
              examples:
                Example:
                  value:
                    start: Sun, 01 Jan 2006 22:04:05 +0000
                    end: Mon, 02 Jan 2006 22:04:05 +0000
                    resolution: day
                    duration: 24h0m0s
                    dimensions:
                      - entity-name
                      - domain.name
                    pagination:
                      sort: entity-name:asc
                      limit: 10
                      total: 1
                    items:
                      - account.name: subaccount name
                        entity-name: Gmail
                        domain.name: example.com
                        envelope.i-ip-pool-name: default
                        envelope.sending-ip: 1.2.3.4
                        timestamp: Mon, 02 Jan 2006 22:04:05 +0000
                        tags: daily, campaign1
                        metrics:
                          critical_bounce_count: 10
                          non_critical_bounce_count: 20
                          critical_delay_count: 30
                          non_critical_delay_count: 40
                          classified_failures_count: 100
                          delivered_smtp_count: 1000
                          critical_bounce_rate: 1
                          non_critical_bounce_rate: 2
                          critical_delay_rate: 3
                          non_critical_delay_rate: 4
      security:
        - basicAuth: []
  /v5/users:
    get:
      tags:
        - Users
      summary: Get users on an account
      description: Get users on an account
      operationId: get-v5-users
      parameters:
        - name: role
          in: query
          description: The user role by which to filter results (basic == analyst)
          required: false
          schema:
            type: string
            enum:
              - basic
              - billing
              - support
              - developer
              - admin
            x-enumDescriptions:
              basic: Basic/Analyst user role
              billing: Billing user role
              support: Support user role
              developer: Developer user role
              admin: Admin user role
        - name: limit
          in: query
          description: The number of users to return
          required: false
          schema:
            type: integer
        - name: skip
          in: query
          description: The number of users to skip
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-UserListResponse
              examples:
                Example:
                  value:
                    users:
                      - id: '123'
                        name: John Doe
                        activated: true
                        is_disabled: false
                        email: johndoe@example.com
                        email_details:
                          address: johndoe@example.com
                          is_valid: true
                          parts:
                            local_part: johndoe
                            domain: example.com
                        role: basic
                        account_id: '567'
                        opened_ip: 67.111.60.111
                        is_master: true
                        metadata: {}
                        tfa_enabled: true
                        tfa_active: true
                        tfa_created_at: '2022-12-20T16:52:01.892000'
                        password_updated_at: '2022-12-20T16:52:01.892000'
                        preferences:
                          programming_language: curl
                          time_format: '%m/%d/%y %I:%M %p'
                          time_zone: US/Eastern
                        auth:
                          method: sinch
                          prior_details: {}
                          prior_method: ''
                        github_user_id: null
                        salesforce_user_id: null
                        migration_status: done
                    total: 1
      security:
        - basicAuth: []
  /v5/users/{user_id}:
    get:
      tags:
        - Users
      summary: Get a user's details
      description: Get details for a user on the account
      operationId: get-v5-users-user_id
      parameters:
        - name: user_id
          in: path
          description: The ID of the user on the account
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github.com-mailgun-users-api-UserResponse'
              examples:
                Example:
                  value:
                    id: '123'
                    name: John Doe
                    activated: true
                    is_disabled: false
                    email: johndoe@example.com
                    email_details:
                      address: johndoe@example.com
                      is_valid: true
                      parts:
                        local_part: johndoe
                        domain: example.com
                    role: basic
                    account_id: '567'
                    opened_ip: 67.111.60.111
                    is_master: true
                    metadata: {}
                    tfa_enabled: true
                    tfa_active: true
                    tfa_created_at: '2022-12-20T16:52:01.892000'
                    password_updated_at: '2022-12-20T16:52:01.892000'
                    preferences:
                      programming_language: curl
                      time_format: '%m/%d/%y %I:%M %p'
                      time_zone: US/Eastern
                    auth:
                      method: sinch
                      prior_details: {}
                      prior_method: ''
                    github_user_id: null
                    salesforce_user_id: null
                    migration_status: done
        '404':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-GenericResponse
              examples:
                Example:
                  value:
                    message: No such user exists
      security:
        - basicAuth: []
  /v5/users/me:
    get:
      tags:
        - Users
      summary: Get one's own user details
      description: Get one's own user details, requires use of api key of 'user' kind
      operationId: get-v5-users-me
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/github.com-mailgun-users-api-UserResponse'
              examples:
                Example:
                  value:
                    id: '123'
                    name: John Doe
                    activated: true
                    is_disabled: false
                    email: johndoe@example.com
                    email_details:
                      address: johndoe@example.com
                      is_valid: true
                      parts:
                        local_part: johndoe
                        domain: example.com
                    role: basic
                    account_id: '567'
                    opened_ip: 67.111.60.111
                    is_master: true
                    metadata: {}
                    tfa_enabled: true
                    tfa_active: true
                    tfa_created_at: '2022-12-20T16:52:01.892000'
                    password_updated_at: '2022-12-20T16:52:01.892000'
                    preferences:
                      programming_language: curl
                      time_format: '%m/%d/%y %I:%M %p'
                      time_zone: US/Eastern
                    auth:
                      method: sinch
                      prior_details: {}
                      prior_method: ''
                    github_user_id: null
                    salesforce_user_id: null
                    migration_status: done
        '403':
          description: A 404 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-GenericResponse
              examples:
                Example:
                  value:
                    message: Incompatible key for this endpoint
      security:
        - basicAuth: []
  /v5/users/{user_id}/org/{org_id}:
    put:
      tags:
        - Users
      summary: Add a user to an organization
      description: Add a user to an organization
      operationId: post-v5-users-user_id-org-org_id
      parameters:
        - name: user_id
          in: path
          description: The ID of the user on the account
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          description: The ID of the organization
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-GenericResponse
              examples:
                Example:
                  value:
                    message: success
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-GenericResponse
              examples:
                Example:
                  value:
                    message: 'Unable to add user to org: error code 400'
      security:
        - basicAuth: []
    delete:
      tags:
        - Users
      summary: Remove a user from an organization
      description: Remove a user from an organization
      operationId: delete-v5-users-user_id-org-org_id
      parameters:
        - name: user_id
          in: path
          description: The ID of the user on the account
          required: true
          schema:
            type: string
        - name: org_id
          in: path
          description: The ID of the organization
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A 200 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-GenericResponse
              examples:
                Example:
                  value:
                    message: success
        '400':
          description: A 400 response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/github.com-mailgun-users-api-GenericResponse
              examples:
                Example:
                  value:
                    message: 'Unable to remove user from org: error code 400'
      security:
        - basicAuth: []
components:
  schemas:
    github.com-mailgun-influx-httpapi-SendMessageResponse:
      type: object
      properties:
        id:
          type: string
          description: >-
            The unique identifier of the message as defined by
            [RFC-2392](https://datatracker.ietf.org/doc/html/rfc2392).
        message:
          type: string
          description: A success message
      required:
        - id
        - message
    github.com-mailgun-influx-httpapi-GetMessageResponseNotFound:
      type: object
      properties:
        message:
          type: string
          description: A failure message
      required:
        - message
    string:
      type: string
    POST-v3-domain_name-messages-multipart-form-data-RequestBody:
      type: object
      properties:
        from:
          type: string
          description: >-
            Email address of the `From` header. Can include a friendly name
            using the format `"Friendly Name <email@domain.com>"`. Note: not
            required if sending with a template that has a pre-set From header,
            but will override the template's From header if provided.
        to:
          type: array
          items:
            type: string
          description: >-
            Email address of the recipient(s). Supports friendly name format.
            Example: `"Bob <bob@host.com>"`. Use commas to separate multiple
            recipients. Duplicate addresses are automatically ignored.
        cc:
          type: array
          items:
            type: string
          description: >-
            Same as `to` but for carbon copy recipients. Supports friendly name
            format.
        bcc:
          type: array
          items:
            type: string
          description: >-
            Same as `to` but for blind carbon copy recipients. Supports friendly
            name format.
        subject:
          type: string
          description: >-
            Message subject. Note: not required if sending with a template that
            has a pre-set Subject header, but it will override it if provided.
        text:
          type: string
          description: Body of the message (text version)
        html:
          type: string
          description: Body of the message (HTML version)
        amp-html:
          type: string
          description: >-
            AMP part of the message.  Please follow Google guidelines to compose
            and send AMP emails
        attachment:
          type: array
          items:
            type: string
            format: binary
          description: >-
            File attachment.  You can post multiple `attachment` values. 
            **Important:** You must use `multipart/form-data` encoding for
            sending attachments
        inline:
          type: array
          items:
            type: string
            format: binary
          format: binary
          description: >-
            Attachment with `inline` disposition.  Can be used to send inline
            images (see example). You can post multiple `inline` values
        template:
          type: string
          description: >-
            Name of a template stored via the Templates API to use to render the
            email body. See
            [Templates](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-templates)
            for more information
        t:version:
          type: string
          description: >-
            Render a specific version of the given template instead of the
            latest version. `template` option must also be provided.
        t:text:
          type: string
          enum:
            - 'yes'
          description: >-
            Generates a plain text version of the template alongside the HTML
            version when sending templated emails. When set to 'yes', instructs
            Mailgun to create a text/plain MIME part based on the template
            content, ensuring compatibility with email clients that don't
            support HTML or have HTML rendering disabled. This improves email
            deliverability and accessibility by providing a fallback text
            version in multipart emails.
          x-enumDescriptions:
            'yes': Render template in the text part of the message
        t:variables:
          type: string
          description: >-
            A valid JSON-encoded dictionary used as the input for template
            variable expansion.  See
            [Templates](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-templates)
            for more information
        o:tag:
          type: array
          items:
            type: string
          description: >-
            Tag string.  See
            [Tagging](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/track-tagging)
            for more information
        o:dkim:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            Enables or disables DKIM signatures on a per-message basis.
            Overrides the domain-level DKIM setting for this specific message.
          x-enumDescriptions:
            'yes': Enables DKIM signatures
            'no': Disable DKIM signatures
            'true': Enables DKIM signatures
            'false': Disable DKIM signatures
        o:secondary-dkim:
          type: string
          description: >-
            Specify a second domain key to sign the email with. The value is
            formatted as `signing_domain/selector`, e.g. `example.com/s1`. This
            tells Mailgun to sign the message with the signing domain
            `example.com` using the selector `s1`. Note: the domain key
            specified must have been previously created and activated.
        o:secondary-dkim-public:
          type: string
          description: >-
            Specify an alias of the domain key specified in `o:secondary-dkim`.
            Also formatted as `public_signing_domain/selector`.
            `o:secondary-dkim` option must also be provided. Mailgun will sign
            the message with the provided key of the secondary DKIM, but use the
            public secondary DKIM name and selector. Note: We will perform a DNS
            check prior to signing the message to ensure the public keys matches
            the secondary DKIM.
        o:deliverytime:
          type: string
          description: >-
            Specifies the scheduled delivery time in [RFC-2822
            format](https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#date-format).
            Depending on your plan, you can schedule messages up to 3 or 7 days
            in advance. If your domain has a custom message_ttl (time-to-live)
            setting, this value determines the maximum scheduling duration.
            Example: 'Fri, 14 Oct 2011 12:00:00 +0000'
        o:deliverytime-optimize-period:
          type: string
          description: >-
            Toggles Send Time Optimization (STO) on a per-message basis.  String
            should be set to the number of hours in `[0-9]+h` format, with the
            minimum being `24h` and the maximum being `72h`.  This value defines
            the time window in which Mailgun will run the optimization algorithm
            based on prior engagement data of a given recipient. See [Sending a
            Message with
            STO](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-sto)
            for details. *Please note that STO is only available on certain
            plans. See www.mailgun.com/pricing for more info*
        o:time-zone-localize:
          type: string
          description: >-
            Toggles Timezone Optimization (TZO) on a per message basis. String
            should be set to preferred delivery time in `HH:mm` or `hh:mmaa`
            format, where `HH:mm` is used for 24 hour format without AM/PM and
            hh:mmaa is used for 12 hour format with AM/PM. See [Sending a
            Message with
            TZO](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-tzo)
            for details. *Please note that TZO is only available on certain
            plans. See www.mailgun.com/pricing for more info*
        o:testmode:
          type: string
          enum:
            - 'yes'
          description: >-
            Enables sending in test mode. Messages are processed normally but
            not actually delivered to recipients. Useful for testing without
            sending real emails. See [Sending in Test
            Mode](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/test-mode)
          x-enumDescriptions:
            'yes': Send in test mode
        o:tracking:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
            - htmlonly
          description: Toggles both click and open tracking on a per-message basis
          x-enumDescriptions:
            'yes': Enable tracking on a per-message basis
            'no': Disable tracking on a per-message basis
            'true': Enable tracking on a per-message basis
            'false': Disable tracking on a per-message basis
            htmlonly: >-
              Use if you only want links rewritten in the HTML part of the
              message
        o:tracking-clicks:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
            - htmlonly
          description: >-
            Toggles click tracking on a per-message basis, see [Tracking
            Clicks](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/tracking-clicks). 
            This overrides the domain-level click tracking setting.
          x-enumDescriptions:
            'yes': Enable tracking on a per-message basis
            'no': Disable tracking on a per-message basis
            'true': Enable tracking on a per-message basis
            'false': Disable tracking on a per-message basis
            htmlonly: >-
              Use if you only want links rewritten in the HTML part of the
              message
        o:tracking-opens:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            Toggles opens tracking on a per-message basis, see [Tracking
            Opens](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/tracking-opens). 
            Has higher priority than domain-level setting.
          x-enumDescriptions:
            'yes': Enables opens tracking
            'no': Disable opens tracking
            'true': Enables opens tracking
            'false': Disable opens tracking
        o:require-tls:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            When set to 'yes', requires the message to be sent only over a TLS
            connection to the Email Service Provider. If TLS cannot be
            established, the message will not be delivered. When set to 'no'
            (default), Mailgun attempts TLS but falls back to plaintext SMTP if
            needed.
          x-enumDescriptions:
            'yes': Message only be sent over a TLS connection
            'no': Message do not require to be sent over a TLS connection
            'true': Message only be sent over a TLS connection
            'false': Message do not require to be sent over a TLS connection
        o:skip-verification:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            If `true`, the certificate and hostname of the resolved MX Host will
            not be verified when trying to establish a TLS connection. If
            `false`, Mailgun will verify the certificate and hostname. If either
            one can not be verified, a TLS connection will not be established.
            The default is `false`
          x-enumDescriptions:
            'yes': Verification skipped
            'no': Verification active
            'true': Verification skipped
            'false': Verification active
        o:sending-ip:
          type: string
          description: >-
            Used to specify an IP Address to send an email that is owned by your
            account
        o:sending-ip-pool:
          type: string
          description: >-
            If an IP Pool ID is provided, the email will be delivered with an IP
            that belongs in that pool
        o:tracking-pixel-location-top:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
            - htmlonly
          description: >-
            Places the tracking pixel at the top of emails instead of the
            bottom. Useful for long emails that may be truncated or have
            rendering issues, ensuring open tracking works accurately.
          x-enumDescriptions:
            'yes': Enables tracking
            'no': Disable tracking
            'true': Enables tracking
            'false': Disable tracking
            htmlonly: >-
              Use if you only want links rewritten in the HTML part of the
              message
        o:archive-to:
          type: string
          description: >-
            Sends a copy of successfully delivered messages to the specified URL
            via HTTP POST. The request uses Content-Type: application/mime and
            contains the exact message the recipient's SMTP server received.
            NOTE: These are accounted for and billed as delivered messages
        o:suppress-headers:
          type: string
          description: >-
            Removes specified X-Mailgun headers from the delivered message.
            Provide header names separated by commas (e.g.,
            'X-Mailgun-Variables,X-Mailgun-Tag') or use 'all' to remove all
            X-Mailgun headers.Note: X-Mailgun-Sid header is currently used to
            process complains received via feedback loops.
        h:X-My-Header:
          type: string
          description: >-
            Adds custom headers to the email. Use 'h:' prefix followed by header
            name and value. Example: 'h:X-Custom-Header=my-value'
        v:my-var:
          type: string
          description: >-
            Attaches custom data to the message using the 'v:' prefix followed
            by a variable name. When sending with templates, provides values for
            template variable substitution (overridden by 't:variables' if both
            are provided). When not using templates, treated as metadata and
            included in events/webhooks. Variables are visible in the delivered
            email's X-Mailgun-Variables header. Example: 'v:user-id=123'. NOTE:
            Anything over 4KB will be truncated in the event/webhooks.
        recipient-variables:
          type: string
          description: >-
            A JSON-encoded dictionary for batch sending with personalized
            variables per recipient. Each key is a recipient email address, each
            value is a dictionary of variables for that recipient. Variables can
            be referenced in the message using %recipient.variablename%.
            Example: '{"alice@example.com": {"name":"Alice", "id":1},
            "bob@example.com": {"name":"Bob", "id":2}}'. Maximum 1,000
            recipients per batch. See [Batch
            Sending](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/batch-sending)
            for more information
      required:
        - from
        - to
        - subject
      additionalProperties: true
    POST-v3-domain_name-messages-mime-multipart-form-data-RequestBody:
      type: object
      properties:
        to:
          type: array
          items:
            type: string
          description: >-
            Email address of the recipient(s). Supports friendly name format.
            Example: `"Bob <bob@host.com>"`. Use commas to separate multiple
            recipients. Duplicate addresses are automatically ignored.
        message:
          type: string
          format: binary
          description: >-
            MIME string of the message.  Make sure to use `multipart/form-data`
            content type to send this as a file upload
        template:
          type: string
          description: >-
            Name of a template stored via template API to use to render the
            email body. See
            [Templates](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-templates)
            for more information
        t:version:
          type: string
          description: >-
            Render a specific version of the given template instead of the
            latest version. `template` option must also be provided.
        t:text:
          type: string
          enum:
            - 'yes'
          description: >-
            Generates a plain text version of the template alongside the HTML
            version when sending templated emails. When set to 'yes', instructs
            Mailgun to create a text/plain MIME part based on the template
            content, ensuring compatibility with email clients that don't
            support HTML or have HTML rendering disabled. This improves email
            deliverability and accessibility by providing a fallback text
            version in multipart emails.
          x-enumDescriptions:
            'yes': Render template in the text part of the message
        t:variables:
          type: string
          description: >-
            A valid JSON-encoded dictionary used as the input for template
            variable expansion. See
            [Templates](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-templates)
            for more information
        o:tag:
          type: array
          items:
            type: string
          description: >-
            Tag string.  See
            [Tags](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/track-tagging)
            for more information
        o:dkim:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            Enables or disables DKIM signatures on a per-message basis.
            Overrides the domain-level DKIM setting for this specific message.
          x-enumDescriptions:
            'yes': Enables DKIM signatures
            'no': Disable DKIM signatures
            'true': Enables DKIM signatures
            'false': Disable DKIM signatures
        o:secondary-dkim:
          type: string
          description: >-
            Specify a second domain key to sign the email with. The value is
            formatted as `signing_domain/selector`, e.g. `example.com/s1`. This
            tells Mailgun to sign the message with the signing domain
            `example.com` using the selector `s1`. Note: the domain key
            specified must have been previously created and activated.
        o:secondary-dkim-public:
          type: string
          description: >-
            Specify an alias of the domain key specified in `o:secondary-dkim`.
            Also formatted as `public_signing_domain/selector`.
            `o:secondary-dkim` option must also be provided. Mailgun will sign
            the message with the provided key of the secondary DKIM, but use the
            public secondary DKIM name and selector. Note: We will perform a DNS
            check prior to signing the message to ensure the public keys matches
            the secondary DKIM.
        o:deliverytime:
          type: string
          description: >-
            Specifies the scheduled delivery time in [RFC-2822
            format](https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#date-format).
            Depending on your plan, you can schedule messages up to 3 or 7 days
            in advance. If your domain has a custom message_ttl (time-to-live)
            setting, this value determines the maximum scheduling duration.
            Example: 'Fri, 14 Oct 2011 12:00:00 +0000'
        o:deliverytime-optimize-period:
          type: string
          description: >-
            Toggles Send Time Optimization (STO) on a per-message basis.  String
            should be set to the number of hours in `[0-9]+h` format, with the
            minimum being `24h` and the maximum being `72h`.  This value defines
            the time window in which Mailgun will run the optimization algorithm
            based on prior engagement data of a given recipient.  See [Sending a
            Message with
            STO](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-sto)
            for details. *Please note that STO is only available on certain
            plans. See www.mailgun.com/pricing for more info*
        o:time-zone-localize:
          type: string
          description: >-
            Toggles Timezone Optimization (TZO) on a per message basis. String
            should be set to preferred delivery time in `HH:mm` or `hh:mmaa`
            format, where `HH:mm` is used for 24 hour format without AM/PM and
            hh:mmaa is used for 12 hour format with AM/PM. See [Sending a
            Message with
            TZO](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/send-tzo)
            for details.  *Please note that TZO is only available on certain
            plans. See www.mailgun.com/pricing for more info*
        o:testmode:
          type: string
          enum:
            - 'yes'
          description: >-
            Enables sending in test mode. Messages are processed normally but
            not actually delivered to recipients. Useful for testing without
            sending real emails. See [Sending in Test
            Mode](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/test-mode)
          x-enumDescriptions:
            'yes': Send in test mode
        o:tracking:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
            - htmlonly
          description: >-
            Toggles both click and open tracking on a per-message basis, see
            [Tracking
            Messages](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages)
            for details.
          x-enumDescriptions:
            'yes': Enable tracking on a per-message basis
            'no': Disable tracking on a per-message basis
            'true': Enable tracking on a per-message basis
            'false': Disable tracking on a per-message basis
            htmlonly: >-
              Use if you only want links rewritten in the HTML part of the
              message
        o:tracking-clicks:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
            - htmlonly
          description: >-
            Toggles click tracking on a per-message basis, see [Tracking
            Clicks](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/tracking-clicks). 
            This overrides the domain-level click tracking setting
          x-enumDescriptions:
            'yes': Enable tracking on a per-message basis
            'no': Disable tracking on a per-message basis
            'true': Enable tracking on a per-message basis
            'false': Disable tracking on a per-message basis
            htmlonly: >-
              Use if you only want links rewritten in the HTML part of the
              message
        o:tracking-opens:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            Toggles opens tracking on a per-message basis, see [Tracking
            Opens](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/tracking-opens).
            Has higher priority than domain-level setting.
          x-enumDescriptions:
            'yes': Enables opens tracking
            'no': Disable opens tracking
            'true': Enables opens tracking
            'false': Disable opens tracking
        o:require-tls:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            When set to 'yes', requires the message to be sent only over a TLS
            connection. If TLS cannot be established, the message will not be
            delivered. When set to 'no' (default), Mailgun attempts TLS but
            falls back to plaintext SMTP if needed.
          x-enumDescriptions:
            'yes': Message only be sent over a TLS connection
            'no': Message do not require to be sent over a TLS connection
            'true': Message only be sent over a TLS connection
            'false': Message do not require to be sent over a TLS connection
        o:skip-verification:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
          description: >-
            When set to 'true', skips certificate and hostname verification for
            TLS connections. When 'false' (default), Mailgun verifies
            certificates and hostnames - if verification fails, TLS connection
            is not established.
          x-enumDescriptions:
            'yes': Verification skipped
            'no': Verification active
            'true': Verification skipped
            'false': Verification active
        o:sending-ip:
          type: string
          description: >-
            Used to specify an IP Address to send an email that is owned by your
            account
        o:sending-ip-pool:
          type: string
          description: >-
            If an IP Pool ID is provided, the email will be delivered with an IP
            that belongs in that pool
        o:tracking-pixel-location-top:
          type: string
          enum:
            - 'yes'
            - 'no'
            - 'true'
            - 'false'
            - htmlonly
          description: >-
            Places the tracking pixel at the top of emails instead of the
            bottom. Useful for long emails that may be truncated or have
            rendering issues, ensuring open tracking works accurately.
          x-enumDescriptions:
            'yes': Enables tracking
            'no': Disable tracking
            'true': Enables tracking
            'false': Disable tracking
            htmlonly: >-
              Use if you only want links rewritten in the HTML part of the
              message
        o:archive-to:
          type: string
          description: >-
            Sends a copy of successfully delivered messages to the specified URL
            via HTTP POST. The request uses Content-Type: application/mime and
            contains the exact message the recipient's SMTP server received.
            NOTE: These are accounted for and billed as delivered messages
        o:suppress-headers:
          type: string
          description: >-
            Removes specified X-Mailgun headers from the delivered message.
            Provide header names separated by commas (e.g.,
            'X-Mailgun-Variables,X-Mailgun-Tag') or use 'all' to remove all
            X-Mailgun headers.Note: X-Mailgun-Sid header is currently used to
            process complains received via feedback loops.
        h:X-My-Header:
          type: string
          description: >-
            Adds custom headers to the email. Use 'h:' prefix followed by header
            name and value. Example: 'h:X-Custom-Header=my-value'
        v:my-var:
          type: string
          description: >-
            Attaches custom data to the message using the 'v:' prefix followed
            by a variable name. When sending with templates, provides values for
            template variable substitution (overridden by 't:variables' if both
            are provided). When not using templates, treated as metadata and
            included in events/webhooks. Variables are visible in the delivered
            email's X-Mailgun-Variables header. Example: 'v:user-id=123'.NOTE:
            Anything over 4KB will be truncated in the event/webhooks
        recipient-variables:
          type: string
          description: >-
            A JSON-encoded dictionary for batch sending with personalized
            variables per recipient. Each key is a recipient email address, each
            value is a dictionary of variables for that recipient. Variables can
            be referenced in the message using %recipient.variablename%.
            Example: '{"alice@example.com": {"name":"Alice", "id":1},
            "bob@example.com": {"name":"Bob", "id":2}}'. Maximum 1,000
            recipients per batch. See [Batch
            Sending](https://documentation.mailgun.com/docs/mailgun/user-manual/sending-messages/batch-sending)
            for more information.
      required:
        - to
        - message
      additionalProperties: true
    POST-v3-domains-domain_name-messages-storage_key-multipart-form-data-RequestBody:
      type: object
      properties:
        to:
          type: string
          description: >-
            Email address of the recipient(s). Supports friendly name format.
            Example: `"Bob <bob@host.com>"`. Use commas to separate multiple
            recipients. Duplicate addresses are automatically ignored.
      required:
        - to
    github.com-mailgun-influx-httpapi-GetMessageResponseBasicExample:
      type: object
      properties:
        Content-Transfer-Encoding:
          type: string
          description: The content transfer encoding if enabled
        Content-Type:
          type: string
          description: The content type sent with the message with a possible boundary
        From:
          type: string
          description: The full 'From' email address entry of the email
        Message-Id:
          type: string
          description: >-
            The unique identifier of the message as defined by
            [RFC-2392](https://datatracker.ietf.org/doc/html/rfc2392)
        Mime-Version:
          type: string
          description: The MIME version of the email
        Subject:
          type: string
          description: Subject of the email
        To:
          type: string
          description: The full 'To' email address entries
        X-Mailgun-Tag:
          type: string
          description: The raw tags of the message if provided
        sender:
          type: string
          description: Just the email address from the provided 'From'' field
        recipients:
          type: string
          description: A list of email addresses from the 'To'' field
        body-html:
          type: string
          description: The full HTML body of the full message
        body-plain:
          type: string
          description: The plain text body of the full message
        stripped-html:
          type: string
          description: Only the body of the email in HTML
        stripped-text:
          type: string
          description: Only the body of the email in plain text
        stripped-signature:
          type: string
          description: The signature stripped from the body
        message-headers:
          type: array
          items:
            type: array
            items:
              type: string
          description: The full list of headers of the MIME upon send
        X-Mailgun-Template-Name:
          type: string
          description: The name of the template if one was used
        X-Mailgun-Template-Variables:
          type: string
          description: The variables used in the template if one was used
      required:
        - Content-Transfer-Encoding
        - Content-Type
        - From
        - Message-Id
        - Mime-Version
        - Subject
        - To
        - X-Mailgun-Tag
        - sender
        - recipients
        - body-html
        - body-plain
        - stripped-html
        - stripped-text
        - stripped-signature
        - message-headers
        - X-Mailgun-Template-Name
        - X-Mailgun-Template-Variables
    github.com-mailgun-influx-httpapi-GetMessageResponseBadRequest:
      type: object
      properties:
        message:
          type: string
          description: A failure message
      required:
        - message
    github.com-mailgun-domains-client-golang-Disabled:
      type: object
      properties:
        code:
          type: string
          description: Code indicating the reason for the domain being disabled
        note:
          type: string
          description: Additional information about why the domain was disabled
        permanently:
          type: boolean
          description: Indicates whether the domain is permanently disabled
        reason:
          type: string
          description: Additional information about why the domain was disabled
        until:
          type: string
          description: >-
            Timestamp in RFC1123 format indicating when the domain will be
            re-enabled if the disablement is temporary
      required:
        - code
        - note
        - permanently
        - reason
    github.com-mailgun-domains-client-golang-Domain:
      type: object
      properties:
        archive_to:
          type: string
          description: >-
            URL that a copy of each successfully delivered message is going to
            be posted to.
        created_at:
          type: string
          description: Timestamp indicating when the domain was created in RFC1123 format
        id:
          type: string
          description: Unique identifier of the domain
        is_disabled:
          type: boolean
          description: Indicates whether the domain is currently disabled
        name:
          type: string
          description: Fully qualified domain name registered with Mailgun
        require_tls:
          type: boolean
          description: If true Mailgun will only send messages over a TLS connection
        skip_verification:
          type: boolean
          description: >-
            If true Mailgun will not verify the certificate and hostname when
            setting up a TLS connection 
        smtp_login:
          type: string
          description: SMTP login username for the domain
        smtp_password:
          type: string
          description: Optional SMTP password for the domain used for SMTP authentication
        spam_action:
          type: string
          description: >-
            Action to take when a message is flagged as spam. Options are
            disabled
        subaccount_id:
          type: string
          description: >-
            The subaccount ID the domain belongs to. This field is only present
            if the domain is associated with a subaccount
        state:
          type: string
          description: Current verification status of the domain
        type:
          type: string
          description: Classification of the domain. Possible values are custom or sandbox
        tracking_host:
          type: string
          description: >-
            Custom tracking host for the domain used for tracking opens and
            clicks if configured
        use_automatic_sender_security:
          type: boolean
          description: >-
            If true Mailgun manages DKIM key generation and DNS record
            configuration automatically
        web_prefix:
          type: string
          description: Subdomain prefix used for open and click tracking
        web_scheme:
          type: string
          description: Protocol scheme used for tracking
        wildcard:
          type: boolean
          description: >-
            Indicates if the domain is a wildcard domain and can receive emails
            for any subdomain
        disabled:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-client-golang-Disabled
            - type: 'null'
          description: >-
            Optional field containing additional details about the domain's
            disabled status if applicable
        encrypt_incoming_message:
          type: boolean
          description: If true incoming messages to this domain will be encrypted
        message_ttl:
          type: integer
          format: int32
          description: >-
            Specifies the time-to-live (TTL) in seconds for retrieving both
            incoming and outgoing messages. The maximum TTL value is determined
            by your subscription plan
      required:
        - created_at
        - id
        - is_disabled
        - name
        - require_tls
        - skip_verification
        - smtp_login
        - spam_action
        - state
        - type
        - use_automatic_sender_security
        - web_prefix
        - web_scheme
        - wildcard
        - encrypt_incoming_message
        - message_ttl
    github.com-mailgun-domains-client-golang-Record:
      type: object
      properties:
        is_active:
          type: boolean
          description: Indicates whether the DNS record is currently active
        cached:
          type: array
          items:
            type: string
          description: List of Mailguns cached values for the DNS record
        name:
          type: string
          description: Name of the DNS record if applicable
        priority:
          type: string
          description: Priority value for MX DNS records
        record_type:
          type: string
          description: Type of DNS record such as MX TXT or CNAME
        valid:
          type: string
          description: Indicates whether the DNS record is valid
        value:
          type: string
          description: Expected value of the DNS record
      required:
        - is_active
        - cached
        - record_type
        - valid
        - value
    github.com-mailgun-domains-httpapi-CreateDomainResp:
      type: object
      properties:
        message:
          type: string
          description: Response message
        domain:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-client-golang-Domain
            - type: 'null'
          description: Details of the newly created domain
        receiving_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for receiving emails
        sending_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for sending emails
      required:
        - message
        - domain
        - receiving_dns_records
        - sending_dns_records
    github.com-mailgun-scaffold-httpapi-GenericResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
      required:
        - message
    POST-v4-domains-multipart-form-data-RequestBody:
      type: object
      properties:
        archive_to:
          type: string
          description: >-
            If set to a URL, then each successfully delivered message will be
            submitted in an HTTP POST request to the URL. The Content-Type of
            the POST requests is application/mime and the request body is
            exactly what the recipient SMTP server received.
        dkim_host_name:
          type: string
          description: >-
            Set the DKIM host name for the domain that is being created.  Note,
            the value must be a valid domain name, and can be the domain name
            being created, a subdomain of the domain being created, or the root
            domain. This parameter cannot be used in conjunction with
            force_dkim_authority or force_root_dkim_host.
        dkim_key_size:
          type: string
          description: The size of the new domain's DKIM key. Shall be either 1024 or 2048.
        dkim_selector:
          type: string
          description: >-
            Explicitly set the value of the DKIM selector for the domain being
            created. If the domain key does not already exist, one will be
            created.  The selector must be a valid atom per RFC2822. e.g valid
            value `foobar`, invalid value `foo.bar`


            https://datatracker.ietf.org/doc/html/rfc2822#section-3.2.4
        encrypt_incoming_message:
          type: boolean
          description: >-
            Enable encrypting incoming messages for the given domain. This
            cannot be altered via API after being set for security purposes.
            Reach out to Support to disable if necessary. Default to false
        force_dkim_authority:
          type: boolean
          description: >-
            If set to true, the domain will be the DKIM authority for itself
            even if the root domain is registered on the same mailgun account.
            If set to false, the domain will have the same DKIM authority as the
            root domain registered on the same mailgun account. Default to
            false.
        force_root_dkim_host:
          type: boolean
          description: >-
            If set to true, the root domain will be the DKIM Host for the domain
            being created even if the root domain itself is not registered with
            Mailgun. The domain being created will still need to pass domain
            verification with valid spf records for the domain and valid DKIM
            record for the root domain.  This does not effect the smtp mail-from
            host for the domain being created. The mail-from host will remain
            the domain name being created, not the root domain.
        wildcard:
          type: boolean
          description: >-
            Allows domain to accept inbound messages received on subdomains that
            have MX records pointed to Mailgun. Default is false.
        name:
          type: string
          description: The name of the new domain
        pool_id:
          type: string
          description: Requested IP Pool to be assigned to the domain at creation.
        ips:
          type: string
          description: >-
            An optional, comma-separated list of IP addresses to be assigned to
            this domain. If not specified, all dedicated IP addresses on the
            account will be assigned. If the request cannot be fulfilled (e.g. a
            requested IP is not assigned to the account, etc), a 400 will be
            returned.
        require_tls:
          type: boolean
          description: >-
            If set to true, this requires messages for the domain only be sent
            over a TLS connection. If a TLS connection cannot be established,
            Mailgun will not deliver the message.


            If set to false, Mailgun will still try and upgrade the connection,
            but if Mailgun cannot, the message will be delivered over a
            plaintext SMTP connection.


            The default value is false.
        skip_verification:
          type: boolean
          description: >-
            If set to true, the certificate and hostname will not be verified
            when trying to establish a TLS connection and Mailgun will accept
            any certificate during delivery of a message.


            If set to false, Mailgun will verify the certificate and hostname.
            If either one can not be verified, a TLS connection will not be
            established.


            The default value is false.
        spam_action:
          type: string
          description: >-
            Disabled, block or tag. Default to disabled. If disabled, no spam
            filtering will occur for inbound messages.


            If block, inbound spam messages will not be delivered.


            If tag, inbound messages will be tagged with a spam header. See Spam
            Filter.
        smtp_password:
          type: string
          description: Password for SMTP authentication
        use_automatic_sender_security:
          type: boolean
          description: >-
            Enable Automatic Sender Security. This requires setting DNS CNAME
            entries for DKIM keys instead of a TXT record. Defaults to false.
        web_prefix:
          type: string
          description: >-
            Sets your open, click and unsubscribe URLs domain name prefix. Links
            rewritten or added by Mailgun in your emails will look like
            <web_scheme>://<web_prefix>.<domain_name>/... Default to email
        web_scheme:
          type: string
          description: >-
            Sets your open, click and unsubscribe URLs to use http or https.
            Value either `http` or `https`. Defaults to http. In order for https
            to work, you must have a valid cert created for your domain. See
            Domain Tracking for TLS cert generation.
        message_ttl:
          type: integer
          description: >-
            Specifies the time-to-live (TTL) in seconds for retrieving both
            incoming and outgoing messages. The maximum TTL value is determined
            by your subscription plan.
      required:
        - name
    github.com-mailgun-domains-httpapi-ListDomainResponse:
      type: object
      properties:
        total_count:
          type: integer
          format: int32
          description: Total number of domains
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-domains-client-golang-Domain
          description: List of domains
      required:
        - total_count
        - items
    github.com-mailgun-domains-httpapi-FindDomainByNameResp:
      type: object
      properties:
        domain:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-client-golang-Domain
            - type: 'null'
          description: Domain details
        receiving_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for receiving emails
        sending_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for sending emails
      required:
        - domain
    github.com-mailgun-domains-httpapi-VerifyDomainResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        domain:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-client-golang-Domain
            - type: 'null'
          description: Domain record information
        sending_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for sending emails
        receiving_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for receiving emails
      required:
        - message
        - domain
        - sending_dns_records
        - receiving_dns_records
    github.com-mailgun-domains-httpapi-WebhookResponse:
      type: object
      properties:
        urls:
          type: array
          items:
            type: string
          description: List of webhooks
    github.com-mailgun-domains-httpapi-CreateDomainWebhookResp:
      type: object
      properties:
        message:
          type: string
          description: A message indicating success
        webhook:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookResponse
          description: Webhook details
      required:
        - message
        - webhook
    github.com-mailgun-scaffold-httpapi-GenericAPIError:
      type: object
      properties:
        Reason:
          type: string
      required:
        - Reason
    POST-v3-domains-domain-webhooks-multipart-form-data-RequestBody:
      type: object
      properties:
        id:
          type: string
          description: >-
            Webhook type to create. Valid types are `accepted`, `clicked`,
            `opened`, `unsubscribed`, `delivered`, `permanent_fail`,
            `temporary_fail`, `complained`
        url:
          type: string
          description: >-
            url(s) for webhooks to be sent to. Use multiple times to associate
            more than one url. Maximum of 3 urls for a given webhook type.
      required:
        - id
        - url
    PUT-v3-domains-domain_name-webhooks-webhook_name-multipart-form-data-RequestBody:
      type: object
      properties:
        url:
          type: string
          description: >-
            New url(s) to associate to webhook. Use multiple times to associate
            more than one url. Maximum of 3 urls for a given type.
      required:
        - url
    github.com-mailgun-domains-httpapi-GetDomainWebhookResp:
      type: object
      properties:
        webhook:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookResponse
          description: List of webhooks
      required:
        - webhook
    github.com-mailgun-domains-httpapi-WebhookURLs:
      type: object
      properties:
        urls:
          type: array
          items:
            type: string
          description: List of URLs
      required:
        - urls
    github.com-mailgun-domains-httpapi-WebhooksResponse:
      type: object
      properties:
        accepted:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Accepted webhook URLs
        delivered:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Delivered webhook URLs
        opened:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Opened webhook URLs
        clicked:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Clicked webhook URLs
        unsubscribed:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Unsubscribed webhook URLs
        complained:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Complained webhook URLs
        temporary_fail:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Temporary fail webhook URLs
        permanent_fail:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhookURLs
            - type: 'null'
          description: Permanent fail webhook URLs
    github.com-mailgun-domains-httpapi-GetAllDomainWebhooksResp:
      type: object
      properties:
        webhooks:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-WebhooksResponse
          description: List of webhooks
      required:
        - webhooks
    github.com-mailgun-domains-httpapi-openSettings:
      type: object
      properties:
        active:
          type: boolean
          description: Whether open tracking is enabled or not
        place_at_the_top:
          type: boolean
          description: If the pixel should be placed at the top of the email
      required:
        - active
        - place_at_the_top
    github.com-mailgun-domains-httpapi-clickSettings:
      type: object
      properties:
        active:
          type: boolean
          description: Whether click tracking is enabled or not
      required:
        - active
    github.com-mailgun-domains-httpapi-unsubscribeSettings:
      type: object
      properties:
        active:
          type: boolean
          description: Whether unsubscribe tracking is enabled or not
        html_footer:
          type: string
          description: The HTML footer for the unsubscribe link
        text_footer:
          type: string
          description: The text footer for the unsubscribe link
      required:
        - active
        - html_footer
        - text_footer
    github.com-mailgun-domains-httpapi-trackingSettings:
      type: object
      properties:
        open:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-openSettings
          description: Open tracking settings
        click:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-clickSettings
          description: Click tracking settings
        unsubscribe:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-unsubscribeSettings
          description: Unsubscribe tracking settings
        web_scheme:
          type: string
          description: The web scheme for the domain
      required:
        - open
        - click
        - unsubscribe
        - web_scheme
    github.com-mailgun-domains-httpapi-GetDomainTrackingResp:
      type: object
      properties:
        tracking:
          $ref: >-
            #/components/schemas/github.com-mailgun-domains-httpapi-trackingSettings
      required:
        - tracking
    github.com-mailgun-domains-httpapi-UpdateDomainTrackingClickResp:
      type: object
      properties:
        message:
          type: string
          description: A message indicating success
        click:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-clickSettings
          description: Click settings
      required:
        - message
        - click
    PUT-v3-domains-name-tracking-click-multipart-form-data-RequestBody:
      type: object
      properties:
        active:
          type: string
          description: >-
            Set param to `htmlonly`, `true`, or `false`.  Omit this param to
            make no change to the active status. Click tracking is consider as
            active if it's in the 'htmlonly' or 'true' state
    github.com-mailgun-domains-httpapi-UpdateDomainTrackingOpenResp:
      type: object
      properties:
        message:
          type: string
          description: A message indicating success
        open:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-openSettings
          description: Open settings
      required:
        - message
        - open
    PUT-v3-domains-name-tracking-open-multipart-form-data-RequestBody:
      type: object
      properties:
        active:
          type: boolean
          description: >-
            Set this param to true or false to toggle open tracking active
            status. Omit this param to keep current settings.
        place_at_the_top:
          type: boolean
          description: >-
            Setting this param to true will place the open tracking pixel at the
            top of the HTML body when inserted into the email mime. Omit this
            param to keep current setting.
    github.com-mailgun-domains-httpapi-UpdateDomainTrackingUnsubscribeResp:
      type: object
      properties:
        message:
          type: string
          description: A message indicating success
        unsubscribe:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-unsubscribeSettings
          description: Unsubscribe settings
      required:
        - message
        - unsubscribe
    PUT-v3-domains-name-tracking-unsubscribe-multipart-form-data-RequestBody:
      type: object
      properties:
        active:
          type: boolean
          description: >-
            This param will toggle the active status of unsubscribe tracking on
            the domain.
        html_footer:
          type: string
          description: >-
            Updates the html footer for the unsubscribe link inserted into the
            email html part of the mime.
        text_footer:
          type: string
          description: >-
            Updates the text footer for the unsubscribe link inserted into the
            email plain part of the mime.
    github.com-mailgun-domains-httpapi-DomainKeyResponse:
      type: object
      properties:
        signing_domain:
          type: string
        selector:
          type: string
        dns_record:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-client-golang-Record
            - type: 'null'
      required:
        - signing_domain
        - selector
    POST-v1-dkim-keys-multipart-form-data-RequestBody:
      type: object
      properties:
        signing_domain:
          type: string
          description: Signing domain to be used for the new domain key
        selector:
          type: string
          description: Selector to be used for the new domain key
        bits:
          type: integer
          description: Key size, can be 1024 or 2048
        pem:
          type: string
          description: Private key PEM file
      required:
        - signing_domain
        - selector
    github.com-mailgun-domains-httpapi-UpdateDomainKeyResp:
      type: object
      properties:
        message:
          type: string
        authority:
          type: string
        selector:
          type: string
        active:
          type: boolean
      required:
        - message
        - authority
        - selector
        - active
    github.com-mailgun-scaffold-httpapi-paging-PagingResponse:
      type: object
      properties:
        previous:
          type: string
          description: Previous page URL
        first:
          type: string
          description: First page URL
        next:
          type: string
          description: Next page URL
        last:
          type: string
          description: Last page URL
      required:
        - previous
        - first
        - next
        - last
    github.com-mailgun-domains-httpapi-DomainKeyListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-httpapi-DomainKeyResponse
              - type: 'null'
        paging:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
            - type: 'null'
      required:
        - items
    GET-v1-dkim-keys-multipart-form-data-RequestBody:
      type: object
      properties:
        page:
          type: string
          description: Encoded paging information, provided via 'next', 'previous' links
        limit:
          type: integer
          description: Limits the number of items returned in a request
        signing_domain:
          type: string
          description: Filter by signing domain
        selector:
          type: string
          description: Filter by selector
      required:
        - page
        - limit
    github.com-mailgun-domains-httpapi-ReassignDkimAuthorityResp:
      type: object
      properties:
        message:
          type: string
        sending_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
        changed:
          type: boolean
      required:
        - message
        - sending_dns_records
        - changed
    PUT-v3-domains-name-dkim_authority-multipart-form-data-RequestBody:
      type: object
      properties:
        self:
          type: boolean
          description: >-
            Change the DKIM authority for a domain.

            If set to true, the domain will be the DKIM authority for itself
            even if the root domain is registered on the same mailgun account
             If set to false, the domain will have the same DKIM authority as the root domain registered on the same mailgun account.
    PUT-v3-domains-name-dkim_selector-multipart-form-data-RequestBody:
      type: object
      properties:
        dkim_selector:
          type: string
          description: >-
            Update the DKIM selector for a domain. If omitted no change is
            committed.
    github.com-mailgun-domains-httpapi-UpdateDomainResp:
      type: object
      properties:
        message:
          type: string
          description: Success message
        domain:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-client-golang-Domain
            - type: 'null'
          description: Domain object
        receiving_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: List of DNS records required for receiving emails
        sending_dns_records:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-domains-client-golang-Record
              - type: 'null'
          description: ' List of DNS records required for sending emails'
      required:
        - message
        - domain
    PUT-v4-domains-name-multipart-form-data-RequestBody:
      type: object
      properties:
        archive_to:
          type: string
          description: >-
            If set to a URL, then each successfully delivered message will be
            submitted in an HTTP POST request to the URL. The Content-Type of
            the POST requests is application/mime and the request body is
            exactly what the recipient SMTP server received.
        mailfrom_host:
          type: string
          description: The hostname to update to. Must be in lower case
        message_ttl:
          type: integer
          description: >-
            Specifies the time-to-live (TTL) in seconds for retrieving both
            incoming and outgoing messages. The maximum TTL value is determined
            by your subscription plan.
        require_tls:
          type: boolean
          description: >-
            If set to true, this requires messages for the domain only be sent
            over a TLS connection. If a TLS connection cannot be established,
            Mailgun will not deliver the message.


            If set to false, Mailgun will still try and upgrade the connection,
            but if Mailgun cannot, the message will be delivered over a
            plaintext SMTP connection.


            The default value is false.
        skip_verification:
          type: boolean
          description: >-
            If set to true, the certificate and hostname will not be verified
            when trying to establish a TLS connection and Mailgun will accept
            any certificate during delivery of a message.


            If set to false, Mailgun will verify the certificate and hostname.
            If either one can not be verified, a TLS connection will not be
            established.


            The default value is false.
        smtp_password:
          type: string
          description: Updates the domain's SMTP credentials with the given string
        spam_action:
          type: string
          description: >-
            Updates the domain's spam action. Valid values are 'disabled',
            'tag', and 'block'
        use_automatic_sender_security:
          type: boolean
          description: >-
            Enable or disable Automatic Sender Security. If enabled, requires
            setting DNS CNAME entries for DKIM keys instead of a TXT record.
            Domain must be reverified after changing this field. Defaults to
            false
        web_scheme:
          type: string
          description: >-
            Updates your open, click and unsubscribe URLs to use http or https.
            Value either `http` or `https`. Defaults to http. In order for https
            to work, you must have a valid cert created for your domain. See
            Domain Tracking for TLS cert generation.
        web_prefix:
          type: string
          description: >-
            This updates the web prefix used for a domain's tracking features. 
            Must be a valid atom. Nothing will be updated if omitted. This
            impacts click, open, and unsubscribe tracking features. 

             Note: Updating the web prefix for a domain will require also updating the domain's DNS to include the CNAME record to match. For example, if you set the web prefix to `zed` for the domain `my-domain.com`, the corresponding CNAME `zed.my-domain.com` will need to be created in your domain's dns zone.
        wildcard:
          type: boolean
          description: Updates the domain's wildcard status with the given boolean
    github.com-mailgun-domains-httpapi-ExceededQueueQuotaDisabledJSON:
      type: object
      properties:
        until:
          type: string
          description: End date in RFC-822 date format
        reason:
          type: string
          description: Cause description
      required:
        - until
        - reason
    github.com-mailgun-domains-httpapi-ExceededQueueQuotaJSON:
      type: object
      properties:
        is_disabled:
          type: boolean
          description: Flag indicating no new messages are able to be submitted
        disabled:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-ExceededQueueQuotaDisabledJSON
          description: Disabled info
      required:
        - is_disabled
    github.com-mailgun-domains-httpapi-GetDomainSendingQueuesResp:
      type: object
      properties:
        regular:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-ExceededQueueQuotaJSON
          description: Message queue response
        scheduled:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-domains-httpapi-ExceededQueueQuotaJSON
          description: Scheduled message queue response
      required:
        - regular
        - scheduled
    github.com-mailgun-pendulum-dkim-DNSRecord:
      type: object
      properties:
        name:
          type: string
        type:
          type: string
        identifier:
          type: string
        value:
          type: string
        comment:
          type: string
      required:
        - name
        - type
        - identifier
        - value
        - comment
    github.com-mailgun-pendulum-api-Domain:
      type: object
      properties:
        id:
          type: string
        account_id:
          type: string
        sid:
          type: string
        name:
          type: string
        state:
          type: string
        active_selector:
          type: string
        rotation_enabled:
          type: string
        rotation_interval:
          type: string
        records:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-pendulum-dkim-DNSRecord'
      required:
        - id
        - account_id
        - sid
        - name
        - state
        - rotation_enabled
        - rotation_interval
    github.com-mailgun-pendulum-api-DomainResponse:
      type: object
      properties:
        domain:
          $ref: '#/components/schemas/github.com-mailgun-pendulum-api-Domain'
      required:
        - domain
    github.com-mailgun-scaffold-httpapi-NotFoundError:
      type: object
      properties:
        Description:
          type: string
      required:
        - Description
    PUT-v1-dkim_management-domains-name-rotation-multipart-form-data-RequestBody:
      type: object
      properties:
        rotation_enabled:
          type: boolean
          description: If true, enables DKIM Auto-Rotation. If false, disables it
        rotation_interval:
          type: string
          description: The interval at which to rotate keys. Example, '5d' for five days
      required:
        - rotation_enabled
    github.com-mailgun-tower-api-subaccounts-ListSubaccountDIPPsResponseItem:
      type: object
      properties:
        pool_id:
          type:
            - string
            - 'null'
        subaccount_id:
          type: string
      required:
        - pool_id
        - subaccount_id
    github.com-mailgun-tower-api-subaccounts-ListSubaccountDIPPsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-tower-api-subaccounts-ListSubaccountDIPPsResponseItem
        total_count:
          type: integer
          format: int32
      required:
        - items
        - total_count
    github.com-mailgun-tower-api-StartSagaResponse:
      type: object
      properties:
        message:
          type: string
        reference_id:
          type: string
      required:
        - message
        - reference_id
    github.com-mailgun-tower-api-account-Item:
      type: object
      properties:
        ips:
          type: array
          items:
            type: string
        domain:
          type: string
      required:
        - ips
        - domain
    github.com-mailgun-tower-api-account-domainsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-tower-api-account-Item'
        total_count:
          type: integer
          format: int32
      required:
        - items
        - total_count
    POST-v3-ips-addr-ip_band-multipart-form-data-RequestBody:
      type: object
      properties:
        ip_band:
          type: string
          description: Dedicated IP band to place the IP address into
      required:
        - ip_band
    github.com-mailgun-scaffold-httpapi-Response:
      type: object
      additionalProperties:
        type: object
    POST-v3-dynamic_pools-all-multipart-form-data-RequestBody:
      type: object
      properties:
        good_reputation:
          type: string
          description: IP(s) to include in the good_reputation pool
        poor_reputation:
          type: string
          description: IP(s) to include in the poor_reputation pool
        new_senders:
          type: string
          description: IP(s) to include in the new_senders pool
      required:
        - good_reputation
        - poor_reputation
        - new_senders
    PATCH-v3-dynamic_pools-pool_name-multipart-form-data-RequestBody:
      type: object
      properties:
        add_ip:
          type: string
          description: IP(s) to add to the pool
        remove_ip:
          type: string
          description: IP(s) to remove from the pool
      required:
        - add_ip
        - remove_ip
    POST-v3-ip_pools-multipart-form-data-RequestBody:
      type: object
      properties:
        description:
          type: string
          description: Description of the DIPP
        ip:
          type: string
          description: IP address to add to the DIPP (may be specified multiple times)
        name:
          type: string
          description: Short name of the DIPP
      required:
        - description
        - name
    PATCH-v3-ip_pools-pool_id-multipart-form-data-RequestBody:
      type: object
      properties:
        add_ip:
          type: string
          description: The IP to add to the DIPP (may be specified multiple times)
        description:
          type: string
          description: The new description for the DIPP
        link_domain:
          type: string
          description: >-
            The ID of the domain link to the DIPP (may be specified multiple
            times)
        name:
          type: string
          description: The new short for the DIPP
        remove_ip:
          type: string
          description: The IP to remove from the DIPP (may be specified multiple times)
        unlink_domain:
          type: string
          description: >-
            The ID of the domain to unlink from the DIPP (may be specified
            multiple times)
    github.com-mailgun-tower-api-ip_pools-add_ip-addMultipleIPsRequestBody:
      type: object
      properties:
        ips:
          type: array
          items:
            type: string
          description: IPs to add to the DIPP
      required:
        - ips
    github.com-mailgun-bandersnatch-model-Domain:
      type: object
      properties:
        id:
          type: string
        account_id:
          type: string
        account_name:
          type: string
        name:
          type: string
        registered_at:
          type: string
          format: date-time
        pool:
          type: string
        override:
          type: boolean
        bounce_rate:
          type:
            - number
            - 'null'
          format: float
        complaint_rate:
          type:
            - number
            - 'null'
          format: float
        processed_count:
          type:
            - integer
            - 'null'
          format: int64
      required:
        - id
        - account_id
        - account_name
        - name
        - registered_at
        - pool
        - override
    github.com-mailgun-scaffold-httpapi-paging-PagingURLs:
      type: object
      properties:
        Next:
          type: string
        Previous:
          type: string
        First:
          type: string
        Last:
          type: string
      required:
        - Next
        - Previous
        - First
        - Last
    github.com-mailgun-bandersnatch-api-DomainListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-bandersnatch-model-Domain'
        total_items:
          type: integer
          format: int32
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingURLs
      required:
        - items
        - total_items
        - paging
    github.com-mailgun-bandersnatch-model-HistoryRecord:
      type: object
      properties:
        id:
          type: string
        owning_account_id:
          type: string
        account_id:
          type: string
        account_name:
          type: string
        domain_id:
          type: string
        domain_name:
          type: string
        new_band:
          type: string
        prev_band:
          type: string
        reason:
          type: string
        bounce_rate:
          type:
            - number
            - 'null'
          format: float
        complaint_rate:
          type:
            - number
            - 'null'
          format: float
        processed_count:
          type:
            - integer
            - 'null'
          format: int64
        initiated_by:
          type: string
        timestamp:
          type: string
          format: date-time
      required:
        - id
        - owning_account_id
        - account_id
        - account_name
        - domain_id
        - domain_name
        - new_band
        - prev_band
        - reason
        - bounce_rate
        - timestamp
    github.com-mailgun-scaffold-httpapi-InvalidParameterError:
      type: object
      properties:
        Field:
          type: string
        Value:
          type: string
      required:
        - Field
        - Value
    PUT-v1-dynamic_pools-domains-name-override-multipart-form-data-RequestBody:
      type: object
      properties:
        pool:
          type: string
          description: >-
            The name of the Dynamic IP pool to override the domain with. Must be
            a valid pool name (ex: dynamic_good, dynamic_new, etc.)
      required:
        - pool
    github.com-mailgun-bandersnatch-api-ListHistoryResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-bandersnatch-model-HistoryRecord
        total_items:
          type: integer
          format: int32
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingURLs
      required:
        - items
        - total_items
        - paging
    github.com-mailgun-terminator-httpapi-StatusResponse:
      type: object
      properties:
        status:
          type: object
          description: >-
            Status of certificate. Either 'expired' 'processing' 'active' or
            'error'
        error:
          type:
            - string
            - 'null'
          description: An error message if an error occurred. Null if there is no error.
        certificate:
          type: string
          description: >-
            The x509 certificate in PEM format. Present only if the certificate
            status is 'active' 'error' or 'expired'
      required:
        - status
        - error
    github.com-mailgun-terminator-httpapi-GenerateResponse:
      type: object
      properties:
        message:
          type: string
          description: A message indicating the status of the request.
        location:
          type: string
          description: The URL path to check the status of the certificate.
      required:
        - message
        - location
    github.com-mailgun-scaffold-httpapi-ConflictError:
      type: object
      properties:
        Description:
          type: string
      required:
        - Description
    EventResponse:
      type: object
      title: EventResponse
      properties:
        method:
          type: string
        id:
          type: string
          description: GUID identifying the individual event
        event:
          $ref: '#/components/schemas/EventType'
        timestamp:
          type: number
          description: Unix epoch, in nanoseconds, when the event was first created
        log-level:
          type: string
          description: Logging categorization between
          enum:
            - info
            - warn
            - error
          x-enumDescriptions:
            info: Info event
            warn: Warn event
            error: Error event
        flags:
          type: object
          properties:
            is-authenticated:
              type: boolean
              description: '`true` if it’s an outgoing message. `false` if it’s incoming.'
            is-routed:
              type: boolean
              description: '`true` if the message was sent as a result of a Route match'
            is-amp:
              type: boolean
              description: Tells if the message has AMP component in
            is-encrypted:
              type: boolean
              description: Tells if the message has been encrypted before stored
            is-test-mode:
              type: boolean
              description: >-
                If `true`, the message has been marked as delivered but the
                actual send stop before sending to the ESP
        reject:
          type: object
          properties:
            reason:
              type: string
            description:
              type: string
        message:
          $ref: '#/components/schemas/MessageObject'
        tags:
          type: array
          items:
            type: string
        user-variables:
          type: object
          description: Variables included in the email
        storage:
          type: object
          properties:
            key:
              type: string
              description: Key ID for the stored MIME
            url:
              type: string
              description: URL for the stored MIME for retrieval, if required
            region:
              type: string
              description: The datacenter region the message is stored in
        geolocation:
          type: object
          description: Location data based on the client IP
          properties:
            country:
              type: string
            region:
              type: string
            city:
              type: string
        client-info:
          type: object
          properties:
            client-type:
              type: string
              description: >-
                Categorize client between: mobile browser, library, email
                client, robot, feed reader or other
            client-os:
              type: string
              description: The client Operating System
            device-type:
              type: string
              description: 'Could be: desktop, mobile, table or unknown'
            client-name:
              type: string
              description: The client product identifier
            user-agent:
              type: string
        ip:
          type: string
        delivery-status:
          $ref: '#/components/schemas/DeliveryStatusObject'
        batch:
          type: object
          properties:
            id:
              type: string
        severity:
          $ref: '#/components/schemas/EventSeverityType'
        recipient-domain:
          type: string
          description: ESP domain
        recipient-provider:
          type: string
          description: Name of the Inbox Provider for the given recipient, if known
        template:
          type: object
          properties:
            name:
              type: string
              description: Name of the template the message was rendered from, if given
            version:
              type: string
              description: The version of the template that was rendered
            is-text:
              type: string
              description: >-
                Tell if the template is considered as plain text (in opposition
                to ‘html’)
        envelope:
          $ref: '#/components/schemas/EnvelopeObject'
    MessageObject:
      type: object
      title: MessageObject
      properties:
        attachments:
          type: array
          items:
            type: object
            properties:
              filename:
                type: string
                description: The name of the file attached to the message
              content-type:
                type: string
                description: The type of the content attached to the message
              size:
                type: integer
                description: The attachment size in bytes
            required:
              - filename
              - content-type
              - size
        headers:
          type: object
          properties:
            message-id:
              type: string
            from:
              type: string
              description: Message FROM header
            to:
              type: string
              description: Message TO header
            subject:
              type: string
              description: Message Subject
          required:
            - message-id
            - from
        size:
          type: integer
          description: Total message size, in bytes
        scheduled-for:
          type: string
          description: Date/Time the message was scheduled for delivery on ingest
      required:
        - headers
        - attachments
        - size
    DeliveryStatusObject:
      type: object
      title: DeliveryStatusObject
      properties:
        code:
          type: integer
          description: SMTP status code received as a result of the ESP session
        attempt-no:
          type: integer
          description: The current attempt number trying to deliver the message to the ESP
        message:
          type: string
        description:
          type: string
        enhanced-code:
          type: string
          description: A more specific SMTP error code from the ESP
        mxhost:
          type: string
          description: The mailing host connected to for the SMTP session
        certificate-verified:
          type: boolean
        tls:
          type: boolean
          description: >-
            True if the SMTP session was performed over a TLS connection with
            the ESP
        utf8:
          type: boolean
          description: True if the SMTP session was able to use UTF-8 encoding
        first-delivery-attempt-seconds:
          type: number
          description: >-
            Time elapsed between when the message is accepted by us and the
            first delivery attempt to the email service provider (ESP)
        session-seconds:
          type: number
          description: The time, in seconds, the SMTP session for this message took
        retry-seconds:
          type: integer
          description: >-
            If the message failed for a reason that can be retried, the number
            of seconds between retry attempts. This value changes as the number
            of retries grows!
    EnvelopeObject:
      type: object
      title: EnvelopeObject
      properties:
        sender:
          type: string
          description: The sender address
        targets:
          type: string
          description: The recipient address
        transport:
          type: string
          description: The protocol used to make the send. Either http or smtp
        sending-ip:
          type: string
          description: The Mailgun IP the email has been sent from
    EventType:
      type: string
      description: >-
        The event name. See
        [Events](https://documentation.mailgun.com/docs/mailgun/user-manual/events/#introduction-to-events)
      enum:
        - accepted
        - delivered
        - failed
        - rejected
        - clicked
        - opened
        - unsubscribed
        - stored
        - complained
        - email_validation
        - list_member_uploaded
        - list_member_upload_error
        - list_uploaded
      x-enumDescriptions:
        accepted: >-
          Mailgun accepted the request to send/forward the email and the message
          has been placed in queue
        delivered: >-
          Mailgun sent the email, and it was accepted by the recipient email
          server
        failed: Mailgun could not deliver the email to the recipient email server
        rejected: Mailgun rejected the request to send/forward the email
        clicked: >-
          The email recipient clicked on a link in the email. Click tracking
          must be enabled in the Mailgun control panel, and the CNAME record
          must be pointing to mailgun.org
        opened: >-
          The email recipient opened the email and enabled image viewing. Open
          tracking must be enabled in the Mailgun control panel, and the CNAME
          record must be pointing to mailgun.org
        unsubscribed: >-
          The email recipient clicked on the unsubscribe link. Unsubscribe
          tracking must be enabled in the Mailgun control panel
        stored: Mail has stored an incoming message
        complained: >-
          The email recipient clicked on the spam complaint button within their
          email client. Feedback loops enable the notification to be received by
          Mailgun.
        email_validation: This event occurs onto email validation
        list_member_uploaded: This event occurs after successfully adding a member to a mailing list
        list_member_upload_error: This even occurs if an error occurs adding a member to a mailing list
        list_uploaded: >-
          This event occurs after successfully uploading a large list of members
          to a mailing list.
    EventSeverityType:
      description: >-
        Filter by event severity, if exists. Currently for failed events only.
        See [Tracking
        Failures](https://documentation.mailgun.com/docs/mailgun/user-manual/tracking-messages/#tracking-failures)
      type: string
      enum:
        - temporary
        - permanent
      x-enumDescriptions:
        temporary: >-
          Mailgun could not deliver the email to the recipient email server, but
          will retry
        permanent: >-
          Mailgun could not deliver the email to the recipient email server, and
          will drop the message without retrying sending.
    github.com-mailgun-scout-model-tags-TagItem:
      type: object
      properties:
        tag:
          type: string
        description:
          type: string
        first-seen:
          type: string
          format: date-time
        last-seen:
          type: string
          format: date-time
      required:
        - tag
        - description
    github.com-mailgun-scout-api-TagListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-scout-model-tags-TagItem'
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
      required:
        - items
        - paging
    github.com-mailgun-scout-api-TagAggregateResponse:
      type: object
      properties:
        tag:
          type: string
        provider:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
              format: int32
        country:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
              format: int32
        device:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
              format: int32
    github.com-mailgun-scout-model-types-StatType:
      type: object
      properties:
        type:
          type: string
        key:
          type: string
      required:
        - type
        - key
    github.com-mailgun-scout-model-stats-Accepted:
      type: object
      properties:
        incoming:
          type: integer
          format: int32
        outgoing:
          type: integer
          format: int32
        total:
          type: integer
          format: int32
      required:
        - incoming
        - outgoing
        - total
    github.com-mailgun-scout-model-stats-Delivered:
      type: object
      properties:
        smtp:
          type: integer
          format: int32
        http:
          type: integer
          format: int32
        optimized:
          type: integer
          format: int32
        total:
          type: integer
          format: int32
      required:
        - smtp
        - http
        - optimized
        - total
    github.com-mailgun-scout-model-stats-Failed:
      type: object
      properties:
        temporary:
          type: object
          properties:
            espblock:
              type: integer
              format: int32
            total:
              type: integer
              format: int32
          required:
            - espblock
            - total
        permanent:
          type: object
          properties:
            suppress-bounce:
              type: integer
              format: int32
            suppress-unsubscribe:
              type: integer
              format: int32
            suppress-complaint:
              type: integer
              format: int32
            bounce:
              type: integer
              format: int32
            delayed-bounce:
              type: integer
              format: int32
            webhook:
              type: integer
              format: int32
            optimized:
              type: integer
              format: int32
            total:
              type: integer
              format: int32
          required:
            - suppress-bounce
            - suppress-unsubscribe
            - suppress-complaint
            - bounce
            - delayed-bounce
            - webhook
            - optimized
            - total
      required:
        - temporary
        - permanent
    github.com-mailgun-scout-model-stats-Stored:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-Opened:
      type: object
      properties:
        total:
          type: integer
          format: int32
        unique:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-Clicked:
      type: object
      properties:
        total:
          type: integer
          format: int32
        unique:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-Unsubscribed:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-Complained:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-Campaign:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-EmailValidation:
      type: object
      properties:
        total:
          type: integer
          format: int32
        public:
          type: integer
          format: int32
        valid:
          type: integer
          format: int32
        single:
          type: integer
          format: int32
        bulk:
          type: integer
          format: int32
        list:
          type: integer
          format: int32
        mailgun:
          type: integer
          format: int32
        mailjet:
          type: integer
          format: int32
      required:
        - total
        - public
        - valid
        - single
        - bulk
        - list
        - mailgun
        - mailjet
    github.com-mailgun-scout-model-stats-SeedTest:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-BlocklistMonitoring:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-EmailPreview:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-EmailPreviewFailed:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-LinkValidation:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-LinkValidationFailed:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-scout-model-stats-StatsItem:
      type: object
      properties:
        time:
          type: string
        accepted:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Accepted'
        delivered:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Delivered'
        failed:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Failed'
        stored:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Stored'
        opened:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Opened'
        clicked:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Clicked'
        unsubscribed:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-Unsubscribed
        complained:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Complained'
        campaign:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-Campaign'
        email_validation:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-EmailValidation
        seed_test:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-stats-SeedTest'
        ip_blocklist_monitoring:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-BlocklistMonitoring
        domain_blocklist_monitoring:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-BlocklistMonitoring
        email_preview:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-EmailPreview
        email_preview_failed:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-EmailPreviewFailed
        link_validation:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-LinkValidation
        link_validation_failed:
          $ref: >-
            #/components/schemas/github.com-mailgun-scout-model-stats-LinkValidationFailed
      required:
        - time
    github.com-mailgun-scout-api-StatsResponse:
      type: object
      properties:
        tag:
          type: string
        description:
          type: string
        start:
          type: string
        end:
          type: string
        type:
          $ref: '#/components/schemas/github.com-mailgun-scout-model-types-StatType'
        resolution:
          type: string
        stats:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-scout-model-stats-StatsItem
      required:
        - description
        - start
        - end
        - resolution
        - stats
    github.com-mailgun-scout-api-StatTypesResponse:
      type: object
      properties:
        items:
          type: array
          items:
            type: string
      required:
        - items
    github.com-mailgun-scout-model-types-TagLimitItem:
      type: object
      properties:
        id:
          type: string
        limit:
          type: integer
          format: int32
        count:
          type: integer
          format: int32
      required:
        - limit
        - count
    github.com-mailgun-scout-api-ProvidersAggregateResponse:
      type: object
      properties:
        providers:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
              format: int32
    github.com-mailgun-scout-api-DevicesAggregateResponse:
      type: object
      properties:
        devices:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
              format: int32
    github.com-mailgun-scout-api-CountriesAggregateResponse:
      type: object
      properties:
        countries:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: integer
              format: int32
    github.com-mailgun-analytics-client-golang-Pagination:
      type: object
      properties:
        sort:
          type: string
          description: >-
            Colon-separated value indicating column name and sort direction e.g.
            'domain:asc'.
        skip:
          type: integer
          format: int64
          description: >-
            The number of items to skip over when satisfying the request. To get
            the first page of data set skip to zero.  Then increment the skip by
            the limit for subsequent calls.
        limit:
          type: integer
          format: int64
          description: The maximum number of items returned in the response.
        total:
          type: integer
          format: int64
          description: The total number of items in the query result set.
      required:
        - sort
        - skip
        - limit
        - total
    github.com-mailgun-analytics-client-golang-Dimension:
      type: object
      properties:
        dimension:
          type: string
          description: The dimension
        value:
          type: string
          description: The dimension value
        display_value:
          type: string
          description: The dimension value in displayable form
      required:
        - dimension
        - value
        - display_value
    github.com-mailgun-analytics-internal-api-RegularMetrics:
      type: object
      properties:
        accepted_incoming_count:
          type: integer
          format: int64
        accepted_outgoing_count:
          type: integer
          format: int64
        accepted_count:
          type: integer
          format: int64
        delivered_smtp_count:
          type: integer
          format: int64
        delivered_http_count:
          type: integer
          format: int64
        delivered_optimized_count:
          type: integer
          format: int64
        delivered_count:
          type: integer
          format: int64
        stored_count:
          type: integer
          format: int64
        processed_count:
          type: integer
          format: int64
        sent_count:
          type: integer
          format: int64
        opened_count:
          type: integer
          format: int64
        clicked_count:
          type: integer
          format: int64
        unique_opened_count:
          type: integer
          format: int64
        unique_clicked_count:
          type: integer
          format: int64
        unsubscribed_count:
          type: integer
          format: int64
        complained_count:
          type: integer
          format: int64
        failed_count:
          type: integer
          format: int64
        temporary_failed_count:
          type: integer
          format: int64
        permanent_failed_count:
          type: integer
          format: int64
        temporary_failed_esp_block_count:
          type: integer
          format: int64
          description: Use instead of esp_block_count.
        permanent_failed_esp_block_count:
          type: integer
          format: int64
        rate_limit_count:
          type: integer
          format: int64
        webhook_count:
          type: integer
          format: int64
        permanent_failed_optimized_count:
          type: integer
          format: int64
        permanent_failed_old_count:
          type: integer
          format: int64
        bounced_count:
          type: integer
          format: int64
        hard_bounces_count:
          type: integer
          format: int64
        soft_bounces_count:
          type: integer
          format: int64
        delayed_bounce_count:
          type: integer
          format: int64
        suppressed_bounces_count:
          type: integer
          format: int64
        suppressed_unsubscribed_count:
          type: integer
          format: int64
        suppressed_complaints_count:
          type: integer
          format: int64
        delivered_first_attempt_count:
          type: integer
          format: int64
        delayed_first_attempt_count:
          type: integer
          format: int64
        delivered_subsequent_count:
          type: integer
          format: int64
        delivered_two_plus_attempts_count:
          type: integer
          format: int64
        delivered_rate:
          type: string
        opened_rate:
          type: string
        clicked_rate:
          type: string
        unique_opened_rate:
          type: string
        unique_clicked_rate:
          type: string
        unsubscribed_rate:
          type: string
        complained_rate:
          type: string
        bounce_rate:
          type: string
        fail_rate:
          type: string
        permanent_fail_rate:
          type: string
        temporary_fail_rate:
          type: string
        delayed_rate:
          type: string
    github.com-mailgun-analytics-internal-api-RegularItem:
      type: object
      properties:
        dimensions:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-analytics-client-golang-Dimension
        metrics:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-internal-api-RegularMetrics
    github.com-mailgun-analytics-internal-api-RegularAggregates:
      type: object
      properties:
        metrics:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-internal-api-RegularMetrics
      required:
        - metrics
    github.com-mailgun-analytics-internal-api-RegularMetricsResponse:
      type: object
      properties:
        start:
          type: string
        end:
          type: string
        resolution:
          type: string
        duration:
          type: string
        dimensions:
          type: array
          items:
            type: string
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-client-golang-Pagination
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-analytics-internal-api-RegularItem
        aggregates:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-internal-api-RegularAggregates
      required:
        - items
    github.com-mailgun-analytics-client-golang-LabeledValue:
      type: object
      properties:
        label:
          type: string
        value:
          type: string
      required:
        - label
        - value
    github.com-mailgun-analytics-client-golang-FilterPredicate:
      type: object
      properties:
        attribute:
          type: string
        comparator:
          type: string
        values:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-analytics-client-golang-LabeledValue
      required:
        - attribute
        - comparator
    github.com-mailgun-analytics-client-golang-FilterPredicateGroup:
      type: object
      properties:
        AND:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-analytics-client-golang-FilterPredicate
      required:
        - AND
    github.com-mailgun-analytics-client-golang-Query:
      type: object
      properties:
        start:
          type: string
          description: >-
            A start date (default: 7 days before current time). Must be in RFC
            2822 format:
            https://datatracker.ietf.org/doc/html/rfc2822.html#page-14
        end:
          type: string
          description: >-
            An end date (default: current time). Must be in RFC 2822 format:
            https://datatracker.ietf.org/doc/html/rfc2822.html#page-14
        resolution:
          type: string
          description: A resolution in the format of 'day' 'hour' 'month'. Default is day.
        duration:
          type: string
          description: >-
            A duration in the format of '1d' '2h' '2m'. If duration is provided
            then it is calculated from the end date and overwrites the start
            date.
        dimensions:
          type: array
          items:
            type: string
          description: Attributes of the metric data such as 'subaccount'.
        metrics:
          type: array
          items:
            type: string
          description: >-
            Name of the metrics to receive the stats for such as
            'processed_count'.
        filter:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-analytics-client-golang-FilterPredicateGroup
          description: Filters to apply to the query.
        include_subaccounts:
          type: boolean
          description: Include stats from all subaccounts.
        include_aggregates:
          type: boolean
          description: Include top-level aggregate metrics.
      required:
        - start
        - end
        - resolution
        - duration
        - dimensions
        - metrics
        - filter
        - include_subaccounts
        - include_aggregates
    github.com-mailgun-analytics-internal-api-UsageMetrics:
      type: object
      properties:
        processed_count:
          type: integer
          format: int64
        email_validation_count:
          type: integer
          format: int64
        email_validation_public_count:
          type: integer
          format: int64
        email_validation_valid_count:
          type: integer
          format: int64
        email_validation_single_count:
          type: integer
          format: int64
        email_validation_bulk_count:
          type: integer
          format: int64
        email_validation_list_count:
          type: integer
          format: int64
        email_validation_mailgun_count:
          type: integer
          format: int64
        email_validation_mailjet_count:
          type: integer
          format: int64
        email_preview_count:
          type: integer
          format: int64
        email_preview_failed_count:
          type: integer
          format: int64
        link_validation_count:
          type: integer
          format: int64
        link_validation_failed_count:
          type: integer
          format: int64
        seed_test_count:
          type: integer
          format: int64
        ip_blocklist_monitoring_count:
          type: integer
          format: int64
        domain_blocklist_monitoring_count:
          type: integer
          format: int64
    github.com-mailgun-analytics-internal-api-UsageItem:
      type: object
      properties:
        dimensions:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-analytics-client-golang-Dimension
        metrics:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-internal-api-UsageMetrics
    github.com-mailgun-analytics-internal-api-UsageAggregates:
      type: object
      properties:
        metrics:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-internal-api-UsageMetrics
      required:
        - metrics
    github.com-mailgun-analytics-internal-api-UsageMetricsResponse:
      type: object
      properties:
        start:
          type: string
        end:
          type: string
        resolution:
          type: string
        duration:
          type: string
        dimensions:
          type: array
          items:
            type: string
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-client-golang-Pagination
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-analytics-internal-api-UsageItem
        aggregates:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-internal-api-UsageAggregates
      required:
        - items
    github.com-mailgun-logs-api-pkg-api-model-Account:
      type: object
      properties:
        parent-id:
          type: string
        id:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-Campaign:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-DeliveryStatus:
      type: object
      properties:
        message:
          type: string
        attempt-no:
          type: integer
          format: int32
        code:
          type: integer
          format: int32
        bounce-type:
          type: string
        description:
          type: string
        session-seconds:
          type: number
          format: float
        retry-seconds:
          type: integer
          format: int32
        enhanced-code:
          type: string
        mx-host:
          type: string
        certificate-verified:
          type: boolean
        tls:
          type: boolean
        utf8:
          type: boolean
        first-delivery-attempt-seconds:
          type: number
          format: float
        last-code:
          type: integer
          format: int32
        last-message:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-Domain:
      type: object
      properties:
        name:
          type: string
      required:
        - name
    github.com-mailgun-logs-api-pkg-api-model-Envelope:
      type: object
      properties:
        sender:
          type: string
        transport:
          type: string
        sending-ip:
          type: string
        targets:
          type: string
        i-ip-pool-id:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-Storage:
      type: object
      properties:
        region:
          type: string
        env:
          type: string
        key:
          type: string
        url:
          type: array
          items:
            type: string
    github.com-mailgun-logs-api-pkg-api-model-Template:
      type: object
      properties:
        name:
          type: string
        version:
          type: string
        is-text:
          type: boolean
    github.com-mailgun-logs-api-pkg-api-model-MessageHeaders:
      type: object
      properties:
        to:
          type: string
        message-id:
          type: string
        from:
          type: string
        subject:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-Attachment:
      type: object
      properties:
        filename:
          type: string
        content-type:
          type: string
        size:
          type: integer
          format: int32
    github.com-mailgun-logs-api-pkg-api-model-Message:
      type: object
      properties:
        headers:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-MessageHeaders
        attachments:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Attachment
        recipients:
          type: array
          items:
            type: string
        size:
          type: integer
          format: int32
        scheduled-for:
          type: integer
          format: int64
    github.com-mailgun-logs-api-pkg-api-model-Flags:
      type: object
      properties:
        is-authenticated:
          type: boolean
        is-system-test:
          type: boolean
        is-routed:
          type: boolean
        is-amp:
          type: boolean
        is-test-mode:
          type: boolean
        is-delayed-bounce:
          type: boolean
        is-callback:
          type: boolean
        is-encrypted:
          type: boolean
      required:
        - is-authenticated
        - is-system-test
        - is-routed
        - is-test-mode
        - is-delayed-bounce
        - is-callback
    github.com-mailgun-logs-api-pkg-api-model-GeoLocation:
      type: object
      properties:
        city:
          type: string
        country:
          type: string
        region:
          type: string
        timezone:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-ClientInfo:
      type: object
      properties:
        client-name:
          type: string
        client-os:
          type: string
        client-type:
          type: string
        device-type:
          type: string
        user-agent:
          type: string
        ip:
          type: string
        bot:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-RoutesMatch:
      type: object
      properties:
        recipient:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-Routes:
      type: object
      properties:
        actions:
          type: string
        description:
          type: string
        expression:
          type: string
        id:
          type: string
        priority:
          type: integer
          format: int32
        match:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-RoutesMatch
    github.com-mailgun-logs-api-pkg-api-model-MailingList:
      type: object
      properties:
        address:
          type: string
        list-id:
          type: string
        sid:
          type: string
    github.com-mailgun-logs-api-pkg-api-model-LogEvent:
      type: object
      properties:
        id:
          type: string
        event:
          type: string
        '@timestamp':
          type: string
        account:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Account
        campaigns:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Campaign
        tags:
          type: array
          items:
            type: string
        method:
          type: string
        originating-ip:
          type: string
        api-key-id:
          type: string
        delivery-status:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-DeliveryStatus
        i-delivery-optimizer:
          type: string
        domain:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Domain
        recipient:
          type: string
        recipient-domain:
          type: string
        recipient-provider:
          type: string
        envelope:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Envelope
        storage:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Storage
        template:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Template
        log-level:
          type: string
        user-variables:
          type: string
        message:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Message
        flags:
          $ref: '#/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Flags'
        primary-dkim:
          type: string
        ip:
          type: string
        geolocation:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-GeoLocation
        client-info:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-ClientInfo
        severity:
          type: string
        reason:
          type: string
        routes:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Routes
        mailing-list:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-MailingList
        url:
          type: string
      required:
        - id
        - event
        - '@timestamp'
        - domain
    github.com-mailgun-logs-api-pkg-api-model-PagingResponse:
      type: object
      properties:
        previous:
          type: string
          description: Token to previous page
        next:
          type: string
          description: Token to next page
        first:
          type: string
          description: Token to first page
        last:
          type: string
          description: Token to last page
        total:
          type: integer
          format: int64
          description: Total number of items
    github.com-mailgun-logs-api-pkg-api-model-Aggregates:
      type: object
      properties:
        all:
          type: integer
          format: int64
        metrics:
          type: object
          additionalProperties:
            type: integer
            format: int64
    github.com-mailgun-logs-api-pkg-api-model-LogsResponse:
      type: object
      properties:
        start:
          type: string
        end:
          type: string
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-LogEvent
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-PagingResponse
        aggregates:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Aggregates
      required:
        - start
        - end
        - items
        - pagination
    github.com-mailgun-logs-api-pkg-api-model-LabeledValue:
      type: object
      properties:
        label:
          type: string
        value:
          type: string
      required:
        - label
        - value
    github.com-mailgun-logs-api-pkg-api-model-FilterPredicate:
      type: object
      properties:
        attribute:
          type: string
        comparator:
          type: string
        values:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-LabeledValue
      required:
        - attribute
        - comparator
        - values
    github.com-mailgun-logs-api-pkg-api-model-FilterPredicateGroup:
      type: object
      properties:
        AND:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-FilterPredicate
      required:
        - AND
    github.com-mailgun-logs-api-pkg-api-model-Pagination:
      type: object
      properties:
        sort:
          type: string
          description: >-
            Colon-separated value indicating column name and sort direction e.g.
            'timestamp:desc'.
        token:
          type: string
          description: A token to the requested page.
        limit:
          type: integer
          format: int32
          description: The maximum number of items returned (100 max).
    github.com-mailgun-logs-api-pkg-api-model-LogsRequest:
      type: object
      properties:
        start:
          type: string
          description: >-
            The start date (default: 1 day before current time). Must be in RFC
            2822 format:
            https://datatracker.ietf.org/doc/html/rfc2822.html#page-14
        end:
          type: string
          description: >-
            The end date (default: current time). Must be in RFC 2822 format:
            https://datatracker.ietf.org/doc/html/rfc2822.html#page-14
        events:
          type: array
          items:
            type: string
          description: The set of events to include.
        metric_events:
          type: array
          items:
            type: string
          description: >-
            Optional set of analytics metric events. Will be converted into
            corresponding events.
        filter:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-FilterPredicateGroup
          description: Filters to apply to the query.
        include_subaccounts:
          type: boolean
          description: Include logs from all subaccounts.
        include_totals:
          type: boolean
          description: Include total number of log entries.
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-logs-api-pkg-api-model-Pagination
    github.com-mailgun-tags-api-pkg-api-model-CustomTime:
      type: object
    github.com-mailgun-analytics-client-golang-Metrics:
      type: object
      properties:
        accepted_incoming_count:
          type: integer
          format: int64
        accepted_outgoing_count:
          type: integer
          format: int64
        accepted_count:
          type: integer
          format: int64
        delivered_smtp_count:
          type: integer
          format: int64
        delivered_http_count:
          type: integer
          format: int64
        delivered_optimized_count:
          type: integer
          format: int64
        delivered_count:
          type: integer
          format: int64
        stored_count:
          type: integer
          format: int64
        sent_count:
          type: integer
          format: int64
        opened_count:
          type: integer
          format: int64
        clicked_count:
          type: integer
          format: int64
        unique_opened_count:
          type: integer
          format: int64
        unique_clicked_count:
          type: integer
          format: int64
        unsubscribed_count:
          type: integer
          format: int64
        complained_count:
          type: integer
          format: int64
        failed_count:
          type: integer
          format: int64
        temporary_failed_count:
          type: integer
          format: int64
        permanent_failed_count:
          type: integer
          format: int64
        esp_block_count:
          type: integer
          format: int64
        temporary_failed_esp_block_count:
          type: integer
          format: int64
        permanent_failed_esp_block_count:
          type: integer
          format: int64
        rate_limit_count:
          type: integer
          format: int64
        webhook_count:
          type: integer
          format: int64
        permanent_failed_optimized_count:
          type: integer
          format: int64
        permanent_failed_old_count:
          type: integer
          format: int64
        bounced_count:
          type: integer
          format: int64
        hard_bounces_count:
          type: integer
          format: int64
        soft_bounces_count:
          type: integer
          format: int64
        delayed_bounce_count:
          type: integer
          format: int64
        suppressed_bounces_count:
          type: integer
          format: int64
        suppressed_unsubscribed_count:
          type: integer
          format: int64
        suppressed_complaints_count:
          type: integer
          format: int64
        delivered_first_attempt_count:
          type: integer
          format: int64
        delayed_first_attempt_count:
          type: integer
          format: int64
        delivered_subsequent_count:
          type: integer
          format: int64
        delivered_two_plus_attempts_count:
          type: integer
          format: int64
        processed_count:
          type: integer
          format: int64
        delivered_rate:
          type: string
        opened_rate:
          type: string
        clicked_rate:
          type: string
        unique_opened_rate:
          type: string
        unique_clicked_rate:
          type: string
        unsubscribed_rate:
          type: string
        complained_rate:
          type: string
        bounce_rate:
          type: string
        hard_bounce_rate:
          type: string
        soft_bounce_rate:
          type: string
        fail_rate:
          type: string
        permanent_fail_rate:
          type: string
        temporary_fail_rate:
          type: string
        delayed_rate:
          type: string
        email_validation_count:
          type: integer
          format: int64
        email_validation_public_count:
          type: integer
          format: int64
        email_validation_valid_count:
          type: integer
          format: int64
        email_validation_single_count:
          type: integer
          format: int64
        email_validation_bulk_count:
          type: integer
          format: int64
        email_validation_list_count:
          type: integer
          format: int64
        email_validation_mailgun_count:
          type: integer
          format: int64
        email_validation_mailjet_count:
          type: integer
          format: int64
        email_preview_count:
          type: integer
          format: int64
        email_preview_failed_count:
          type: integer
          format: int64
        link_validation_count:
          type: integer
          format: int64
        link_validation_failed_count:
          type: integer
          format: int64
        seed_test_count:
          type: integer
          format: int64
        accessibility_count:
          type: integer
          format: int64
        accessibility_failed_count:
          type: integer
          format: int64
        image_validation_count:
          type: integer
          format: int64
        image_validation_failed_count:
          type: integer
          format: int64
    github.com-mailgun-tags-api-pkg-api-model-Tag:
      type: object
      properties:
        account_id:
          type: string
        parent_account_id:
          type: string
        tag:
          type: string
        description:
          type: string
        first_seen:
          $ref: >-
            #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-CustomTime
        last_seen:
          $ref: >-
            #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-CustomTime
        metrics:
          $ref: >-
            #/components/schemas/github.com-mailgun-analytics-client-golang-Metrics
        account_name:
          type: string
      required:
        - account_id
        - parent_account_id
        - tag
        - description
        - account_name
    github.com-mailgun-tags-api-pkg-api-model-Pagination:
      type: object
      properties:
        sort:
          type: string
          description: >-
            Colon-separated value indicating column name and sort direction e.g.
            'lastseen:desc'.
        skip:
          type: integer
          format: int64
          description: >-
            The number of items to skip over when satisfying the request. To get
            the first page of data set skip to zero.  Then increment the skip by
            the limit for subsequent calls.
        limit:
          type: integer
          format: int64
          description: >-
            The maximum number of items returned in the response. Default 10 max
            1000.
        total:
          type: integer
          format: int64
          description: The total number of tags matching the search criteria.
        include_total:
          type: boolean
          description: >-
            Boolean indicating whether or not to include total number of items.
            Default false.
    github.com-mailgun-tags-api-pkg-api-model-TagsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-tags-api-pkg-api-model-Tag'
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-Pagination
      required:
        - items
    github.com-mailgun-tags-api-pkg-api-model-ListTagsRequest:
      type: object
      properties:
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-tags-api-pkg-api-model-Pagination
        include_subaccounts:
          type: boolean
          description: >-
            Boolean indicating whether or not to include data from all
            subaccounts. Default false.
        include_metrics:
          type: boolean
          description: >-
            Boolean indicating whether or not to include metrics for tags.
            Default false.  When true max limit is 20.
        tag:
          type: string
          description: The tag or tag prefix.
    github.com-mailgun-tags-api-pkg-api-model-UpdateTagRequest:
      type: object
      properties:
        tag:
          type: string
          description: The tag to update.
        description:
          type: string
          description: The updated tag description.
    github.com-mailgun-tags-api-pkg-api-model-DeleteTagRequest:
      type: object
      properties:
        tag:
          type: string
          description: The tag to delete.
    github.com-mailgun-tags-api-pkg-api-model-TagLimitCountResponse:
      type: object
      properties:
        limit:
          type: integer
          format: int32
        count:
          type: integer
          format: int64
        limit_reached:
          type: boolean
      required:
        - limit
        - count
        - limit_reached
    POST-v3-domainID-unsubscribes-import-multipart-form-data-RequestBody:
      type: object
      properties:
        file:
          type: string
          description: CSV file
      required:
        - file
    POST-v3-domainID-bounces-import-multipart-form-data-RequestBody:
      type: object
      properties:
        file:
          type: string
          description: CSV file
      required:
        - file
    POST-v3-domainID-complaints-import-multipart-form-data-RequestBody:
      type: object
      properties:
        file:
          type: string
          description: CSV file
      required:
        - file
    POST-v3-domainID-whitelists-import-multipart-form-data-RequestBody:
      type: object
      properties:
        file:
          type: string
          description: CSV file
      required:
        - file
    github.com-mailgun-holster-v4-clock-RFC822Time:
      type: object
    github.com-mailgun-blackbook-model-Bounce:
      type: object
      properties:
        address:
          type: string
          description: Email address for the original recipient
        code:
          type: string
          description: SMTP error code
        error:
          type: string
          description: SMTP error message
        created_at:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-holster-v4-clock-RFC822Time
          description: Timestamp for when the Bounce event was received in RFC822 format
      required:
        - address
        - code
        - error
        - created_at
    github.com-mailgun-blackbook-api-getBouncesPaginationResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Bounce'
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
      required:
        - items
        - paging
    github.com-mailgun-blackbook-api-BouncesList:
      type: array
      items:
        $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Bounce'
    POST-v3-domainID-bounces-application-form-data-RequestBody:
      type: object
      properties:
        address:
          type: string
          description: Valid email address
        code:
          type: string
          description: 'Error code (optional, default: 550)'
        error:
          type: string
          description: 'Error description (optional, default: empty string)'
        created_at:
          type: string
          description: >-
            Timestamp of a bounce event in RFC2822 format (optional, default:
            current time)
      required:
        - address
    github.com-mailgun-blackbook-api-suppressionResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        address:
          type: string
          description: Email address
      required:
        - message
        - address
    github.com-mailgun-blackbook-model-Unsubscribe:
      type: object
      properties:
        address:
          type: string
          description: Email address for the original recipient
        tags:
          type: array
          items:
            type: string
          description: Any tags present on the message the user clicked Unsubscribe on
        created_at:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-holster-v4-clock-RFC822Time
          description: >-
            Timestamp for when the unsubscribe request was received in RFC822
            format
      required:
        - address
        - tags
        - created_at
    github.com-mailgun-blackbook-api-getUnsubscribesPaginationResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-blackbook-model-Unsubscribe
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
      required:
        - items
        - paging
    github.com-mailgun-blackbook-api-UnsubscribesList:
      type: array
      items:
        $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Unsubscribe'
    POST-v3-domainID-unsubscribes-application-form-data-RequestBody:
      type: object
      properties:
        address:
          type: string
          description: Valid email address
        tags:
          type: string
          description: >-
            Tag to unsubscribe from, use * to unsubscribe an address from all
            domain’s correspondence (optional, default: *)
        created_at:
          type: string
          description: >-
            Timestamp of an unsubscribe event in RFC2822 format (optional,
            default: current time)
      required:
        - address
    github.com-mailgun-blackbook-model-Complaint:
      type: object
      properties:
        address:
          type: string
          description: Email address for the original recipient
        created_at:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-holster-v4-clock-RFC822Time
          description: Timestamp for when the Complaint event was received in RFC822 format
      required:
        - address
        - created_at
    github.com-mailgun-blackbook-api-getComplaintsPaginationResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Complaint'
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
      required:
        - items
        - paging
    github.com-mailgun-blackbook-api-ComplaintsList:
      type: array
      items:
        $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Complaint'
    POST-v3-domainID-complaints-application-form-data-RequestBody:
      type: object
      properties:
        address:
          type: string
          description: Valid email address
        created_at:
          type: string
          description: >-
            Timestamp of a complaint event in RFC2822 format (optional, default:
            current time)
      required:
        - address
    github.com-mailgun-blackbook-model-Whitelist:
      type: object
      properties:
        type:
          type: string
          description: Type of allowlist
        value:
          type: string
          description: Domain or address allowlisted
        createdAt:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-holster-v4-clock-RFC822Time
          description: Timestamp for when the entry was created in RFC822 format
        reason:
          type: string
          description: User-provided reason for allowlisting
      required:
        - type
        - value
        - createdAt
        - reason
    github.com-mailgun-blackbook-api-getWhitelistPaginationResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-blackbook-model-Whitelist'
        paging:
          $ref: >-
            #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
      required:
        - items
        - paging
    github.com-mailgun-blackbook-api-insertWhitelistRecordResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        type:
          type: string
          description: Type of allowlist
        value:
          type: string
          description: Domain or address
      required:
        - message
        - type
        - value
    POST-v3-domainID-whitelists-application-form-data-RequestBody:
      type: object
      properties:
        address:
          type: string
          description: >-
            Valid email address if you would like to allowlist email address
            (prior over 'domain' parameter)
        domain:
          type: string
          description: Valid domain name if you would like allowlist entire domain name
      required:
        - address
    github.com-mailgun-blackbook-api-deleteWhitelistRecordResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        value:
          type: string
          description: Domain or address
      required:
        - message
        - value
    RouteResponse:
      type: object
      title: RouteResponse
      properties:
        id:
          type: string
          description: Unique identifier of the route
        priority:
          type: integer
          description: >-
            Smaller number indicates higher priority. Higher priority routes are
            handled first.
        description:
          type: string
          description: An arbitrary string.
        expression:
          type: string
          description: The filtering rule.
        actions:
          type: array
          items:
            type: string
          description: These actions are executed when the expression evaluates to True.
        created_at:
          type: string
          description: Timestamp indicating when the route was created in RFC1123 format
      examples:
        - id: 4f3bad2335335426750048c6
          priority: 0
          description: Sample route
          expression: match_recipient(".*@samples.mailgun.org")
          actions:
            - forward("http://myhost.com/messages/")
            - stop()
          created_at: Wed, 15 Feb 2012 13:03:31 GMT
    ListMemberRequest:
      type: object
      title: Mailing list member
      properties:
        name:
          type: string
        address:
          type: string
        subscribed:
          type: boolean
        vars:
          type: object
      examples:
        - address: dev@mailgun.net
          name: Super Developer
          subscribed: true
          vars:
            department: Support
            rank: Monarch
            memo: Give them a raise
    MailingListResponse:
      type: object
      title: The mailing list response
      properties:
        address:
          type: string
          description: The email address of the mailing list
        name:
          type: string
          description: The name of the mailing list
        description:
          type: string
          description: A description of the mailing list
        access_level:
          type: string
          description: 'List access level, one of: readonly, members, everyone'
        reply_preference:
          type: string
          description: 'Set where replies should go: list or sender'
        created_at:
          type: string
          description: >-
            Timestamp indicating the mailing list creation time in RFC 5322
            format
        members_count:
          type: integer
          description: The number of members on the mailing list
      examples:
        - address: developers@mailgun.net
          name: Developers
          description: Describe the mailing list
          access_level: readonly
          reply_preference: list
          created_at: Tue, 09 Aug 2011 20:50:27 -0000
          members_count: 2
    ListMemberResponse:
      type: object
      title: ListMemberResponse
      properties:
        address:
          type: string
          description: The email address of the mailing list
        name:
          type: string
          description: The name of the mailing list
        vars:
          type: object
          description: >-
            A JSON-encoded dictionary string with arbitrary parameters, e.g.
            {"gender":"female","age":27}
        subscribed:
          type: boolean
          description: Whether the member is subscribed or not
      examples:
        - address: alice@example.com
          name: Alice
          vars:
            gender: female
            age: 27
          subscribed: true
    PaginateMailingListResponse:
      type: object
      title: PaginateMailingListResponse
      properties:
        paging:
          type: object
          properties:
            first:
              type: string
              description: URL to the first page
            next:
              type: string
              description: URL to the next page
            previous:
              type: string
              description: URL to the previous page
            last:
              type: string
              description: URL to the last page
        items:
          type: array
          items:
            $ref: '#/components/schemas/MailingListResponse'
      examples:
        - paging:
            first: https://url_to_next_page
            last: https://url_to_last_page
            next: https://url_to_next_page
            previous: https://url_to_previous_page
          items:
            - access_level: everyone
              address: dev@samples.mailgun.org
              created_at: Tue, 06 Mar 2012 05:44:45 GMT
              description: Mailgun developers list
              members_count: 1
              name: ''
            - access_level: readonly
              address: bar@example.com
              created_at: Wed, 06 Mar 2013 11:39:51 GMT
              description: ''
              members_count: 2
              name: ''
    PaginateListMemberResponse:
      type: object
      title: PaginateListMemberResponse
      properties:
        paging:
          type: object
          properties:
            first:
              type: string
            next:
              type: string
            last:
              type: string
            previous:
              type: string
        items:
          type: array
          items:
            $ref: '#/components/schemas/ListMemberResponse'
      examples:
        - items:
            - vars:
                age: 26
              name: Foo Bar
              subscribed: false
              address: bar@example.com
          paging:
            first: https://url_to_first_page
            last: https://url_to_last_page
            next: http://url_to_next_page
            previous: http://url_to_previous_page
    github.com-mailgun-temple-model-Version:
      type: object
      properties:
        tag:
          type: string
          description: Tag of the version. Must be unique to the template
        template:
          type: string
          description: Name of the template
        engine:
          type: string
          description: Rendering engine
        mjml:
          type: string
          description: Template source
        createdAt:
          type: string
          description: Creation date in RFC822 format
          readOnly: true
        comment:
          type: string
          description: Comment related to the version
        active:
          type: boolean
          description: If this flag is true
        id:
          type: string
          description: Template ID
          readOnly: true
        headers:
          type: object
          additionalProperties:
            type: string
          description: >-
            Key value JSON object of headers to be stored with the template.
            Where key is the header name and value is the header value. The
            header names `From`
      required:
        - tag
        - engine
        - mjml
        - createdAt
        - comment
        - active
        - id
    github.com-mailgun-temple-model-Template:
      type: object
      properties:
        name:
          type: string
          description: Name of the template
        description:
          type: string
          description: Description of the template
        createdAt:
          type: string
          description: Creation date in RFC822 format
          readOnly: true
        createdBy:
          type: string
          description: Indicate who created the template
        id:
          type: string
          description: Template ID
          readOnly: true
        version:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/github.com-mailgun-temple-model-Version'
          description: Active version information
          readOnly: true
        versions:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/github.com-mailgun-temple-model-Version'
          description: List of template's versions
          readOnly: true
      required:
        - name
    github.com-mailgun-temple-httpapi-createTemplateOrVersionResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        template:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/github.com-mailgun-temple-model-Template'
          description: Template details
      required:
        - message
        - template
    POST-v3-domain_name-templates-multipart-form-data-RequestBody:
      type: object
      properties:
        name:
          type: string
          description: >-
            Name of the template being stored. Supports utf-8 characters and
            name will be down cased.
        description:
          type: string
          description: Description of the template being stored
        createdBy:
          type: string
          description: >-
            Optional metadata field api user can indicate who created the
            template.
        template:
          type: string
          description: Content of the template.
        tag:
          type: string
          description: >-
            Initial tag of the created version. If the template parameter is
            provided and the tag is missing, the default value `initial` is
            used.
        comment:
          type: string
          description: >-
            Version comment. This is valid only if a new version is being
            created. (template parameter is provided.)
        headers:
          type: string
          description: >-
            Key value JSON object of headers to be stored with the template.
            Where key is the header name and value is the header value. The
            header names `From`, `Subject`, and `Reply-To` are the only ones
            currently supported.  These headers will be inserted into the MIME
            at the time we attempt delivery. 


            Headers set at the message level will override headers set on the
            template. e.g. Setting the From header at the time of sending will
            override the From header saved on the template. Additionally,
            headers generated by templates are not reflected on the accepted
            event as they are not prepended to the message until the message is
            prepped for delivery. if a From header is not provided either in the
            message or template, we will default to
            `postmaster@your-sending-domain.tld`
      required:
        - name
    POST-v3-domain_name-templates-template_name-versions-multipart-form-data-RequestBody:
      type: object
      properties:
        template:
          type: string
          description: Content of the template.
        tag:
          type: string
          description: >-
            Tag of the version that is being created. Must be unique to the
            template.
        comment:
          type: string
          description: Comment related to the version that is being created.
        active:
          type: string
          description: If this flag is set to yes, this version becomes active
        headers:
          type: string
          description: >-
            Key value JSON object of headers to be stored with the template.
            Where key is the header name and value is the header value. The
            header names `From`, `Subject`, and `Reply-To` are the only ones
            currently supported.  These headers will be inserted into the MIME
            at the time we attempt delivery. 


            Headers set at the message level will override headers set on the
            template. e.g. Setting the From header at the time of sending will
            override the From header saved on the template. Additionally,
            headers generated by templates are not reflected on the accepted
            event as they are not prepended to the message until the message is
            prepped for delivery. if a From header is not provided either in the
            message or template, we will default to
            `postmaster@your-sending-domain.tld`
      required:
        - template
        - tag
    github.com-mailgun-temple-httpapi-getTemplateOrVersionResponse:
      type: object
      properties:
        template:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/github.com-mailgun-temple-model-Template'
          description: Template details
      required:
        - template
    github.com-mailgun-temple-httpapi-getVersionsPageResponse:
      type: object
      properties:
        template:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/github.com-mailgun-temple-model-Template'
          description: Template details
        paging:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
          description: Pagination details
      required:
        - template
        - paging
    github.com-mailgun-temple-httpapi-getPageResponse:
      type: object
      properties:
        items:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/github.com-mailgun-temple-model-Template'
          description: List of items
        paging:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-scaffold-httpapi-paging-PagingResponse
          description: Pagination details
      required:
        - items
        - paging
    github.com-mailgun-temple-httpapi-versionCopyResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        version:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/github.com-mailgun-temple-model-Version'
          description: Created version details
        template:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/github.com-mailgun-temple-model-Version'
          description: 'Deprecated: Use ''version'' field'
          deprecated: true
      required:
        - message
        - version
        - template
    github.com-mailgun-temple-httpapi-versionUpdate:
      type: object
      properties:
        tag:
          type: string
          description: Tag of the version. Must be unique to the template
      required:
        - tag
    github.com-mailgun-temple-httpapi-templateUpdate:
      type: object
      properties:
        name:
          type: string
          description: Name of the template
        version:
          anyOf:
            - type: 'null'
            - $ref: >-
                #/components/schemas/github.com-mailgun-temple-httpapi-versionUpdate
          description: Template version details
      required:
        - name
    github.com-mailgun-temple-httpapi-updateOrDeleteTempateOrVersionResponse:
      type: object
      properties:
        message:
          type: string
          description: Response message
        template:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-temple-httpapi-templateUpdate
          description: Template change details
      required:
        - message
        - template
    PUT-v3-domain_name-templates-template_name-versions-version_name-multipart-form-data-RequestBody:
      type: object
      properties:
        template:
          type: string
          description: Content of the template.
        comment:
          type: string
          description: Comment related to the version that is being created.
        active:
          type: string
          description: If this flag is set to yes, this version becomes active
        headers:
          type: string
          description: >-
            Key value JSON object of headers to be stored with the template.
            Where key is the header name and value is the header value. The
            header names `From`, `Subject`, and `Reply-To` are the only ones
            currently supported.  These headers will be inserted into the MIME
            at the time we attempt delivery.
    PUT-v3-domain_name-templates-template_name-multipart-form-data-RequestBody:
      type: object
      properties:
        description:
          type: string
          description: Update description of the template being updated.
    github.com-mailgun-accounts-api-CustomMessageLimitResponse:
      type: object
      properties:
        limit:
          type: number
          description: The custom limit set for the account
        current:
          type: number
          description: The number of messages already sent
        period:
          type: string
          description: >-
            The timeframe for which the limit applies - m for months, d for
            days, h for hours
    github.com-mailgun-accounts-api-SubaccountStatus:
      type: string
      enum:
        - disabled
        - open
        - closed
      description: The status of the subaccount
      x-enumDescriptions:
        disabled: Account is disabled
        open: Account is open
        closed: Account is closed
    github.com-mailgun-accounts-api-Subaccount:
      type: object
      properties:
        id:
          type: string
          description: The ID of the subaccount
        name:
          type: string
          description: The name of the subaccount
        created_at:
          type: string
          description: The date when the account was created
        updated_at:
          type: string
          description: The date when the account was last updated
        status:
          $ref: >-
            #/components/schemas/github.com-mailgun-accounts-api-SubaccountStatus
        features:
          $ref: >-
            #/components/schemas/github.com-mailgun-accounts-api-FeaturesResponse
    github.com-mailgun-accounts-api-SubaccountResponse:
      type: object
      properties:
        subaccount:
          $ref: '#/components/schemas/github.com-mailgun-accounts-api-Subaccount'
    github.com-mailgun-accounts-api-SubaccountListResponse:
      type: object
      properties:
        subaccounts:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-accounts-api-Subaccount'
        total:
          type: integer
          description: The total number of subaccounts
    github.com-mailgun-accounts-api-HTTPSigningKey:
      type: object
      properties:
        message:
          type: string
          description: Success message
        http_signing_key:
          type: string
          description: Decoded webhook signing key
    github.com-mailgun-accounts-api-RecipientResponse:
      type: object
      properties:
        email:
          type: string
          description: Email address of sandbox domain recipient
        activated:
          type: boolean
          description: Activated/verified status of the recipient
    github.com-mailgun-accounts-api-FeaturesResponse:
      type: object
      additionalProperties: true
    github.com-mailgun-accounts-api-FeatureOverrideEnabledParam:
      type: object
      properties:
        enabled:
          type: boolean
          description: The enabled status of the feature
      required:
        - enabled
    github.com-mailgun-accounts-api-GenericSuccess:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates success of request
    github.com-mailgun-accounts-api-GenericMessage:
      type: object
      properties:
        message:
          type: string
          description: Response message
    github.com-mailgun-cerberus-keys-KeysResp:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-cerberus-keys-KeyInfoResp'
        total_count:
          type: integer
          format: int32
          description: The number of keys returned in 'items'
      required:
        - total_count
        - items
    github.com-mailgun-cerberus-keys-KeyInfoResp:
      type: object
      properties:
        id:
          type: string
          description: The ID for the key
        description:
          type: string
          description: The description provided for the key upon its creation
        kind:
          type: string
          description: The type of the key which determines how it can be used
        role:
          type: string
          description: >-
            The role of the key which determines its scope in CRUD operations
            that have role-based access control
        created_at:
          type: string
          description: When the key was created
        updated_at:
          type: string
          description: When the key was last updated
        expires_at:
          type: string
          description: When the key will expire
        secret:
          type: string
          description: The full api key secret in plain text
          format: password
        disabled_reason:
          type: string
          description: The reason for the key's disablement
        is_disabled:
          type: boolean
          description: Whether or not the key is disabled from use
        domain_name:
          type:
            - string
            - 'null'
          description: The sending domain associated with the key
        requestor:
          type:
            - string
            - 'null'
          description: An email address associated with the key
        user_name:
          type:
            - string
            - 'null'
          description: The api key user's name
      required:
        - id
        - description
        - kind
        - role
        - created_at
        - updated_at
        - domain_name
        - requestor
        - user_name
        - is_disabled
    github.com-mailgun-cerberus-keys-CreateKeyResp:
      type: object
      properties:
        message:
          type: string
          description: Response message
        key:
          $ref: '#/components/schemas/github.com-mailgun-cerberus-keys-KeyInfoResp'
      required:
        - message
        - key
    POST-v1-keys-multipart-form-data-RequestBody:
      type: object
      properties:
        email:
          type: string
          description: >-
            API Key user's email address; should be provided for all keys of
            'web' kind
        domain_name:
          type: string
          description: Web domain to associate with the key, for keys of 'domain' kind
        kind:
          type: string
          description: >-
            Type of api key ('domain', 'user', or 'web'). Defaults to 'user' if
            not provided. Note: web keys are not subject to IP whitelisting and
            have a default/maximum validity period of 1 day.
          enum:
            - domain
            - user
            - web
          x-enumDescriptions:
            domain: Create api key of type 'domain'
            user: Create api key of type 'user'
            web: Create api key of type 'web'
        expiration:
          type: integer
          description: Key lifetime in seconds, must be greater than 0 if set
        role:
          type: string
          description: >-
            Key role ('admin', 'basic' [use in place of analyst], 'sending' [use
            with keys of domain kind], 'support', or 'developer')
        user_id:
          type: string
          description: >-
            API Key user's string user ID; should be provided for all keys of
            'web' kind
        user_name:
          type: string
          description: API Key user's name
        description:
          type: string
          description: Key description
      required:
        - role
    github.com-mailgun-cerberus-keys-PublicKeyResp:
      type: object
      properties:
        key:
          type: string
          description: The account public key
        message:
          type: string
          description: Response message
      required:
        - key
        - message
    github.com-mailgun-cerberus-credentials-CredentialMetadata:
      type: object
      properties:
        mailbox:
          type: string
          description: The email address-style username associated with this credential
        login:
          type: string
          description: The email address-style username associated with this credential
        created_at:
          type: string
          description: When the credential was created
        size_bytes:
          type:
            - string
            - 'null'
      required:
        - mailbox
        - login
        - created_at
        - size_bytes
    github.com-mailgun-cerberus-credentials-ListCredsResp:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-cerberus-credentials-CredentialMetadata
        total_count:
          type: integer
          format: int32
          description: The number of credentials described in 'items'
      required:
        - items
        - total_count
    github.com-mailgun-cerberus-credentials-CreateCredsResp:
      type: object
      properties:
        message:
          type: string
          description: Response message
        note:
          type: string
          description: Note to store password (when generated by Mailgun)
        credentials:
          type: object
          additionalProperties:
            type: string
          description: Credential username/password values (when generated by Mailgun)
      required:
        - message
    POST-v3-domains-domain_name-credentials-multipart-form-data-RequestBody:
      type: object
      properties:
        login:
          type: string
          description: Email address of SMTP credential user; accepts multiple values
        mailbox:
          type: string
          description: >-
            Email address of SMTP credential user, may be used in place of
            'login'; accepts multiple values
        system:
          type: boolean
          description: Identify if these are system account credentials, defaults to false
        password:
          type: string
          description: >-
            Supply desired password(s) for the new credentials if preferred over
            generated ones; accepts multiple values
      required:
        - login
    PUT-v3-domains-domain_name-credentials-spec-multipart-form-data-RequestBody:
      type: object
      properties:
        password:
          type: string
          description: >-
            Supply desired password for the credentials to update if preferred
            over a generated one
    PUT-v3-domain_name-mailboxes-spec-multipart-form-data-RequestBody:
      type: object
      properties:
        password:
          type: string
          description: >-
            Supply desired password for the credentials to update if preferred
            over a generated one
    github.com-mailgun-cerberus-credentials-DeleteDomainCredsResp:
      type: object
      properties:
        message:
          type: string
          description: Response message
        count:
          type: integer
          format: int32
          description: The number of credentials deleted
      required:
        - message
        - count
    github.com-mailgun-cerberus-credentials-DeleteCredsResp:
      type: object
      properties:
        message:
          type: string
          description: Response message
        spec:
          type: string
          description: The mailbox username associated with the deleted credentials
      required:
        - message
        - spec
    github.com-mailgun-cerberus-whitelist-WhitelistRespEntry:
      type: object
      properties:
        ip_address:
          type: string
          description: Allowlisted IP address
        description:
          type: string
          description: Description of the allowlisted IP address
      required:
        - ip_address
        - description
    github.com-mailgun-cerberus-whitelist-V2WhitelistResp:
      type: object
      properties:
        addresses:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-cerberus-whitelist-WhitelistRespEntry
          description: Allowlisted IP address entries on the account
      required:
        - addresses
    POST-v2-ip_whitelist-multipart-form-data-RequestBody:
      type: object
      properties:
        description:
          type: string
          description: >-
            Description of the address to be added to the allowlist, defaults to
            empty string
        address:
          type: string
          description: Address to be added to the allowlist
      required:
        - address
    PUT-v2-ip_whitelist-multipart-form-data-RequestBody:
      type: object
      properties:
        description:
          type: string
          description: >-
            Description of the address to be updated in the allowlist, defaults
            to empty string
        address:
          type: string
          description: Address to be updated in the allowlist
      required:
        - address
    github.com-mailgun-bounce-classification-entities-Subaccount:
      type: object
      properties:
        id:
          type: string
      required:
        - id
    github.com-mailgun-bounce-classification-entities-Domain:
      type: object
      properties:
        name:
          type: string
      required:
        - name
    github.com-mailgun-bounce-classification-entities-BouncedStat:
      type: object
      properties:
        total:
          type: integer
          format: int32
      required:
        - total
    github.com-mailgun-bounce-classification-entities-Stat:
      type: object
      properties:
        subaccount:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-entities-Subaccount
            - type: 'null'
        domain:
          anyOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-entities-Domain
            - type: 'null'
        rule-id:
          type: string
        entity-id:
          type: string
        short-explanation:
          type: string
        bounced:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-entities-BouncedStat
      required:
        - bounced
    github.com-mailgun-bounce-classification-internal-api-ListStatsResp:
      type: object
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-entities-Stat
              - type: 'null'
        _duration:
          type: string
      required:
        - items
        - _duration
    github.com-mailgun-bounce-classification-entities-AccountStat:
      type: object
      properties:
        domain:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-entities-Domain
        bounced:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-entities-BouncedStat
      required:
        - domain
        - bounced
    github.com-mailgun-bounce-classification-internal-api-ListAccountStatsResp:
      type: object
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-entities-AccountStat
              - type: 'null'
        total:
          type:
            - integer
            - 'null'
          format: int32
        req:
          type: object
      required:
        - items
    github.com-mailgun-bounce-classification-entities-DomainStat:
      type: object
      properties:
        entity-id:
          type: string
        entity-name:
          type: string
        bounced:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-entities-BouncedStat
      required:
        - entity-id
        - entity-name
        - bounced
    github.com-mailgun-bounce-classification-internal-api-ListDomainStatsResp:
      type: object
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-entities-DomainStat
              - type: 'null'
      required:
        - items
    github.com-mailgun-bounce-classification-entities-EntityStat:
      type: object
      properties:
        rule-id:
          type: string
        category:
          type: string
        severity:
          type: string
        sample-text:
          type: string
        explanation:
          type: string
        bounced:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-entities-BouncedStat
      required:
        - rule-id
        - category
        - severity
        - sample-text
        - explanation
        - bounced
    github.com-mailgun-bounce-classification-internal-api-ListEntityStatsResp:
      type: object
      properties:
        items:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-entities-EntityStat
              - type: 'null'
      required:
        - items
    github.com-mailgun-bounce-classification-internal-config-Entity:
      type: object
      properties:
        name:
          type: string
      required:
        - name
    github.com-mailgun-bounce-classification-internal-config-Entities:
      type: object
      additionalProperties:
        $ref: >-
          #/components/schemas/github.com-mailgun-bounce-classification-internal-config-Entity
    github.com-mailgun-bounce-classification-internal-config-Rule:
      type: object
      properties:
        entity_id:
          type: string
        class:
          type: string
        sample-text:
          type: string
        explanation:
          type: string
        short-explanation:
          type: string
    github.com-mailgun-bounce-classification-internal-config-Rules:
      type: object
      additionalProperties:
        $ref: >-
          #/components/schemas/github.com-mailgun-bounce-classification-internal-config-Rule
    github.com-mailgun-bounce-classification-entities-Resolution:
      type: string
      enum:
        - day
        - hour
      description: Resolution of the metrics.
      x-enumDescriptions:
        day: Day
        hour: Hour
    github.com-mailgun-bounce-classification-internal-api-Dimension:
      type: string
      enum:
        - entity-name
        - domain.name
        - envelope.sending-ip
        - account.name
        - envelope.i-ip-pool-name
        - tags
        - tag
        - recipient-domain
        - group-id
        - criticality
        - severity
        - category
        - timestamp
      description: Dimension
      x-enumDescriptions:
        entity-name: Recipient Provider/Spam Filter, e.g. Gmail, Other US, Spamcop, etc.
        domain.name: Sender domain name, e.g. example.com
        envelope.sending-ip: Sending IP address
        account.name: Subaccount name
        envelope.i-ip-pool-name: IP Pool name
        tags: Tags. Not compatible with `tag` dimension.
        tag: Tag. Not compatible with `tags` dimension.
        recipient-domain: Recipient domain, e.g. gmail.com
        group-id: Group ID
        criticality: Criticality, e.g. CRITICAL or NON-CRITICAL
        severity: Severity, e.g. PERMANENT or TEMPORARY
        category: Category, e.g. BOUNCE, GENERIC, GREYLISTED, ESPBLOCK, etc.
        timestamp: BoD or BoH timestamp (depends on resolution)
    github.com-mailgun-bounce-classification-internal-api-PaginationResp:
      type: object
      properties:
        sort:
          type: string
          description: '''sort'' from the request'
        skip:
          type: integer
          format: int64
          description: '''skip'' from the request'
        limit:
          type: integer
          format: int64
          description: '''limit'' from the request'
        total:
          type: integer
          format: int64
          description: The total number of items in the query result set.
      required:
        - sort
        - skip
        - limit
        - total
    github.com-mailgun-bounce-classification-entities-MetricsCountsAndRates:
      type: object
      properties:
        critical_bounce_count:
          type: integer
          format: int64
        non_critical_bounce_count:
          type: integer
          format: int64
        critical_delay_count:
          type: integer
          format: int64
        non_critical_delay_count:
          type: integer
          format: int64
        classified_failures_count:
          type: integer
          format: int64
          description: Total bounces and delays
        delivered_smtp_count:
          type:
            - integer
            - 'null'
          format: int64
          description: null for Spam Filters
        critical_bounce_rate:
          type:
            - integer
            - 'null'
          format: int64
          description: Percentages; null for Spam Filters
        non_critical_bounce_rate:
          type:
            - integer
            - 'null'
          format: int64
          description: Percentages; null for Spam Filters
        critical_delay_rate:
          type:
            - integer
            - 'null'
          format: int64
          description: Percentages; null for Spam Filters
        non_critical_delay_rate:
          type:
            - integer
            - 'null'
          format: int64
          description: Percentages; null for Spam Filters
      required:
        - critical_bounce_count
        - non_critical_bounce_count
        - critical_delay_count
        - non_critical_delay_count
        - classified_failures_count
        - delivered_smtp_count
        - critical_bounce_rate
        - non_critical_bounce_rate
        - critical_delay_rate
        - non_critical_delay_rate
    github.com-mailgun-bounce-classification-entities-MetricsItem:
      type: object
      properties:
        account.id:
          type:
            - string
            - 'null'
        account.name:
          type:
            - string
            - 'null'
        entity-name:
          type:
            - string
            - 'null'
        recipient-provider:
          type:
            - string
            - 'null'
        recipient-domain:
          type:
            - string
            - 'null'
        domain.name:
          type:
            - string
            - 'null'
        envelope.i-ip-pool-id:
          type:
            - string
            - 'null'
        envelope.i-ip-pool-name:
          type:
            - string
            - 'null'
        envelope.sending-ip:
          type:
            - string
            - 'null'
        timestamp:
          type:
            - string
            - 'null'
        tags:
          type:
            - string
            - 'null'
          description: Concatenated tags
        tag:
          type:
            - string
            - 'null'
        criticality:
          type:
            - string
            - 'null'
        severity:
          type:
            - string
            - 'null'
        category:
          type:
            - string
            - 'null'
        group-id:
          type:
            - string
            - 'null'
        sample-text:
          type:
            - string
            - 'null'
        explanation:
          type:
            - string
            - 'null'
        metrics:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-entities-MetricsCountsAndRates
          description: Counts and rates
      required:
        - metrics
    github.com-mailgun-bounce-classification-internal-api-MetricsResponse:
      type: object
      properties:
        start:
          type: string
          description: >-
            A start timestamp in RFC 2822 format:
            https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#date-format
        end:
          type: string
          description: >-
            An end timestamp in RFC 2822 format:
            https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#date-format
        resolution:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-entities-Resolution
          description: '''resolution'' from the request'
        duration:
          type: string
          description: '''duration'' from the request'
        dimensions:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-bounce-classification-internal-api-Dimension
          description: '''dimensions'' from the request'
        pagination:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-internal-api-PaginationResp
        items:
          type: array
          items:
            anyOf:
              - $ref: >-
                  #/components/schemas/github.com-mailgun-bounce-classification-entities-MetricsItem
              - type: 'null'
      required:
        - start
        - end
        - resolution
        - pagination
        - items
    github.com-mailgun-bounce-classification-internal-api-FilterAttribute:
      type: string
      enum:
        - entity-name
        - domain.name
        - envelope.sending-ip
        - account.name
        - envelope.i-ip-pool-name
        - tags
        - tag
        - recipient-domain
        - group-id
        - criticality
        - severity
        - category
      description: Filter attribute
      x-enumDescriptions:
        entity-name: Recipient Provider/Spam Filter, e.g. Gmail, Other US, Spamcop, etc.
        domain.name: Sender domain name, e.g. example.com
        envelope.sending-ip: Sending IP address
        account.name: Subaccount name
        envelope.i-ip-pool-name: IP Pool name
        tags: Tags. Not compatible with `tag` dimension.
        tag: Tag. Not compatible with `tags` dimension.
        recipient-domain: Recipient domain, e.g. gmail.com
        group-id: Group ID
        criticality: Criticality, e.g. CRITICAL or NON-CRITICAL
        severity: Severity, e.g. PERMANENT or TEMPORARY
        category: Category, e.g. BOUNCE, GENERIC, GREYLISTED, ESPBLOCK, etc.
    github.com-mailgun-bounce-classification-internal-api-LabeledValue:
      type: object
      properties:
        label:
          type: string
        value:
          type: string
      required:
        - label
        - value
    github.com-mailgun-bounce-classification-internal-api-FilterPredicate:
      type: object
      properties:
        attribute:
          $ref: >-
            #/components/schemas/github.com-mailgun-bounce-classification-internal-api-FilterAttribute
        comparator:
          type: string
        values:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-bounce-classification-internal-api-LabeledValue
      required:
        - attribute
        - comparator
    github.com-mailgun-bounce-classification-internal-api-FilterPredicateGroup:
      type: object
      properties:
        AND:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-bounce-classification-internal-api-FilterPredicate
      required:
        - AND
    github.com-mailgun-bounce-classification-internal-api-PaginationReq:
      type: object
      properties:
        sort:
          type: string
          description: >-
            Colon-separated value indicating column name and sort direction e.g.
            'entity-name:asc'.
        skip:
          type: integer
          format: int64
          description: >-
            The number of items to skip over when satisfying the request. To get
            the first page of data set skip to zero. Then increment the skip by
            the limit for subsequent calls.
        limit:
          type: integer
          maximum: 50
          format: int64
          description: The maximum number of items returned in the response.
          default: 10
    github.com-mailgun-bounce-classification-internal-api-MetricsRequest:
      type: object
      properties:
        start:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-holster-v4-clock-RFC822Time
          description: >-
            A start timestamp (default: 7 days before current time). Must be in
            RFC 2822 format:
            https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#date-format
        end:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-holster-v4-clock-RFC822Time
          description: >-
            An end timestamp (default: current time). Must be in RFC 2822
            format:
            https://documentation.mailgun.com/docs/mailgun/api-reference/api-overview#date-format
        resolution:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-entities-Resolution
        duration:
          type: string
          description: >-
            A duration in the format of '48h' '60m' '30s'. If duration is
            provided then it is calculated from the end date and overwrites the
            start date.
        dimensions:
          type: array
          items:
            $ref: >-
              #/components/schemas/github.com-mailgun-bounce-classification-internal-api-Dimension
          description: Dimensions.
        metrics:
          type: array
          items:
            type: string
          description: Metrics to return. See example.
        filter:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-internal-api-FilterPredicateGroup
          description: Filters to apply to the query.
        include_subaccounts:
          type: boolean
          description: Include stats from all subaccounts.
        pagination:
          type: object
          allOf:
            - $ref: >-
                #/components/schemas/github.com-mailgun-bounce-classification-internal-api-PaginationReq
          description: Attributes used for pagination and sorting.
    github.com-mailgun-users-api-UserListResponse:
      type: object
      properties:
        users:
          type: array
          items:
            $ref: '#/components/schemas/github.com-mailgun-users-api-UserResponse'
        total:
          type: integer
          description: >-
            total number of users on the account or the total number of users
            that match the query
    github.com-mailgun-users-api-UserResponse:
      type: object
      properties:
        id:
          type: string
          description: the user ID
        activated:
          type: boolean
          description: user activation status
        name:
          type: string
          description: full name of user
        is_disabled:
          type: boolean
          description: disablement status of user
        email:
          type: string
          description: user email address
        email_details:
          type: object
          properties:
            address:
              type: string
              description: the full email address
            is_valid:
              type: boolean
              description: whether the email address is valid
            reason:
              type: string
              description: reason why user email is not valid, if applicable
            parts:
              type: object
              properties:
                domain:
                  type: string
                  description: email domain
                local_part:
                  type: string
                  description: user email identifier
                display_name:
                  type: string
                  description: email display name, if applicable
        role:
          type: string
          description: role of user on the account
        account_id:
          type: string
          description: account ID
        opened_ip:
          type: string
          description: IP address from which the user opened the account, if applicable
        is_master:
          type: boolean
          description: whether the user is the account owner
        metadata:
          type: object
          description: any optional metadata for the user
        tfa_enabled:
          type: boolean
          description: whether 2-factor auth has been enabled for the user
        tfa_active:
          type: boolean
          description: whether 2-factor auth has been activated for the user
        tfa_created_at:
          type: string
          description: the date and time at which 2-factor auth was activated
        password_updated_at:
          type: string
          description: the date and time at which the user password was last updated
        preferences:
          type: object
          properties:
            time_zone:
              type: string
              description: time zone for the user
            time_format:
              type: string
              description: preferred timestamp format for the user's in-app experience
            programming_language:
              type: string
              description: preferred programming language
        auth:
          type: object
          $ref: '#/components/schemas/github.com-mailgun-users-api-UserAuthResponse'
        github_user_id:
          type:
            - string
            - 'null'
          description: Github ID, if part of Github Student Developer Pack account
        salesforce_user_id:
          type:
            - string
            - 'null'
          description: Salesforce ID, if part of Salesforce platform account
        migration_status:
          type: string
          description: >-
            status of migration to Sinch ID for user authentication, if
            applicable
    github.com-mailgun-users-api-UserAuthResponse:
      type: object
      properties:
        method:
          type: string
          description: The user-level auth method
        prior_method:
          type: string
          description: The previous auth method for the user, if applicable
        prior_details:
          type: object
          description: Details that may be needed for an auth method
      required:
        - method
    github.com-mailgun-users-api-GenericResponse:
      type: object
      properties:
        message:
          type: string
          description: Status message
      required:
        - message
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        HTTP Basic auth using api:YOUR_API_KEY. See
        [documentation](https://documentation.mailgun.com/docs/mailgun/api-reference/authentication/)
x-tagGroups:
  - name: Messages
    tags:
      - Messages
  - name: Domains
    tags:
      - Domains
      - Domain Connection
      - Domain Keys
      - Domain Tracking
      - DKIM Security
  - name: Webhooks
    tags:
      - Webhooks
  - name: Reporting
    tags:
      - Metrics
      - Logs
      - Bounce Classification
      - Tags New
      - Stats
      - Tags
      - Events
  - name: Suppressions
    tags:
      - Unsubscribe
      - Complaints
      - Bounces
      - Allowlist
  - name: Routes
    tags:
      - Routes
  - name: Mailing Lists
    tags:
      - Mailing Lists
  - name: Templates
    tags:
      - Templates
  - name: IP Pools
    tags:
      - IP Pools
      - Dynamic IP Pools
  - name: IPs
    tags:
      - IPs
      - IP Address Warmup
  - name: Subaccounts
    tags:
      - Subaccounts
  - name: Custom Message Limit
    tags:
      - Custom Message Limit
  - name: Account Management
    tags:
      - Account Management
  - name: Keys
    tags:
      - Keys
  - name: Credentials
    tags:
      - Credentials
  - name: IP Allowlist
    tags:
      - IP Allowlist
  - name: Users
    tags:
      - Users
