Mailcoach Uploads API

Images hosted by Mailcoach for use in email content

GitHub OpenAPI

Operations 1

POST /uploads Upload one or multiple images #

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-uploads-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-uploads-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Mailcoach Uploads 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: Uploads
  description: Images hosted by Mailcoach for use in email content
paths:
  /uploads:
    post:
      operationId: uploadImages
      summary: Upload one or multiple images
      tags:
      - Uploads
      description: 'Upload user-supplied JPEG, PNG, GIF, or WebP images to Mailcoach.

        Requires the upload model''s `create` permission (by default, `viewMailcoach`).

        The default limits are 10 images per request and 8192 KB per image,

        configurable through `mailcoach.uploads.max_files` and `max_file_size`.

        Web server request limits also apply. SVG images are not accepted.


        Send multipart files as `images[0][file]`, `images[1][file]`, etc.,

        or send JSON with `images` containing a `name` and `base64` for each image.

        Each image must have exactly one source: a file or base64 data.

        Base64 data must contain the actual file bytes, without a data URI prefix.

        All images are validated before any are stored. Failed storage attempts

        clean up the uploads created by that request.


        The response maps original filenames to hosted URLs in input order.

        Images use the configured uploads disk, collection, and resize settings.

        GIFs retain the original file so animation is preserved.

        The uploads disk must serve files at publicly reachable URLs for email readers.


        Uploading does not change an email. To add an image, insert its returned URL

        into the email''s HTML using the existing email update endpoint. To replace

        an image, upload the new image and change the intended image reference,

        preserving other content, links, and layout and updating alt text as needed.

        For template-based emails, update the corresponding template fields.

        Replacement does not overwrite or delete the old uploaded file.


        MCP clients can use `upload-images-tool` with the same JSON input. They must

        be able to read attachment bytes and encode them as base64; local paths and

        attachment identifiers are not file data. Tool descriptions guide the agent

        to read the target email, upload the supplied images, then update the email.

        If the replacement target is unclear, the agent should ask the user.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - images
              properties:
                images:
                  type: array
                  minItems: 1
                  description: Defaults to a maximum of 10 images; configurable per installation.
                  items:
                    type: object
                    additionalProperties: false
                    required:
                    - name
                    - base64
                    properties:
                      name:
                        type: string
                        maxLength: 255
                        example: header.png
                        description: Original filename, returned to identify the corresponding hosted image.
                      base64:
                        type: string
                        format: byte
                        description: Actual image bytes encoded as base64 without a data URI prefix.
          multipart/form-data:
            schema:
              type: object
              required:
              - images
              properties:
                images:
                  type: array
                  minItems: 1
                  description: Send each file as images[0][file], images[1][file], etc.
                  items:
                    type: object
                    required:
                    - file
                    properties:
                      file:
                        type: string
                        format: binary
      responses:
        '201':
          description: Images uploaded, in input order. This collection is not paginated.
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      required:
                      - uuid
                      - name
                      - url
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        name:
                          type: string
                          description: Original filename.
                        url:
                          type: string
                          format: uri
                          description: Hosted image URL suitable for email HTML.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
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
  schemas:
    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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Laravel Sanctum API token