Mailcoach Campaigns API

Email campaigns

GitHub OpenAPI

Operations 9

GET /campaigns List all campaigns #
POST /campaigns Create a campaign #
GET /campaigns/{campaign} Get a campaign #
PUT /campaigns/{campaign} Update a campaign #
DELETE /campaigns/{campaign} Delete a campaign #
POST /campaigns/{campaign}/send-test Send a test email for a campaign #
POST /campaigns/{campaign}/send Send a campaign #
POST /campaigns/{campaign}/pause Pause a campaign #
POST /campaigns/{campaign}/resume Resume a campaign #

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/mailcoach-app:mailcoach-app-campaigns-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

mailcoach-app-campaigns-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mailcoach Campaigns API
  description: 'REST API for Laravel Mailcoach — send email campaigns, manage subscribers,

    and handle transactional mails.


    Authentication is via Bearer token (Laravel Sanctum).

    All collection endpoints return paginated responses using the standard

    Laravel pagination envelope (`data`, `links`, `meta`).


    Filtering uses the `?filter[key]=value` convention

    (spatie/laravel-query-builder). Sorting uses `?sort=field` (ascending)

    or `?sort=-field` (descending).'
  version: 1.0.0
  contact:
    name: Spatie
    url: https://mailcoach.app
servers:
- url: '{baseUrl}/api'
  description: Mailcoach API
  variables:
    baseUrl:
      default: https://your-app.com
      description: The base URL of your Mailcoach installation
security:
- bearerAuth: []
tags:
- name: Campaigns
  description: Email campaigns
paths:
  /campaigns:
    get:
      operationId: listCampaigns
      summary: List all campaigns
      tags:
      - Campaigns
      parameters:
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per_page'
      - name: sort
        in: query
        description: 'Sort field. Allowed: `name`, `-name`, `email_list_id`, `unique_open_count`, `unique_click_count`, `unsubscribe_rate`, `sent_to_number_of_subscribers`, `sent`, `-sent` (default: `-sent`).'
        schema:
          type: string
      - name: filter[search]
        in: query
        description: Fuzzy search on campaign name
        schema:
          type: string
      - name: filter[status]
        in: query
        description: Filter by campaign status
        schema:
          type: string
          enum:
          - draft
          - sending
          - paused
          - sent
          - cancelled
      - name: filter[email_list_id]
        in: query
        description: Filter by list ID
        schema:
          type: integer
      - name: filter[emailList.uuid]
        in: query
        description: Filter by list UUID
        schema:
          type: string
          format: uuid
      - name: filter[contentItem.template.uuid]
        in: query
        description: Filter by template UUID
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Paginated list of campaigns
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Campaign'
                  links:
                    $ref: '#/components/schemas/PaginationLinks'
                  meta:
                    $ref: '#/components/schemas/PaginationMeta'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
    post:
      operationId: createCampaign
      summary: Create a campaign
      description: Scheduling is rejected with a 422 response when the selected segment contains unavailable list exclusions.
      tags:
      - Campaigns
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRequest'
      responses:
        '201':
          description: Campaign created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
  /campaigns/{campaign}:
    get:
      operationId: showCampaign
      summary: Get a campaign
      tags:
      - Campaigns
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Campaign details
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
    put:
      operationId: updateCampaign
      summary: Update a campaign
      description: Scheduling is rejected with a 422 response when the selected segment contains unavailable list exclusions.
      tags:
      - Campaigns
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignRequest'
      responses:
        '200':
          description: Campaign updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Campaign'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
    delete:
      operationId: deleteCampaign
      summary: Delete a campaign
      tags:
      - Campaigns
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
  /campaigns/{campaign}/send-test:
    post:
      operationId: sendCampaignTest
      summary: Send a test email for a campaign
      tags:
      - Campaigns
      description: Send a test email to up to 10 recipients. Campaign must be in draft status.
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendCampaignTestRequest'
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
  /campaigns/{campaign}/send:
    post:
      operationId: sendCampaign
      summary: Send a campaign
      tags:
      - Campaigns
      description: Start sending the campaign to all subscribers. Campaign must be in draft status.
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '400':
          description: Campaign cannot be sent (e.g. already sent, missing content)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
  /campaigns/{campaign}/pause:
    post:
      operationId: pauseCampaign
      summary: Pause a campaign
      tags:
      - Campaigns
      description: Pause a campaign that is currently sending. Pausing an already paused campaign is idempotent.
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Campaign cannot be paused from its current status
  /campaigns/{campaign}/resume:
    post:
      operationId: resumeCampaign
      summary: Resume a campaign
      tags:
      - Campaigns
      description: Resume a paused campaign. Resuming a campaign that is already sending is idempotent.
      parameters:
      - name: campaign
        in: path
        required: true
        description: Campaign UUID
        schema:
          type: string
          format: uuid
      responses:
        '204':
          $ref: '#/components/responses/NoContent'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: Campaign cannot be resumed from its current status or has an invalid segment
