Postmark Sending API API

The Sending API API from Postmark — 4 operation(s) for sending api.

OpenAPI Specification

postmark-sending-api-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Postmark Account Activate Sending API API
  description: 'Postmark makes sending and receiving email incredibly easy. The Account-level API allows users to

    configure all Servers, Domains, and Sender Signatures associated

    with an Account.

    '
  version: 0.9.0
servers:
- url: //api.postmarkapp.com/
tags:
- name: Sending API
paths:
  /email:
    post:
      operationId: sendEmail
      tags:
      - Sending API
      summary: Postmark 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: Postmark 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'
  /email/withTemplate:
    post:
      operationId: sendEmailWithTemplate
      tags:
      - Sending API
      summary: Postmark 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
      summary: Postmark 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'
definitions:
  SendEmailBatchRequest:
    type: array
    items:
      $ref: '#/definitions/SendEmailRequest'
  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
  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
  HeaderCollection:
    type: array
    items:
      $ref: '#/definitions/MessageHeader'
  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'
  SendEmailTemplatedBatchRequest:
    properties:
      Messages:
        type: array
        items:
          $ref: '#/definitions/EmailWithTemplateRequest'
  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
  SendEmailBatchResponse:
    type: array
    items:
      $ref: '#/definitions/SendEmailResponse'
  AttachmentCollection:
    type: array
    items:
      $ref: '#/definitions/Attachment'
  Attachment:
    description: An attachment for an email message.
    properties:
      Name:
        type: string
      Content:
        type: string
      ContentType:
        type: string
      ContentID:
        type: string