Sending Attachments API

The Attachments API from Sending — 3 operation(s) for attachments.

GitHub OpenAPI

Operations 5

GET /attachments List workspace attachments #
POST /attachments Upload a reusable attachment #
GET /attachments/{id} Metadata and download URL #
DELETE /attachments/{id} Delete an attachment #
POST /attachments/{id}/confirm Confirm a signed upload #

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/sending-dev:sending-dev-attachments-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

sending-dev-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Sending.dev Attachments API
  version: 1.0.0
  description: 'Public REST API of Sending.dev (MCP-native orchestrator for email + WhatsApp + Telegram).


    ## Authentication

    Every request requires `Authorization: Bearer sk_...` (workspace API key). The `tenantId` is always derived from the key.


    ## Idempotency

    Sends require an `idempotencyKey` (min 8 characters) to prevent duplicates on retries.'
  contact:
    name: Sending.dev
    url: https://sending.dev
servers:
- url: https://sending.dev/api/v1
  description: Production
- url: http://localhost:3000/api/v1
  description: Local development
security:
- bearerAuth: []
tags:
- name: Attachments
paths:
  /attachments:
    get:
      tags:
      - Attachments
      summary: List workspace attachments
      description: 'Required scope: `email:send` or `inbox:send`. An attachment uploaded once is reused across sends: pass `attachments: [{ id }]` to `/emails`, `/messages`, `/campaigns` or `/inboxes/{id}/send`.'
      security:
      - bearerAuth: []
      x-required-scope:
      - email:send
      - inbox:send
      responses:
        '200':
          description: Workspace attachments, newest first.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentList'
        '401':
          description: Missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
      operationId: getAttachments
      x-operation-id-source: derived
    post:
      tags:
      - Attachments
      summary: Upload a reusable attachment
      description: 'Two modes: with `content` (base64) the file is uploaded immediately and the attachment is born ready; with `size` the response carries a signed `uploadUrl` to PUT the file to (mandatory beyond the few MB accepted in the body). Executable extensions and files over 10 MB are rejected. Required scope: `email:send` or `inbox:send`. An attachment uploaded once is reused across sends: pass `attachments: [{ id }]` to `/emails`, `/messages`, `/campaigns` or `/inboxes/{id}/send`.'
      security:
      - bearerAuth: []
      x-required-scope:
      - email:send
      - inbox:send
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAttachmentInput'
      responses:
        '201':
          description: 'Attachment created: `attachment` alone with `content`, `attachment` + `uploadUrl` with `size`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUpload'
        '401':
          description: Missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '422':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      operationId: postAttachments
      x-operation-id-source: derived
  /attachments/{id}:
    get:
      tags:
      - Attachments
      summary: Metadata and download URL
      description: 'Attachment metadata + signed download URL (15 minutes). Required scope: `email:send` or `inbox:send`. An attachment uploaded once is reused across sends: pass `attachments: [{ id }]` to `/emails`, `/messages`, `/campaigns` or `/inboxes/{id}/send`.'
      security:
      - bearerAuth: []
      x-required-scope:
      - email:send
      - inbox:send
      parameters:
      - schema:
          type: string
          description: Attachment ID.
        required: true
        name: id
        in: path
      responses:
        '200':
          description: Attachment with signed download URL.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentDownload'
        '401':
          description: Missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: getAttachmentsById
      x-operation-id-source: derived
    delete:
      tags:
      - Attachments
      summary: Delete an attachment
      description: 'Removes the row and the object in storage. Already queued sends that reference it will go out without that file. Required scope: `email:send` or `inbox:send`. An attachment uploaded once is reused across sends: pass `attachments: [{ id }]` to `/emails`, `/messages`, `/campaigns` or `/inboxes/{id}/send`.'
      security:
      - bearerAuth: []
      x-required-scope:
      - email:send
      - inbox:send
      parameters:
      - schema:
          type: string
          description: Attachment ID.
        required: true
        name: id
        in: path
      responses:
        '200':
          description: Attachment deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentDeleted'
        '401':
          description: Missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      operationId: deleteAttachmentsById
      x-operation-id-source: derived
  /attachments/{id}/confirm:
    post:
      tags:
      - Attachments
      summary: Confirm a signed upload
      description: 'Marks as ready an attachment uploaded with `uploadUrl`, aligning actual size and Content-Type. Optional: the same check happens the first time the attachment is used in a send. Required scope: `email:send` or `inbox:send`. An attachment uploaded once is reused across sends: pass `attachments: [{ id }]` to `/emails`, `/messages`, `/campaigns` or `/inboxes/{id}/send`.'
      security:
      - bearerAuth: []
      x-required-scope:
      - email:send
      - inbox:send
      parameters:
      - schema:
          type: string
          description: Attachment ID.
        required: true
        name: id
        in: path
      responses:
        '200':
          description: Attachment ready to use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentEnvelope'
        '401':
          description: Missing or invalid token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The file has not been uploaded yet (`attachment_not_uploaded`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      operationId: postAttachmentsByIdConfirm
      x-operation-id-source: derived
components:
  schemas:
    AttachmentDeleted:
      type: object
      properties:
        deleted:
          type: boolean
          enum:
          - true
        id:
          type: string
          format: uuid
      required:
      - deleted
      - id
    AttachmentDownload:
      type: object
      properties:
        attachment:
          $ref: '#/components/schemas/Attachment'
        downloadUrl:
          type: string
          description: Signed download URL (15 minutes).
      required:
      - attachment
      - downloadUrl
    ValidationError:
      type: object
      properties:
        error:
          type: object
          properties:
            formErrors:
              type: array
              items:
                type: string
            fieldErrors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
          required:
          - formErrors
          - fieldErrors
      required:
      - error
      description: 'Zod validation failed: shape of `ZodError.flatten()`.'
    CreateAttachmentInput:
      type: object
      properties:
        filename:
          type: string
          minLength: 1
          maxLength: 255
          description: File name shown to the recipient.
        contentType:
          type: string
          minLength: 3
          maxLength: 255
          description: When absent, it is inferred from the file name.
        size:
          type: integer
          exclusiveMinimum: 0
          maximum: 10485760
          description: 'File size in bytes: required in signed upload mode (without `content`).'
        content:
          type: string
          minLength: 1
          description: Base64 content for an immediate upload, without the `data:` prefix.
      required:
      - filename
    AttachmentUpload:
      type: object
      properties:
        attachment:
          $ref: '#/components/schemas/Attachment'
        uploadUrl:
          type: string
          description: Signed URL to PUT the file to, with the same declared Content-Type and Content-Length.
        expiresIn:
          type: integer
          description: Validity of the uploadUrl, in seconds.
      required:
      - attachment
      - uploadUrl
      - expiresIn
    Error:
      type: object
      properties:
        error:
          type: string
          example: not_found
        message:
          type: string
      required:
      - error
      description: 'Generic error: snake_case code in `error`.'
    AttachmentList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
      required:
      - data
    Attachment:
      type: object
      properties:
        id:
          type: string
          format: uuid
        filename:
          type: string
          example: invoice-2026-07.pdf
        contentType:
          type: string
          example: application/pdf
        size:
          type: integer
          description: File size in bytes.
        status:
          type: string
          enum:
          - pending
          - ready
          description: '`pending` until the signed upload is confirmed.'
        createdAt:
          type: string
          format: date-time
          example: '2026-06-30T12:00:00.000Z'
      required:
      - id
      - filename
      - contentType
      - size
      - status
      - createdAt
    AttachmentEnvelope:
      type: object
      properties:
        attachment:
          $ref: '#/components/schemas/Attachment'
      required:
      - attachment
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          enum:
          - forbidden
        need:
          type: string
          example: contacts:write
      required:
      - error
      description: Insufficient scope; `need` names the missing scope.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Workspace API key in the `sk_...` format, passed as `Authorization: Bearer sk_...`. The `tenantId` is always derived from the key, never from a request parameter.'