swagger: '2.0'
info:
  title: Postmark API
  description: |
    Postmark makes sending and receiving email
    incredibly easy.
  version: 1.0.0
host: api.postmarkapp.com
basePath: /
produces:
  - application/json
consumes:
  - application/json

definitions:
  DynamicResponse:
    description: The properties of this object will vary based request parameters.
  SendEmailRequest:
    properties:
      From:
        description: The sender email address. Must have a registered and confirmed Sender Signature.
        type: string
      To:
        description: Recipient email address. Multiple addresses are comma seperated. Max 50.
        type: string
      Cc:
        description: Recipient email address. Multiple addresses are comma seperated. Max 50.
        type: string
      Bcc:
        description: Bcc recipient email address. Multiple addresses are comma seperated. Max 50.
        type: string
      Subject:
        description: Email Subject
        type: string
      Tag:
        description: Email tag that allows you to categorize outgoing emails and get detailed statistics.
        type: string
      HtmlBody:
        description: If no TextBody specified HTML email message
        type: string
      TextBody:
        description: If no HtmlBody specified Plain text email message
        type: string
      ReplyTo:
        description: Reply To override email address. Defaults to the Reply To set in the sender signature.
        type: string
      TrackOpens:
        description: Activate open tracking for this email.
        type: boolean
      TrackLinks:
        description: Replace links in content to enable "click tracking" stats. Default is 'null', which uses the server's LinkTracking setting'.
        type: string
        enum: ['None', 'HtmlAndText', 'HtmlOnly', 'TextOnly']
      Headers:
        $ref: '#/definitions/HeaderCollection'
      Attachments:
        $ref: '#/definitions/AttachmentCollection'
  EmailWithTemplateRequest:
    properties:
      TemplateId:
        description: Required if 'TemplateAlias' is not specified.
        type: integer
      TemplateAlias:
        description: Required if 'TemplateId' is not specified.
        type: string
      TemplateModel:
        type: object
      InlineCss:
        type: boolean
        default: true
      From:
        type: string
        format: email
      To:
        type: string
        format: email
      Cc:
        type: string
        format: email
      Bcc:
        type: string
        format: email
      Tag:
        type: string
      ReplyTo:
        type: string
      Headers:
        $ref: '#/definitions/HeaderCollection'
      TrackOpens:
        description: Activate open tracking for this email.
        type: boolean
      TrackLinks:
        description: Replace links in content to enable "click tracking" stats. Default is 'null', which uses the server's LinkTracking setting'.
        type: string
        enum: ['None', 'HtmlAndText', 'HtmlOnly', 'TextOnly']
      Attachments:
        $ref: '#/definitions/AttachmentCollection'
    required:
      - TemplateId
      - TemplateAlias
      - TemplateModel
      - To
      - From

  EditServerConfigurationRequest:
    properties:
      Name:
        type: string
      Color:
        type: string
        enum: ['purple', 'blue', 'turqoise', 'green', 'red', 'yellow', 'grey']
      RawEmailEnabled:
        type: boolean
      DeliveryHookUrl:
        type: string
      SmtpApiActivated:
        type: boolean
      InboundHookUrl:
        type: string
      BounceHookUrl:
        type: string
      OpenHookUrl:
        type: string
      PostFirstOpenOnly:
        type: boolean
      TrackOpens:
        type: boolean
      TrackLinks:
        type: string
        enum: ['None', 'HtmlAndText', 'HtmlOnly', 'TextOnly']
      ClickHookUrl:
        description: Webhook url allowing real-time notification when tracked links are clicked.
        type: string
      InboundDomain:
        type: string
      InboundSpamThreshold:
        type: integer
  SendEmailBatchRequest:
    type: array
    items:
      $ref: '#/definitions/SendEmailRequest'
  SendEmailTemplatedBatchRequest:
    properties:
      Messages:
        type: array
        items:
          $ref: '#/definitions/EmailWithTemplateRequest'
  TemplateValidationRequest:
    properties:
      Subject:
        type: string
        description: |
          The subject content to validate. Must be specified if HtmlBody or
          TextBody are not. See our template language documentation for more
          information on the syntax for this field.
      HtmlBody:
        type: string
        description: |
          The html body content to validate. Must be specified if Subject or
          TextBody are not. See our template language documentation for more
          information on the syntax for this field.
      TextBody:
        type: string
        description: |
          The text body content to validate. Must be specified if HtmlBody or
          Subject are not. See our template language documentation for more
          information on the syntax for this field.
      TestRenderModel:
        type: object
        description: The model to be used when rendering test content.
      InlineCssForHtmlTestRender:
        type: boolean
        default: true
        description: |
          When HtmlBody is specified, the test render will have style blocks
          inlined as style attributes on matching html elements. You may disable
          the css inlining behavior by passing false for this parameter.
  CreateTemplateRequest:
    description: The contents required for creating a new template.
    properties:
      Alias:
        type: string
        description: The optional string identifier for referring to this Template (numbers, letters, and '.', '-', '_' characters, starts with a letter).
      Name:
        type: string
        description: The friendly display name for the template.
      Subject:
        type: string
        description: The Subject template definition for this Template.
      HtmlBody:
        type: string
        description: The HTML template definition for this Template.
      TextBody:
        type: string
        description: The Text template definition for this Template.
    required:
      - Name
      - Subject
  EditTemplateRequest:
    description: The contents required for creating a new template.
    properties:
      Alias:
        type: string
        description: The optional string identifier for referring to this Template (numbers, letters, and '.', '-', '_' characters, starts with a letter).
      Name:
        type: string
        description: The friendly display name for the template.
      Subject:
        type: string
        description: The Subject template definition for this Template.
      HtmlBody:
        type: string
        description: The HTML template definition for this Template.
      TextBody:
        type: string
        description: The Text template definition for this Template.
    required:
      - TemplateId
  CreateInboundRuleRequest:
    description: ''
    properties:
      Rule:
        format: email
        type: string

  SentCountsResponse:
    description: The result of a get sent counts operation.
    properties:
      Sent:
        type: integer
      Days:
        type: array
        items:
          properties:
            Date:
              type: string
            Sent:
              type: integer
  StandardPostmarkResponse:
    description: 'A Postmark API error.'
    properties:
      ErrorCode:
        type: integer
      Message:
        type: string
  SendEmailResponse:
    description: The standard response when a postmark message is sent
    properties:
      To:
        type: string
      SubmittedAt:
        type: string
        format: 'date-time'
      MessageID:
        type: string
      ErrorCode:
        type: integer
      Message:
        type: string
  BounceActivationResponse:
    properties:
      Message:
        type: string
      Bounce:
        $ref: '#/definitions/BounceInfoResponse'
  ServerConfigurationResponse:
    properties:
      ID:
        type: integer
      Name:
        type: string
      ApiTokens:
        type: array
        items:
          type: string
      ServerLink:
        type: string
      Color:
        type: string
        enum: ['purple', 'blue', 'turqoise', 'green', 'red', 'yellow', 'grey']
      InboundAddress:
        type: string
        format: email
      RawEmailEnabled:
        type: boolean
      DeliveryHookUrl:
        type: string
      SmtpApiActivated:
        type: boolean
      InboundHookUrl:
        type: string
      BounceHookUrl:
        type: string
      OpenHookUrl:
        type: string
      PostFirstOpenOnly:
        type: boolean
      TrackOpens:
        type: boolean
      TrackLinks:
        type: string
        enum: ['None', 'HtmlAndText', 'HtmlOnly', 'TextOnly']
      ClickHookUrl:
        type: string
      InboundDomain:
        type: string
      InboundHash:
        type: string
      InboundSpamThreshold:
        type: integer
  SendEmailBatchResponse:
    type: array
    items:
      $ref: '#/definitions/SendEmailResponse'
  DeliveryStatsResponse:
    description: ''
    properties:
      InactiveMails:
        type: integer
      Bounces:
        type: array
        items:
          $ref: '#/definitions/BounceCountElement'
  BounceInfoResponse:
    properties:
      ID:
        type: string
      Type:
        type: string
      TypeCode:
        type: integer
      Name:
        type: string
      Tag:
        type: string
      MessageID:
        type: string
      Description:
        type: string
      Details:
        type: string
      Email:
        type: string
        format: email
      BouncedAt:
        type: string
        format: 'date-time'
      DumpAvailable:
        type: boolean
      Inactive:
        type: boolean
      CanActivate:
        type: boolean
      Subject:
        type: string
      Content:
        type: string
  BounceSearchResponse:
    description: ''
    properties:
      TotalCount:
        type: integer
      Bounces:
        type: array
        items:
          $ref: '#/definitions/BounceInfoResponse'
  BounceDumpResponse:
    properties:
      Body:
        description: Raw source of bounce. If no dump is available this will return an empty string.
        type: string
  OutboundMessageDumpResponse:
    properties:
      Body:
        description: Raw source of message. If no dump is available this will return an empty string.
        type: string
  TemplateRecordResponse:
    properties:
      Name:
        type: string
        description: The display name for this template.
      Alias:
        type: string
        description: The user-supplied alias for this template.
      TemplateId:
        type: number
        format: int
        description: The associated ID for this template.
      Active:
        type: boolean
        description: True if this template is currently available for use.
  TemplateValidationResponse:
    properties:
      AllContentIsValid:
        type: boolean
      TextBody:
        $ref: '#/definitions/TemplateValidationResult'
      HtmlBody:
        $ref: '#/definitions/TemplateValidationResult'
      Subject:
        $ref: '#/definitions/TemplateValidationResult'
      SuggestedTemplateModel:
        type: object
  TemplateListingResponse:
    properties:
      TotalCount:
        type: number
        description: The total number of Templates API associated with this server.
      Templates API:
        type: array
        items:
          $ref: '#/definitions/TemplateRecordResponse'
        description: Basic information for each Template returned from the query.
  InboundMessageFullDetailsResponse:
    properties:
      From:
        type: string
      FromName:
        type: string
      FromFull:
        description: ''
        properties:
          Email:
            type: string
          Name:
            type: string
      To:
        type: string
      ToFull:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Cc:
        type: string
      CcFull:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      ReplyTo:
        type: string
      OriginalRecipient:
        type: string
      Subject:
        type: string
      Date:
        type: string
      MailboxHash:
        type: string
      TextBody:
        type: string
      HtmlBody:
        type: string
      Tag:
        type: string
      Headers:
        $ref: '#/definitions/HeaderCollection'
      Attachments:
        $ref: '#/definitions/AttachmentCollection'
      MessageID:
        type: string
      BlockedReason:
        type: string
      Status:
        type: string
  InboundSearchResponse:
    description: ''
    properties:
      TotalCount:
        type: integer
      InboundMessages:
        type: array
        items:
          $ref: '#/definitions/InboundMessageDetail'
  OutboundSearchResponse:
    description: ''
    properties:
      TotalCount:
        type: integer
      Messages:
        type: array
        items:
          $ref: '#/definitions/OutboundMessageDetail'
  TemplateDetailResponse:
    properties:
      Name:
        type: string
        description: The display name for the template.
      Alias:
        type: string
        description: The user-supplied alias for this template.
      TemplateID:
        type: integer
        description: The ID associated with the template.
      HtmlBody:
        type: string
        description: The content to use for the HtmlBody when this template is used to send email.
      TextBody:
        type: string
        description: The content to use for the TextBody when this template is used to send email.
      AssociatedServerId:
        type: integer
        description: The ID of the Server with which this template is associated.
      Subject:
        type: string
        description: The content to use for the Subject when this template is used to send email.
      Active:
        type: boolean
        description: Indicates that this template may be used for sending email.
  OutboundMessageDetailsResponse:
    properties:
      TextBody:
        type: string
      HtmlBody:
        type: string
      Body:
        type: string
      Tag:
        type: string
      MessageID:
        type: string
      To:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Cc:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Bcc:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Recipients:
        type: array
        items:
          type: string
      ReceivedAt:
        type: string
        format: 'date-time'
      From:
        type: string
      Subject:
        type: string
      Attachments:
        $ref: '#/definitions/AttachmentCollection'
      Status:
        type: string
      TrackOpens:
        type: boolean
      TrackLinks:
        type: string
        enum: ['None', 'HtmlAndText', 'HtmlOnly', 'TextOnly']
      MessageEvents:
        type: array
        items:
          $ref: '#/definitions/MessageEventDetails'
  MessageOpenSearchResponse:
    properties:
      TotalCount:
        type: integer
      Opens:
        type: array
        items:
          $ref: '#/definitions/ExtendedMessageOpenEventInformation'
  MessageClickSearchResponse:
    properties:
      TotalCount:
        type: integer
      Clicks:
        type: array
        items:
          $ref: '#/definitions/ExtendedMessageClickEventInformation'
  OutboundOverviewStatsResponse:
    description: ''
    properties:
      Sent:
        type: integer
      Bounced:
        type: integer
      SMTPAPIErrors:
        type: integer
      BounceRate:
        type: integer
      SpamComplaints:
        type: integer
      SpamComplaintsRate:
        type: integer
      Opens:
        type: integer
      UniqueOpens:
        type: integer
      Tracked:
        type: integer
      WithOpenTracking:
        type: integer
      WithLinkTracking:
        type: integer
      TotalClicks:
        type: integer
      UniqueLinksClicked:
        type: integer
      TotalTrackedLinksSent:
        type: integer
      WithClientRecorded:
        type: integer
      WithPlatformRecorded:
        type: integer
  ExtendedMessageClickEventInformation:
    description: ''
    properties:
      ClickLocation:
        type: string
      Client:
        description: ''
        properties:
          Name:
            type: string
          Company:
            type: string
          Family:
            type: string
      OS:
        properties:
          Name:
            type: string
          Company:
            type: string
          Family:
            type: string
      Platform:
        type: string
      UserAgent:
        type: string
      OriginalLink:
        type: string
      Geo:
        properties:
          CountryISOCode:
            type: string
          Country:
            type: string
          RegionISOCode:
            type: string
          Region:
            type: string
          City:
            type: string
          Zip:
            type: string
          Coords:
            type: string
          IP:
            type: string
      MessageID:
        type: string
      ReceivedAt:
        type: string
        format: 'date-time'
      Tag:
        type: string
      Recipient:
        type: string
        format: email
  ExtendedMessageOpenEventInformation:
    description: ''
    properties:
      FirstOpen:
        type: boolean
      Client:
        description: ''
        properties:
          Name:
            type: string
          Company:
            type: string
          Family:
            type: string
      OS:
        properties:
          Name:
            type: string
          Company:
            type: string
          Family:
            type: string
      Platform:
        type: string
      UserAgent:
        type: string
      Geo:
        properties:
          CountryISOCode:
            type: string
          Country:
            type: string
          RegionISOCode:
            type: string
          Region:
            type: string
          City:
            type: string
          Zip:
            type: string
          Coords:
            type: string
          IP:
            type: string
      MessageID:
        type: string
      ReceivedAt:
        type: string
        format: 'date-time'
      Tag:
        type: string
      Recipient:
        type: string
        format: email
  MessageEventDetails:
    description: ''
    properties:
      Recipient:
        type: string
      Type:
        type: string
      ReceivedAt:
        type: string
        format: 'date-time'
      Details:
        properties:
          Summary:
            type: string
          BounceID:
            type: string
          DeliveryMessage:
            type: string
          DestinationServer:
            type: string
          DestinationIP:
            type: string
  OutboundMessageDetail:
    description: ''
    properties:
      Tag:
        type: string
      MessageID:
        type: string
      To:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Cc:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Bcc:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Recipients:
        type: array
        items:
          type: string
      ReceivedAt:
        type: string
        format: 'date-time'
      From:
        type: string
      Subject:
        type: string
      Attachments:
        $ref: '#/definitions/AttachmentCollection'
      Status:
        type: string
      TrackOpens:
        type: boolean
      TrackLinks:
        type: string
        enum: ['None', 'HtmlAndText', 'HtmlOnly', 'TextOnly']
  InboundMessageDetail:
    description: ''
    properties:
      From:
        type: string
      FromName:
        type: string
      FromFull:
        description: ''
        properties:
          Email:
            type: string
          Name:
            type: string
      To:
        type: string
      ToFull:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      Cc:
        type: string
      CcFull:
        type: array
        items:
          $ref: '#/definitions/EmailNameAddressPair'
      ReplyTo:
        type: string
      OriginalRecipient:
        type: string
      Subject:
        type: string
      Date:
        type: string
      MailboxHash:
        type: string
      Tag:
        type: string
      Attachments:
        $ref: '#/definitions/AttachmentCollection'
      MessageID:
        type: string
      Status:
        type: string
  EmailNameAddressPair:
    description: ''
    properties:
      Name:
        type: string
      Email:
        type: string
  BounceCountElement:
    properties:
      Name:
        type: string
      Count:
        type: integer
      Type:
        type: string
  MessageHeader:
    description: A single header for an email message.
    properties:
      Name:
        description: The header's name.
        type: string
      Value:
        description: The header's value.
        type: string
  Attachment:
    description: An attachment for an email message.
    properties:
      Name:
        type: string
      Content:
        type: string
      ContentType:
        type: string
      ContentID:
        type: string
  AttachmentCollection:
    type: array
    items:
      $ref: '#/definitions/Attachment'
  HeaderCollection:
    type: array
    items:
      $ref: '#/definitions/MessageHeader'
  TemplateValidationResult:
    properties:
      ContentIsValid:
        type: boolean
      ValidationErrors:
        type: array
        items:
          $ref: '#/definitions/TemplateValidationError'
      RenderedContent:
        type: string
  TemplateValidationError:
    properties:
      Message:
        type: string
      Line:
        type: integer
      CharacterPosition:
        type: integer

