Shipmail Templates API

Stored transactional email templates with versions.

GitHub OpenAPI

Operations 10

GET /templates List templates #
POST /templates Create a template #
GET /templates/{id} Retrieve a template #
PATCH /templates/{id} Update a template #
DELETE /templates/{id} Delete a template #
POST /templates/{id}/publish Publish a template #
POST /templates/{id}/render Render a template #
GET /templates/{id}/versions List template versions #
GET /templates/{id}/versions/{version} Retrieve a template version #
POST /templates/{id}/versions/{version}/restore Restore a template version #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/shipmail-to:shipmail-to-templates-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

shipmail-to-templates-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: shipmail Templates API
  description: 'API-first email provider for creators, freelancers, and businesses of all sizes. The version is in the server URL (/api/v1). Compatible changes ship in v1 at any time; a breaking change ships in a new version or after at least 12 months of notice, during which deprecated operations are marked deprecated and their responses carry Deprecation (RFC 9745) and Sunset (RFC 8594) headers. Policy: https://shipmail.to/docs/api/versioning'
  version: 0.1.0
  contact:
    name: shipmail
    url: https://shipmail.to
servers:
- url: https://shipmail.to/api/v1
  description: Production
security:
- bearerAuth: []
- oauth2: []
tags:
- name: Templates
  description: Stored transactional email templates with versions.
paths:
  /templates:
    get:
      operationId: listTemplates
      summary: List templates
      tags:
      - Templates
      x-rate-limit-tier: read
      x-scope: templates:read
      security:
      - bearerAuth: []
      - oauth2:
        - templates:read
      parameters:
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: Paginated list of templates, newest first.
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - pagination
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Template'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
    post:
      operationId: createTemplate
      summary: Create a template
      description: 'Create a template draft. Variables use {{key}} with letters, digits and underscores. Pass publish: true to also publish version 1. A fallback for a key the content does not use is a 422 with details[].code unknown_variable. Maximum 1,000 templates per organization.'
      tags:
      - Templates
      x-rate-limit-tier: write
      x-scope: templates:write
      security:
      - bearerAuth: []
      - oauth2:
        - templates:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTemplateRequest'
      parameters:
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '201':
          description: Template created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '403':
          $ref: '#/components/responses/QuotaExceededError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
  /templates/{id}:
    get:
      operationId: getTemplate
      summary: Retrieve a template
      tags:
      - Templates
      x-rate-limit-tier: read
      x-scope: templates:read
      security:
      - bearerAuth: []
      - oauth2:
        - templates:read
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: The template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
    patch:
      operationId: updateTemplate
      summary: Update a template
      description: Change the draft. Sends keep using the published version until you publish.
      tags:
      - Templates
      x-rate-limit-tier: write
      x-scope: templates:write
      security:
      - bearerAuth: []
      - oauth2:
        - templates:write
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTemplateRequest'
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: The updated template.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
    delete:
      operationId: deleteTemplate
      summary: Delete a template
      tags:
      - Templates
      x-rate-limit-tier: write
      x-scope: templates:write
      security:
      - bearerAuth: []
      - oauth2:
        - templates:write
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '204':
          description: Template and its versions deleted.
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitError'
  /templates/{id}/publish:
    post:
      operationId: publishTemplate
      summary: Publish a template
      description: Snapshot the draft into the next version (1, 2, 3...) and make it the version sends use.
      tags:
      - Templates
      x-rate-limit-tier: write
      x-scope: templates:write
      security:
      - bearerAuth: []
      - oauth2:
        - templates:write
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: The template with its new published_version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitError'
  /templates/{id}/render:
    post:
      operationId: renderTemplate
      summary: Render a template
      description: Render the draft, or a version, with the same rules and errors as a send. Nothing is stored or sent. Missing or unknown variables are a 422 with details[].code missing_variable or unknown_variable.
      tags:
      - Templates
      x-rate-limit-tier: read
      x-scope: templates:read
      security:
      - bearerAuth: []
      - oauth2:
        - templates:read
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RenderTemplateRequest'
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: The rendered subject, html and text.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RenderedTemplate'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
  /templates/{id}/versions:
    get:
      operationId: listTemplateVersions
      summary: List template versions
      tags:
      - Templates
      x-rate-limit-tier: read
      x-scope: templates:read
      security:
      - bearerAuth: []
      - oauth2:
        - templates:read
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/Cursor'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: Paginated list of published versions, newest first.
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - pagination
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/TemplateVersion'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
  /templates/{id}/versions/{version}:
    get:
      operationId: getTemplateVersion
      summary: Retrieve a template version
      tags:
      - Templates
      x-rate-limit-tier: read
      x-scope: templates:read
      security:
      - bearerAuth: []
      - oauth2:
        - templates:read
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/TemplateVersion'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: The version.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateVersion'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
  /templates/{id}/versions/{version}/restore:
    post:
      operationId: restoreTemplateVersion
      summary: Restore a template version
      description: Copy a version into the draft. It does not publish.
      tags:
      - Templates
      x-rate-limit-tier: write
      x-scope: templates:write
      security:
      - bearerAuth: []
      - oauth2:
        - templates:write
      parameters:
      - $ref: '#/components/parameters/ResourceId'
      - $ref: '#/components/parameters/TemplateVersion'
      - $ref: '#/components/parameters/ShipmailOrganization'
      responses:
        '200':
          description: The template with the version copied into its draft.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Template'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