components:
  responses:
    Forbidden:
      description: Forbidden — insufficient permissions
    UnprocessableEntity:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    Unauthorized:
      description: Unauthenticated — missing or invalid bearer token
    NoContent:
      description: No content — action completed successfully
    NotFound:
      description: Resource not found
  schemas:
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
          example: 1
        from:
          type:
          - integer
          - 'null'
          example: 1
        last_page:
          type: integer
          example: 5
        links:
          type: array
          items:
            type: object
            properties:
              url:
                type:
                - string
                - 'null'
                format: uri
              label:
                type: string
              active:
                type: boolean
        path:
          type: string
          format: uri
        per_page:
          type: integer
          example: 15
        to:
          type:
          - integer
          - 'null'
          example: 15
        total:
          type: integer
          example: 73
    SendCampaignTestRequest:
      type: object
      required:
      - email
      properties:
        email:
          type: string
          description: Comma-delimited list of email addresses (max 10)
          example: test@example.com
    ValidationError:
      type: object
      properties:
        message:
          type: string
          example: The given data was invalid.
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
      - message
      - errors
    Timestamp:
      type: string
      format: date-time
      example: '2026-01-15T12:00:00.000000Z'
    CampaignRequest:
      type: object
      required:
      - name
      - email_list_uuid
      properties:
        name:
          type: string
        subject:
          type:
          - string
          - 'null'
        type:
          type:
          - string
          - 'null'
          enum:
          - draft
          - null
        email_list_uuid:
          type: string
          format: uuid
        segment_uuid:
          type:
          - string
          - 'null'
          format: uuid
        template_uuid:
          type: string
          format: uuid
          description: UUID of the template to use
        html:
          type:
          - string
          - 'null'
        fields:
          type:
          - object
          - 'null'
          additionalProperties: true
          description: Values for the chosen template's placeholder fields, keyed by field name. Editor fields accept a Markdown string or null when the Markdown editor is configured. Structured editor objects are rejected with a 422 response in that case.
        mailable_class:
          type:
          - string
          - 'null'
        utm_tags:
          type:
          - boolean
          - 'null'
        add_subscriber_tags:
          type:
          - boolean
          - 'null'
        add_subscriber_link_tags:
          type:
          - boolean
          - 'null'
        disable_webview:
          type:
          - boolean
          - 'null'
        schedule_at:
          type: string
          description: 'Format: Y-m-d H:i:s'
          example: '2026-03-15 10:00:00'
    PaginationLinks:
      type: object
      properties:
        first:
          type: string
          format: uri
          example: https://your-app.com/api/templates?page=1
        last:
          type: string
          format: uri
          example: https://your-app.com/api/templates?page=5
        prev:
          type:
          - string
          - 'null'
          format: uri
        next:
          type:
          - string
          - 'null'
          format: uri
    Template:
      type: object
      properties:
        uuid:
          $ref: '#/components/schemas/Uuid'
        name:
          type: string
          example: Monthly newsletter
        html:
          type:
          - string
          - 'null'
          description: Compiled HTML content
        fields:
          type:
          - object
          - 'null'
          description: Template field values (editor-specific)
          additionalProperties: true
        structured_html:
          type:
          - string
          - 'null'
          description: Structured HTML used by the editor
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    EmailList:
      type: object
      properties:
        uuid:
          $ref: '#/components/schemas/Uuid'
        name:
          type: string
          example: Newsletter subscribers
        active_subscribers_count:
          type: integer
          example: 1234
        campaigns_feed_enabled:
          type: boolean
        default_from_email:
          type: string
          format: email
        default_from_name:
          type:
          - string
          - 'null'
        default_reply_to_email:
          type:
          - string
          - 'null'
        default_reply_to_name:
          type:
          - string
          - 'null'
        allow_form_subscriptions:
          type: boolean
        honeypot_field:
          type:
          - string
          - 'null'
        redirect_after_subscribed:
          type:
          - string
          - 'null'
        redirect_after_already_subscribed:
          type:
          - string
          - 'null'
        redirect_after_subscription_pending:
          type:
          - string
          - 'null'
        redirect_after_unsubscribed:
          type:
          - string
          - 'null'
        requires_confirmation:
          type: boolean
        confirmation_mailable_class:
          type:
          - string
          - 'null'
        campaign_mailer:
          type:
          - string
          - 'null'
        automation_mailer:
          type:
          - string
          - 'null'
        transactional_mailer:
          type:
          - string
          - 'null'
        report_recipients:
          type:
          - string
          - 'null'
        report_campaign_sent:
          type: boolean
        report_campaign_summary:
          type: boolean
        report_email_list_summary:
          type: boolean
        email_list_summary_sent_at:
          $ref: '#/components/schemas/Timestamp'
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    Uuid:
      type: string
      format: uuid
      example: 00000000-0000-0000-0000-000000000000
    Campaign:
      type: object
      properties:
        uuid:
          $ref: '#/components/schemas/Uuid'
        name:
          type: string
          example: March 2026 Newsletter
        email_list_uuid:
          $ref: '#/components/schemas/Uuid'
        email_list:
          $ref: '#/components/schemas/EmailList'
        template_uuid:
          type:
          - string
          - 'null'
          format: uuid
        template:
          $ref: '#/components/schemas/Template'
        from_email:
          type:
          - string
          - 'null'
          format: email
        from_name:
          type:
          - string
          - 'null'
        status:
          type: string
          example: draft
        html:
          type:
          - string
          - 'null'
        structured_html:
          type:
          - string
          - 'null'
        email_html:
          type:
          - string
          - 'null'
          description: Final rendered HTML sent to subscribers
        webview_html:
          type:
          - string
          - 'null'
        fields:
          type:
          - object
          - 'null'
          additionalProperties: true
          description: Template field values
        mailable_class:
          type:
          - string
          - 'null'
        utm_tags:
          type:
          - boolean
          - 'null'
        sent_to_number_of_subscribers:
          type: integer
        segment_uuid:
          type:
          - string
          - 'null'
          format: uuid
        segment_class:
          type:
          - string
          - 'null'
        segment_description:
          type:
          - string
          - 'null'
        open_count:
          type: integer
        unique_open_count:
          type: integer
        open_rate:
          type: number
          format: float
        click_count:
          type: integer
        unique_click_count:
          type: integer
        click_rate:
          type: number
          format: float
        unsubscribe_count:
          type: integer
        unsubscribe_rate:
          type: number
          format: float
        bounce_count:
          type: integer
        bounce_rate:
          type: number
          format: float
        sent_at:
          type:
          - string
          - 'null'
          format: date-time
        statistics_calculated_at:
          type:
          - string
          - 'null'
          format: date-time
        scheduled_at:
          type:
          - string
          - 'null'
          format: date-time
        summary_mail_sent_at:
          type:
          - string
          - 'null'
          format: date-time
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
  parameters:
    per_page:
      name: per_page
      in: query
      description: Number of items per page
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 15
    page:
      name: page
      in: query
      description: Page number
      schema:
        type: integer
        minimum: 1
        default: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Laravel Sanctum API token