responses:
  422:
    description: 'An error was generated due to incorrect use of the API. See the Message associated with this response for more information.'
    schema:
      $ref: '#/definitions/StandardPostmarkResponse'
  500:
    description: 'Indicates an internal server error occurred.'

paths:
#Message Sending API
  /email:
    post:
      operationId: sendEmail
      tags:
        - Sending API
      summary: Send a single email
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          schema:
            $ref: '#/definitions/SendEmailRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SendEmailResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /email/batch:
    post:
      operationId: sendEmailBatch
      tags:
        - Sending API
      summary: Send a batch of emails
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          schema:
            $ref: '#/definitions/SendEmailBatchRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SendEmailBatchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
#bounces
  /deliverystats:
    get:
      operationId: getDeliveryStats
      summary: Get delivery stats
      tags:
        - Bounces API
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/DeliveryStatsResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /bounces:
    get:
      operationId: getBounces
      tags:
        - Bounces API
      summary: Get bounces
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: count
          in: query
          description: Number of bounces to return per request. Max 500.
          type: integer
          maximum: 500
          required: true
        - name: offset
          description: Number of bounces to skip.
          in: query
          required: true
          type: integer
        - name: type
          description: Filter by type of bounce
          in: query
          type: string
          enum: ['HardBounce','Transient','Unsubscribe','Subscribe','AutoResponder','AddressChange','DnsError','SpamNotification','OpenRelayTest','Unknown','SoftBounce','VirusNotification',
                'MailFrontier Matador.','BadEmailAddress','SpamComplaint','ManuallyDeactivated','Unconfirmed','Blocked','SMTPApiError','InboundError','DMARCPolicy','TemplateRenderingFailed']
        - name: inactive
          description: Filter by emails that were deactivated by Postmark due to the bounce. Set to true or false. If this isn't specified it will return both active and inactive.
          in: query
          type: boolean
        - name: emailFilter
          in: query
          description: Filter by email address
          type: string
          format: email
        - name: messageID
          description: Filter by messageID
          in: query
          type: string
        - name: tag
          description: Filter by tag
          type: string
          in: query
        - name: todate
          in: query
          description: Filter messages up to the date specified. e.g. `2014-02-01`
          type: string
          format: date
        - name: fromdate
          description: Filter messages starting from the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/BounceSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /bounces/{bounceid}:
    get:
      operationId: getSingleBounce
      tags:
        - Bounces API
      summary: Get a single bounce
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: bounceid
          in: path
          description: The ID of the bounce to retrieve.
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/BounceInfoResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /bounces/{bounceid}/dump:
    get:
      tags:
        - Bounces API
      summary: Get bounce dump
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: bounceid
          in: path
          description: The ID for the bounce dump to retrieve.
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/BounceDumpResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /bounces/{bounceid}/activate:
    put:
      operationId: activateBounce
      tags:
        - Bounces API
      summary: Activate a bounce
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: bounceid
          in: path
          description: The ID of the Bounce to activate.
          required: true
          type: integer
          format: int64
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/BounceActivationResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
#messages
  /messages/outbound:
    get:
      operationId: searchOutboundMessages
      tags:
        - Messages API
      summary: Outbound message search
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: count
          description: Number of messages to return per request. Max 500.
          in: query
          required: true
          type: integer
        - name: offset
          description: Number of messages to skip
          required: true
          type: integer
          in: query
        - name: recipient
          description: Filter by the user who was receiving the email
          in: query
          type: string
          format: email
        - name: fromemail
          description: Filter by the sender email address
          in: query
          type: string
          format: email
        - name: tag
          in: query
          description: Filter by tag
          type: string
        - name: status
          in: query
          description: Filter by status (`queued` or `sent`)
          type: string
          enum: ['queued', 'sent']
        - name: todate
          in: query
          description: Filter messages up to the date specified. e.g. `2014-02-01`
          type: string
          format: date
        - name: fromdate
          description: Filter messages starting from the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/OutboundSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/outbound/{messageid}/details:
    get:
      operationId: getOutboundMessageDetails
      tags:
        - Messages API
      summary: Outbound message details
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          description: The ID of the message for which to retrieve details.
          in: path
          type: string
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/OutboundMessageDetailsResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/outbound/{messageid}/dump:
    get:
      operationId: getOutboundMessageDump
      tags:
        - Messages API
      summary: Outbound message dump
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          description: The ID of the message for which to retrieve a dump.
          in: path
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/OutboundMessageDumpResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/inbound:
    get:
      operationId: searchInboundMessages
      tags:
        - Messages API
      summary: Inbound message search
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: count
          in: query
          required: true
          type: integer
          description: Number of messages to return per request. Max 500.
        - name: offset
          description: Number of messages to skip
          required: true
          type: integer
          in: query
        - name: recipient
          description: Filter by the user who was receiving the email
          in: query
          type: string
          format: email
        - name: fromemail
          description: Filter by the sender email address
          in: query
          type: string
          format: email
        - name: subject
          description: Filter by email subject
          in: query
          type: string
        - name: mailboxhash
          description: Filter by mailboxhash
          in: query
          type: string
        - name: tag
          in: query
          description: Filter by tag
          type: string
        - name: status
          description: Filter by status (`blocked`, `processed`, `queued`, `failed`, `scheduled`)
          in: query
          type: string
          enum: ['blocked', 'processed', 'queued', 'failed', 'scheduled']
        - name: todate
          in: query
          description: Filter messages up to the date specified. e.g. `2014-02-01`
          type: string
          format: date
        - name: fromdate
          in: query
          type: string
          format: date
          description: Filter messages starting from the date specified. e.g. `2014-02-01`
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/InboundSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/inbound/{messageid}/details:
    get:
      operationId: getInboundMessageDetails
      tags:
        - Messages API
      summary: Inbound message details
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          description: The ID of the message for which to details will be retrieved.
          in: path
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/InboundMessageFullDetailsResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/inbound/{messageid}/bypass:
    put:
      operationId: bypassRulesForInboundMessage
      tags:
        - Messages API
      summary: Bypass rules for a blocked inbound message
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          description: The ID of the message which should bypass inbound rules.
          in: path
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/StandardPostmarkResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/inbound/{messageid}/retry:
    put:
      operationId: retryInboundMessageProcessing
      tags:
        - Messages API
      summary: Retry a failed inbound message for processing
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          in: path
          description: The ID of the inbound message on which we should retry processing.
          required: true
          type: string
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/StandardPostmarkResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/outbound/opens:
    get:
      operationId: searchOpensForOutboundMessages
      tags:
        - Messages API
      summary: Opens for all messages
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: count
          in: query
          description: Number of message opens to return per request. Max 500.
          type: integer
          required: true
        - name: offset
          description: Number of messages to skip
          in: query
          type: integer
          required: true
        - name: recipient
          description: Filter by To, Cc, Bcc
          in: query
          type: string
          required: false
        - name: tag
          description: Filter by tag
          in: query
          type: string
          required: false
        - name: client_name
          description: Filter by client name, i.e. Outlook, Gmail
          in: query
          type: string
          required: false
        - name: client_company
          description: Filter by company, i.e. Microsoft, Apple, Google
          in: query
          type: string
          required: false
        - name: client_family
          description: Filter by client family, i.e. OS X, Chrome
          in: query
          type: string
          required: false
        - name: os_name
          description: Filter by full OS name and specific version, i.e. OS X 10.9 Mavericks, Windows 7
          in: query
          type: string
          required: false
        - name: os_family
          description: Filter by kind of OS used without specific version, i.e. OS X, Windows
          in: query
          type: string
          required: false
        - name: os_company
          description: Filter by company which produced the OS, i.e. Apple Computer, Inc., Microsoft Corporation
          in: query
          type: string
          required: false
        - name: platform
          description: Filter by platform, i.e. webmail, desktop, mobile
          in: query
          type: string
          required: false
        - name: country
          description: Filter by country messages were opened in, i.e. Denmark, Russia
          in: query
          type: string
          required: false
        - name: region
          description: Filter by full name of region messages were opened in, i.e. Moscow, New York
          in: query
          type: string
          required: false
        - name: city
          description: Filter by full name of region messages were opened in, i.e. Moscow, New York
          in: query
          type: string
          required: false
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/MessageOpenSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/outbound/opens/{messageid}:
    get:
      operationId: getOpensForSingleOutboundMessage
      tags:
        - Messages API
      summary: Retrieve Message Opens
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          description: The ID of the Outbound Message for which open statistics should be retrieved.
          in: path
          type: string
          required: true
        - name: count
          in: query
          default: 1
          description: Number of message opens to return per request. Max 500.
          type: integer
          required: true
          minimum: 1
          maximum: 500
        - name: offset
          in: query
          description: Number of messages to skip.
          type: integer
          required: true
          minimum: 0
          default: 0
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/MessageOpenSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/outbound/clicks:
    get:
      operationId: searchClicksForOutboundMessages
      tags:
        - Messages API
      summary: Clicks for a all messages
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: count
          in: query
          description: Number of message clicks to return per request. Max 500.
          type: integer
          required: true
        - name: offset
          description: Number of messages to skip
          in: query
          type: integer
          required: true
        - name: recipient
          description: Filter by To, Cc, Bcc
          in: query
          type: string
          required: false
        - name: tag
          description: Filter by tag
          in: query
          type: string
          required: false
        - name: client_name
          description: Filter by client name, i.e. Outlook, Gmail
          in: query
          type: string
          required: false
        - name: client_company
          description: Filter by company, i.e. Microsoft, Apple, Google
          in: query
          type: string
          required: false
        - name: client_family
          description: Filter by client family, i.e. OS X, Chrome
          in: query
          type: string
          required: false
        - name: os_name
          description: Filter by full OS name and specific version, i.e. OS X 10.9 Mavericks, Windows 7
          in: query
          type: string
          required: false
        - name: os_family
          description: Filter by kind of OS used without specific version, i.e. OS X, Windows
          in: query
          type: string
          required: false
        - name: os_company
          description: Filter by company which produced the OS, i.e. Apple Computer, Inc., Microsoft Corporation
          in: query
          type: string
          required: false
        - name: platform
          description: Filter by platform, i.e. webmail, desktop, mobile
          in: query
          type: string
          required: false
        - name: country
          description: Filter by country messages were opened in, i.e. Denmark, Russia
          in: query
          type: string
          required: false
        - name: region
          description: Filter by full name of region messages were opened in, i.e. Moscow, New York
          in: query
          type: string
          required: false
        - name: city
          description: Filter by full name of region messages were opened in, i.e. Moscow, New York
          in: query
          type: string
          required: false
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/MessageClickSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /messages/outbound/clicks/{messageid}:
    get:
      operationId: getClicksForSingleOutboundMessage
      tags:
        - Messages API
      summary: Retrieve Message Clicks
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: messageid
          description: The ID of the Outbound Message for which click statistics should be retrieved.
          in: path
          type: string
          required: true
        - name: count
          in: query
          default: 1
          description: Number of message clicks to return per request. Max 500.
          type: integer
          required: true
          minimum: 1
          maximum: 500
        - name: offset
          in: query
          description: Number of messages to skip.
          type: integer
          required: true
          minimum: 0
          default: 0
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/MessageClickSearchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'