components:
  schemas:
    RenderTemplateRequest:
      type: object
      properties:
        variables:
          $ref: '#/components/schemas/TemplateVariableValues'
        version:
          type: integer
          minimum: 1
          description: Render this version. Omit to render the draft.
    CreateTemplateRequest:
      type: object
      required:
      - name
      - subject
      description: At least one of html or text is required.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        subject:
          type: string
          minLength: 1
          maxLength: 998
          description: Subject. May use {{key}} variables.
        html:
          type: string
          maxLength: 512000
        text:
          type: string
          maxLength: 256000
        fallbacks:
          type: object
          additionalProperties:
            type: string
            maxLength: 10000
          maxProperties: 200
          description: Default value per variable key. A key used without a fallback is required at send time. Every key must be used by the subject, html or text.
        publish:
          type: boolean
          description: Also publish the draft as version 1.
    Template:
      type: object
      required:
      - object
      - id
      - name
      - subject
      - html
      - text
      - fallbacks
      - variables
      - published_version
      - has_unpublished_changes
      - created_at
      - updated_at
      description: A stored email template. subject, html, text and fallbacks are the draft; a send uses the published version unless it pins another.
      properties:
        object:
          type: string
          const: template
        id:
          type: string
          description: Template ID (tpl_...).
        name:
          type: string
          maxLength: 200
        subject:
          type: string
          maxLength: 998
          description: Draft subject. May use {{key}} variables.
        html:
          type:
          - string
          - 'null'
          description: Draft HTML body.
        text:
          type:
          - string
          - 'null'
          description: Draft plain-text body.
        fallbacks:
          type: object
          additionalProperties:
            type: string
        variables:
          type: array
          items:
            $ref: '#/components/schemas/TemplateVariable'
          description: Every {{key}} the draft uses, in order of first appearance.
        published_version:
          type:
          - integer
          - 'null'
          description: The version a send uses. Null until the first publish.
        has_unpublished_changes:
          type: boolean
          description: True when the draft differs from the published version, or nothing is published yet.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Pagination:
      type: object
      required:
      - next_cursor
      - has_more
      - limit
      properties:
        next_cursor:
          type:
          - string
          - 'null'
          description: Cursor for the next page. Null if no more results.
        has_more:
          type: boolean
          description: Whether more results exist beyond this page.
        limit:
          type: integer
          description: Number of items per page.
    UpdateTemplateRequest:
      type: object
      description: Changes the draft only. Send at least one field. Set html or text to null to remove it; at least one must remain.
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 200
        subject:
          type: string
          minLength: 1
          maxLength: 998
        html:
          type:
          - string
          - 'null'
          maxLength: 512000
        text:
          type:
          - string
          - 'null'
          maxLength: 256000
        fallbacks:
          type: object
          additionalProperties:
            type: string
            maxLength: 10000
          maxProperties: 200
          description: Default value per variable key. A key used without a fallback is required at send time. Every key must be used by the subject, html or text.
    TemplateVersion:
      type: object
      required:
      - object
      - template_id
      - version
      - subject
      - html
      - text
      - fallbacks
      - variables
      - published_at
      description: An immutable snapshot written by publish.
      properties:
        object:
          type: string
          const: template_version
        template_id:
          type: string
        version:
          type: integer
          minimum: 1
        subject:
          type: string
        html:
          type:
          - string
          - 'null'
        text:
          type:
          - string
          - 'null'
        fallbacks:
          type: object
          additionalProperties:
            type: string
        variables:
          type: array
          items:
            $ref: '#/components/schemas/TemplateVariable'
        published_at:
          type: string
          format: date-time
    TemplateVariable:
      type: object
      required:
      - key
      - required
      - fallback
      properties:
        key:
          type: string
          description: Variable key, as used in {{key}}.
        required:
          type: boolean
          description: True when the key has no fallback, so every send must pass it.
        fallback:
          type:
          - string
          - 'null'
          description: Value used when a send omits the key.
    TemplateVariableValues:
      type: object
      additionalProperties:
        type:
        - string
        - number
        - boolean
      maxProperties: 200
      description: 'Value per variable key. Values are inserted as text: HTML-escaped in html, with control characters removed in the subject, and as given in text.'
    Error:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          - request_id
          properties:
            type:
              type: string
              enum:
              - validation_error
              - authentication_error
              - authorization_error
              - quota_exceeded
              - over_limit
              - not_found
              - rate_limit_error
              - conflict
              - reconciliation_required
              - internal_error
            code:
              type: string
              enum:
              - external_send_requires_review
              description: 'Present on a refusal a client can act on. `external_send_requires_review` (403, type `authorization_error`): the API key holds email to outside addresses for review, and this request would reach someone outside the organization''s domains in a way that cannot wait as a draft. Save it as a draft instead, and a person sends it from Shipmail.'
            message:
              type: string
            request_id:
              type: string
            details:
              type: array
              items:
                type: object
                required:
                - field
                - message
                properties:
                  field:
                    type: string
                  code:
                    type: string
                    description: Stable machine-readable code for the validation detail when available.
                  message:
                    type: string
            retry_after:
              type: integer
              description: Seconds to wait before retrying (present on 429 responses).
            message_id:
              type: string
              description: Present only on a reconciliation_required error. The tracking message the interrupted send attempt left behind; quote it in support rather than retrying, because the original may already have gone out.
            reason:
              type: string
              enum:
              - owner_confirmation_required
              - subscription_required
              - trial_capacity
              - purchased_capacity
              description: 'Present only on a refusal an organization owner can lift in Shipmail. `owner_confirmation_required`: an agent credential asked to buy a domain, and the owner must confirm it. `subscription_required`: the organization has no plan. `trial_capacity`: the trial''s own limit binds; ending the trial early lifts it and charges at once. `purchased_capacity`: the paid plan is full. The type and status stay those of the original error. Send `action_url` to the owner; after they confirm, retry with a new idempotency key.'
            action_url:
              type: string
              format: uri
              description: Present with `reason`. A Shipmail page where the organization owner reviews and confirms. It carries identifiers only; prices are computed on the page.
            limit:
              type: object
              description: Present on a `quota_exceeded` error caused by a plan, trial or fixed limit. Storage values are bytes. A `fixed` limit is the same on every plan and has no `reason`.
              required:
              - resource
              - used
              - limit
              - scope
              properties:
                resource:
                  type: string
                  description: The limited resource, such as `audience_subscribers`, `newsletter_sends`, `sends`, `mailboxes`, `aliases`, `team_members`, `newsletter_storage`, `api_keys`, `webhooks` or `event_queues`. New values may be added.
                used:
                  type: number
                limit:
                  type: number
                scope:
                  type: string
                  enum:
                  - trial
                  - plan
                  - fixed
    RenderedTemplate:
      type: object
      required:
      - object
      - template_id
      - version
      - subject
      - html
      - text
      properties:
        object:
          type: string
          const: rendered_template
        template_id:
          type: string
        version:
          type:
          - integer
          - 'null'
          description: The rendered version, or null for the draft.
        subject:
          type: string
        html:
          type:
          - string
          - 'null'
        text:
          type:
          - string
          - 'null'
  parameters:
    TemplateVersion:
      name: version
      in: path
      required: true
      description: Version number, starting at 1.
      schema:
        type: integer
        minimum: 1
    ShipmailOrganization:
      name: X-Shipmail-Organization
      in: header
      required: false
      description: OAuth access tokens only. The organization ID this request acts on. Required when the OAuth connection was approved for several organizations (400 validation_error without it); optional with one. An organization the connection was not approved for returns 403 authorization_error. Ignored for API keys, which belong to one organization.
      schema:
        type: string
    Cursor:
      name: cursor
      in: query
      description: Opaque pagination cursor returned by the same list operation. Send it unchanged; do not parse, modify, or fabricate it.
      schema:
        type: string
    ResourceId:
      name: id
      in: path
      required: true
      description: Resource ID.
      schema:
        type: string
    Limit:
      name: limit
      in: query
      description: Number of items to return (1-100, default 25).
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
  responses:
    ValidationError:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitError:
      description: Rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: integer
          description: Seconds to wait before retrying.
        X-RateLimit-Limit:
          schema:
            type: integer
          description: Maximum requests allowed in the window.
        X-RateLimit-Remaining:
          schema:
            type: integer
          description: Requests remaining in the current window.
        X-RateLimit-Reset:
          schema:
            type: integer
          description: Unix timestamp (seconds) when the window resets.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    QuotaExceededError:
      description: Plan quota exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication. Keys are prefixed with sm_live_ or sm_test_ and carry their own scopes. An OAuth access token issued for the https://shipmail.to/api/v1 resource is also accepted as the Bearer token. It is limited to the API scopes it names; a token that names none can do everything its consent allows. See oauth2.
    oauth2:
      type: oauth2
      description: 'OAuth 2.1 for agents and command-line tools. Register a public client with dynamic client registration (https://shipmail.to/api/auth/oauth2/register), then use the authorization code flow with PKCE (S256) and resource=https://shipmail.to/api/v1 on the authorize and token requests. Send the access token as Authorization: Bearer <token>. OAuth scopes use the API key scope names. A token that names API scopes can use only those, and only within the organizations and access approved on the consent page. A token that names no API scope, only openid, profile, email or offline_access, can do everything the consent page approved. A request outside the token''s scopes gets 403 with WWW-Authenticate: Bearer error="insufficient_scope" and the scope it needs. Tokens issued for https://shipmail.to/api/mcp are rejected. Protected resource metadata: https://shipmail.to/.well-known/oauth-protected-resource/api/v1.'
      flows:
        authorizationCode:
          authorizationUrl: https://shipmail.to/api/auth/oauth2/authorize
          tokenUrl: https://shipmail.to/api/auth/oauth2/token
          refreshUrl: https://shipmail.to/api/auth/oauth2/token
          scopes:
            openid: Sign in with your Shipmail account.
            profile: Read your name.
            email: Read your account email address.
            offline_access: Receive a refresh token.
            audiences:read: List and retrieve newsletter audiences and their subscribers.
            audiences:write: Create audiences and add, update, or remove their subscribers.
            automations:read: List and retrieve assistant automations.
            automations:write: Create, update, and manually run assistant automations.
            booking_pages:read: List and retrieve booking pages.
            booking_pages:write: Create, update, and delete booking pages.
            calendar:read: List and retrieve calendar events and open availability.
            calendar:write: Create, update, and delete calendar events.
            customers:read: List and retrieve customers, reply times, and customer fields.
            customers:write: Create, update, sync, and delete customers.
            domains:read: List, retrieve, and verify domains.
            domains:write: Create, update, and delete domains.
            mailboxes:read: List and retrieve mailboxes.
            mailboxes:export: Create and download mailbox content exports.
            mailboxes:write: Create, update, suspend, resume, and delete mailboxes. Does not include setting mailbox passwords.
            mailbox_credentials:read: List revocable app passwords and transactional SMTP credentials for allowed mailboxes.
            mailbox_credentials:write: Set primary mailbox passwords, and create and revoke app passwords and transactional SMTP credentials for allowed mailboxes.
            mailbox_forwarding:read: List forwarding destinations for allowed mailboxes.
            mailbox_forwarding:write: Create and remove forwarding destinations for allowed mailboxes.
            mailbox_rules:read: List deterministic server-side rules for allowed mailboxes.
            mailbox_rules:write: Create, replace, and remove deterministic rules for allowed mailboxes.
            members:read: List and retrieve organization members.
            members:write: Invite people, cancel invitations, and share or unshare mailboxes with members.
            organization:read: 'Read organization settings: default timezone and AI settings.'
            organization:write: 'Change organization settings: default timezone, and whether AI models are on.'
            messages:read: List and retrieve messages.
            messages:review: Inspect and release messages held by API-agent security review.
            messages:write: Update, move, delete, and inject sandbox messages.
            drafts:write: Create agent-safe reply drafts with server-derived recipients.
            drafts:compose: Save new-message drafts to a mailbox's Drafts folder for review. Cannot send.
            drafts:send: Send reply drafts that already exist. Cannot write new email.
            messages:send: Send messages, replies, and approved reply drafts.
            newsletters:read: List and retrieve newsletter drafts and campaigns.
            newsletters:write: Create, update, test, schedule, cancel, and resume newsletters.
            threads:read: List threads and retrieve thread messages.
            webhooks:read: List webhooks, retrieve webhooks, and list deliveries.
            webhooks:write: Create, update, delete, test, and rotate webhooks.
            suppressions:read: List suppressed recipient addresses.
            suppressions:write: Remove addresses from the suppression list.
            templates:read: List, retrieve, and render email templates and their versions.
            templates:write: Create, update, publish, restore, and delete email templates.