#Templates API
  /email/withTemplate:
    post:
      operationId: sendEmailWithTemplate
      tags:
        - Sending API
        - Templates API
      summary: Send an email using a Template
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/EmailWithTemplateRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SendEmailResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /email/batchWithTemplates:
    post:
      operationId: sendEmailBatchWithTemplates
      tags:
        - Sending API
        - Templates API
      summary: Send a batch of email using templates.
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/SendEmailTemplatedBatchRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SendEmailBatchResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /templates:
    get:
      operationId: listTemplates
      summary: Get the Templates associated with this Server
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: Count
          in: query
          description: The number of Templates to return
          required: true
          type: number
          format: int
        - name: Offset
          in: query
          description: The number of Templates to "skip" before returning results.
          required: true
          type: number
          format: int
      tags:
        - Templates API
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/TemplateListingResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
    post:
      summary: Create a Template
      tags:
        - Templates API
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/CreateTemplateRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/TemplateRecordResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /templates/{templateIdOrAlias}:
    get:
      operationId: getSingleTemplate
      summary: Get a Template
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: templateIdOrAlias
          in: path
          type: string
          required: true
          description: The 'TemplateID' or 'Alias' value for the Template you wish to retrieve.
      tags:
        - Templates API
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/TemplateDetailResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
    put:
      operationId: updateTemplate
      summary: Update a Template
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: templateIdOrAlias
          in: path
          type: string
          required: true
          description: The 'TemplateID' or 'Alias' value for the Template you wish to update.
        - name: body
          in: body
          required: true
          schema:
            $ref: '#/definitions/EditTemplateRequest'
      tags:
        - Templates API
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/TemplateRecordResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
    delete:
      operationId: deleteTemplate
      summary: Delete a Template
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: templateIdOrAlias
          in: path
          type: string
          required: true
          description: The 'TemplateID' or 'Alias' value for the Template you wish to delete.
      tags:
        - Templates API
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/TemplateDetailResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /templates/validate:
    post:
      operationId: testTemplateContent
      summary: Test Template Content
      tags:
        - Templates API
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          schema:
            $ref: '#/definitions/TemplateValidationRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/TemplateValidationResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
#Stats API
  /stats/outbound:
    get:
      operationId: getOutboundOverviewStatistics
      tags:
        - Stats API
      summary: Get outbound overview
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          in: query
          description: Filter by tag
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          in: query
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/OutboundOverviewStatsResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/sends:
    get:
      operationId: getSentCounts
      tags:
        - Stats API
      summary: Get sent counts
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          in: query
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/SentCountsResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/bounces:
    get:
      operationId: getBounceCounts
      tags:
        - Stats API
      summary: Get bounce counts
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          in: query
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            properties:
              HardBounce:
                type: integer
              SMTPApiError:
                type: integer
              SoftBounce:
                type: integer
              Transient:
                type: integer
              Days:
                type: array
                items:
                  properties:
                    Date:
                      type: string
                    HardBounce:
                      type: integer
                    SoftBounce:
                      type: integer
                    SMTPApiError:
                      type: integer
                    Transient:
                      type: integer
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/spam:
    get:
      operationId: getSpamComplaints
      tags:
        - Stats API
      summary: Get spam complaints
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          in: query
          description: Filter by tag
          type: string
        - name: fromdate
          in: query
          type: string
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          format: date
        - name: todate
          in: query
          description:  Filter stats up to the date specified. e.g. `2014-02-01`
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            properties:
              SpamComplaint:
                type: integer
              Days:
                type: array
                items:
                  properties:
                    Date:
                      type: string
                    SpamComplaint:
                      type: integer
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/tracked:
    get:
      operationId: getTrackedEmailCounts
      tags:
        - Stats API
      summary: Get tracked email counts
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          in: query
          description: Filter by tag
          type: string
        - name: fromdate
          in: query
          type: string
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          format: date
        - name: todate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            properties:
              Tracked:
                type: integer
              Days:
                type: array
                items:
                  properties:
                    Date:
                      type: string
                    Tracked:
                      type: integer
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/opens:
    get:
      operationId: getOutboundOpenCounts
      tags:
        - Stats API
      summary: Get email open counts
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            properties:
              Opens:
                type: integer
              Unique:
                type: integer
              Days:
                type: array
                items:
                  properties:
                    Date:
                      type: string
                    Opens:
                      type: integer
                    Unique:
                      type: integer
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/opens/platforms:
    get:
      operationId: getOutboundOpenCountsByPlatform
      tags:
        - Stats API
      summary: Get email platform usage
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            properties:
              Desktop:
                type: integer
              WebMail:
                type: integer
              Mobile:
                type: integer
              Unknown:
                type: integer
              Days:
                type: array
                items:
                  properties:
                    Date:
                      type: string
                    Desktop:
                      type: integer
                    WebMail:
                      type: integer
                    Mobile:
                      type: integer
                    Unknown:
                      type: integer
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/opens/emailclients:
    get:
      operationId: getOutboundOpenCountsByEmailClient
      tags:
        - Stats API
      summary: Get email client usage
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            properties:
              Desktop:
                type: integer
              WebMail:
                type: integer
              Mobile:
                type: integer
              Unknown:
                type: integer
              Days:
                type: array
                items:
                  $ref: '#/definitions/DynamicResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/clicks:
    get:
      operationId: getOutboundClickCounts
      tags:
        - Stats API
      summary: Get click counts
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/DynamicResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/clicks/browserfamilies:
    get:
      operationId: getOutboundClickCountsByBrowserFamily
      tags:
        - Stats API
      summary: Get browser usage by family
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            type: object
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/clicks/platforms:
    get:
      operationId: getOutboundClickCountsByPlatform
      tags:
        - Stats API
      summary: Get browser plaform usage
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/DynamicResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /stats/outbound/clicks/location:
    get:
      operationId: getOutboundClickCountsByLocation
      tags:
        - Stats API
      summary: Get clicks by body location
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: tag
          description: Filter by tag
          in: query
          type: string
        - name: fromdate
          in: query
          description: Filter stats starting from the date specified. e.g. `2014-01-01`
          type: string
          format: date
        - name: todate
          description: Filter stats up to the date specified. e.g. `2014-02-01`
          in: query
          type: string
          format: date
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/DynamicResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
#inbound triggers
  /triggers/inboundrules:
    post:
      operationId: createInboundRule
      tags:
        - Inbound Rules API
      summary: Create an inbound rule trigger
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          in: body
          schema:
            $ref: '#/definitions/CreateInboundRuleRequest'
      responses:
        200:
          description: OK
          schema:
            properties:
              ID:
                type: integer
              Rule:
                type: string
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
    get:
      operationId: listInboundRules
      tags:
        - Inbound Rules API
      summary: List inbound rule triggers
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: count
          in: query
          type: integer
          required: true
          description: Number of records to return per request.
        - name: offset
          in: query
          type: integer
          required: true
          description: Number of records to skip.
      responses:
        200:
          description: OK
          schema:
            properties:
              TotalCount:
                type: integer
              InboundRules:
                type: array
                items:
                  properties:
                    ID:
                      type: integer
                    Rule:
                      type: string
                      format: email
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
  /triggers/inboundrules/{triggerid}:
    delete:
      operationId: deleteInboundRule
      tags:
        - Inbound Rules API
      summary: Delete a single trigger
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: triggerid
          in: path
          type: integer
          description: The ID of the Inbound Rule that should be deleted.
          required: true
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/StandardPostmarkResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
#server
  /server:
    get:
      summary: Get Server Configuration
      operationId: getCurrentServerConfiguration
      tags:
        - Server Configuration API
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ServerConfigurationResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
    put:
      summary: Edit Server Configuration
      operationId: editCurrentServerConfiguration
      tags:
        - Server Configuration API
      parameters:
        - name: X-Postmark-Server-Token
          required: true
          description: The token associated with the Server on which this request will operate.
          type: string
          in: header
        - name: body
          description: The settings that should be modified for the current server.
          in: body
          schema:
            $ref: '#/definitions/EditServerConfigurationRequest'
      responses:
        200:
          description: OK
          schema:
            $ref: '#/definitions/ServerConfigurationResponse'
        422:
          $ref: '#/responses/422'
        500:
          $ref: '#/responses/500'
