SendSeven GmbH Attachments API

Upload, retrieve, and manage file attachments (images, documents, videos, audio) for messages.

GitHub OpenAPI

Operations 8

POST /api/v1/attachments/upload Upload Attachment #
POST /api/v1/attachments/from-url Create Attachment From Url #
GET /api/v1/attachments/{attachment_id} Get Attachment #
DELETE /api/v1/attachments/{attachment_id} Delete Attachment #
GET /api/v1/attachments/{attachment_id}/download Download Attachment #
GET /api/v1/attachments/{attachment_id}/url Get Attachment Url #
GET /api/v1/attachments/{attachment_id}/summary Get Attachment Summary #
POST /api/v1/attachments/{attachment_id}/summary Summarize Attachment #

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/sendseven-com:sendseven-com-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

sendseven-com-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SendSeven Attachments API
  description: Unified messaging API for WhatsApp, Telegram, SMS, and more
  version: '20261124.1227'
servers:
- url: https://api.sendseven.com
  description: Production
tags:
- name: Attachments
  description: Upload, retrieve, and manage file attachments (images, documents, videos, audio) for messages.
paths:
  /api/v1/attachments/upload:
    post:
      tags:
      - Attachments
      summary: Upload Attachment
      description: 'Upload a file attachment


        Args:

        file: The file to upload

        message_id: Optional message ID to associate with

        purpose: Optional. ``agent_test`` marks a Conversational-agent test

        console upload: deleted after 24 h unless it gets linked to a message.

        ``flow_test`` marks a Flow test panel upload: the server stamps

        ``expires_at = now + FLOW_TEST_UPLOAD_TTL_DAYS`` and the nightly

        expiring-attachment purge deletes it (row + blobs) afterwards.


        Returns:

        Attachment ID and metadata


        Security:

        - Validates file extension against blocklist

        - Validates file magic bytes match claimed MIME type

        - Enforces file size limits


        **🔐 Required Scopes:** `messages:create`'
      operationId: upload_attachment_api_v1_attachments_upload_post
      security:
      - HTTPBearer: []
      parameters:
      - name: message_id
        in: query
        required: false
        schema:
          type: string
          title: Message Id
      - name: purpose
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Purpose
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_attachment_api_v1_attachments_upload_post'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/attachments/from-url:
    post:
      tags:
      - Attachments
      summary: Create Attachment From Url
      description: 'Fetch a public URL server-side and store it as an attachment.


        Returns the same shape as ``POST /upload`` so the response is

        interchangeable. Caller can then pass the returned ``id`` /

        ``attachment_id`` in ``MessageCreate.attachments``.


        Per-tenant URL dedup: if this tenant already has an attachment

        whose ``source_url`` matches the requested ``url`` exactly, that

        row is returned without re-fetching or re-uploading. To force a

        re-fetch, vary the URL (e.g. add ``?t=12345``).


        Security:

        - ``http://`` / ``https://`` only — ``file://``, ``gopher://``,

        ``data://`` etc. rejected.

        - Hostname resolved up-front; rejected if any A/AAAA record

        falls into loopback, RFC1918, link-local (incl. cloud

        metadata 169.254.169.254), ULA, reserved, or multicast.

        - Bytes validated against the same magic-byte sniffer as

        ``/upload`` AND against a stricter MIME allowlist

        (``URL_FETCH_ALLOWED_MIME_TYPES``).

        - 50 MB hard cap; streaming cut-off enforced even if the

        server lies in ``Content-Length``.


        **Required Scopes:** ``messages:create``'
      operationId: create_attachment_from_url_api_v1_attachments_from_url_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachmentFromUrlRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUploadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /api/v1/attachments/{attachment_id}:
    get:
      tags:
      - Attachments
      summary: Get Attachment
      description: 'Get attachment metadata


        Args:

        attachment_id: ID of the attachment


        Returns:

        Attachment metadata including download URL


        **🔐 Required Scopes:** `messages:read`'
      operationId: get_attachment_api_v1_attachments__attachment_id__get
      security:
      - HTTPBearer: []
      parameters:
      - name: attachment_id
        in: path
        required: true
        schema:
          type: string
          title: Attachment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app__schemas__attachment_schema__AttachmentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Attachments
      summary: Delete Attachment
      description: 'Delete an attachment


        Permanently removes the ``attachments`` row **and** its stored blob. This

        is irreversible. Attachments are re-usable and carry no foreign key back

        to the messages that referenced them, so deleting one that a previously

        sent message still points at is allowed and expected — the message keeps

        its metadata, the media simply stops resolving.


        Args:

        attachment_id: ID of the attachment


        Returns:

        ``204 No Content`` on success. ``404`` when the attachment does not

        exist or belongs to another tenant. ``500`` when the row exists but

        the delete itself failed (e.g. the storage backend errored) — in that

        case the row is left intact so the call can be retried.


        **Required Scopes:** `messages:delete`'
      operationId: delete_attachment_api_v1_attachments__attachment_id__delete
      security:
      - HTTPBearer: []
      parameters:
      - name: attachment_id
        in: path
        required: true
        schema:
          type: string
          title: Attachment Id
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/attachments/{attachment_id}/download:
    get:
      tags:
      - Attachments
      summary: Download Attachment
      description: 'Download an attachment file


        Args:

        attachment_id: ID of the attachment

        disposition: Content-Disposition mode - "inline" (default, for viewing in

        browser) or "attachment" (forces download dialog)


        Returns:

        File stream


        **Required Scopes:** `messages:read`'
      operationId: download_attachment_api_v1_attachments__attachment_id__download_get
      security:
      - HTTPBearer: []
      parameters:
      - name: attachment_id
        in: path
        required: true
        schema:
          type: string
          title: Attachment Id
      - name: disposition
        in: query
        required: false
        schema:
          type: string
          default: inline
          title: Disposition
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/attachments/{attachment_id}/url:
    get:
      tags:
      - Attachments
      summary: Get Attachment Url
      description: 'Get a signed URL for an attachment


        Args:

        attachment_id: ID of the attachment

        expiration_minutes: URL expiration time in minutes


        Returns:

        Dict with signed URL


        **🔐 Required Scopes:** `messages:read`'
      operationId: get_attachment_url_api_v1_attachments__attachment_id__url_get
      security:
      - HTTPBearer: []
      parameters:
      - name: attachment_id
        in: path
        required: true
        schema:
          type: string
          title: Attachment Id
      - name: expiration_minutes
        in: query
        required: false
        schema:
          type: integer
          default: 60
          title: Expiration Minutes
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentUrlResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/attachments/{attachment_id}/summary:
    get:
      tags:
      - Attachments
      summary: Get Attachment Summary
      description: 'Get the AI summary of an image or PDF attachment.


        Returns the summary a Conversational Agent produced while reading the file,

        or one requested via `POST /attachments/{attachment_id}/summary`. Status

        `pending` means it is still being generated, `failed` means generation

        failed (a new `POST` may retry). The text is derived from a

        customer-supplied file: treat it as untrusted plain text.


        Errors: `403 feature_disabled` when AI features are off for the workspace;

        `404` when the attachment is unknown, not visible to you, or has no summary.


        **Required Scopes:** `messages:read`'
      operationId: get_attachment_summary_api_v1_attachments__attachment_id__summary_get
      security:
      - HTTPBearer: []
      parameters:
      - name: attachment_id
        in: path
        required: true
        schema:
          type: string
          title: Attachment Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentAISummary'
        '403':
          description: AI features are not enabled for this workspace (`feature_disabled`)
        '404':
          description: Unknown / inaccessible attachment, or no summary yet (`summary_not_found`)
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - Attachments
      summary: Summarize Attachment
      description: 'Generate an AI summary of an inbound image or PDF attachment on demand.


        Only for files a customer sent (inbound message), images up to 10 MB and

        PDFs up to 20 MB (the first 10 pages are read). Idempotent: if a summary

        already exists it is returned with `200` and nothing is charged; if one is

        being generated you get `202` (poll `GET /attachments/{attachment_id}/summary`).

        A new summary returns `201` and charges AI credits from the workspace pool

        (`credits_charged`: from 1 November 2026 the AI credits of the work used,

        may have decimals; before that image 2, PDF 3). A failed generation returns `502`

        `summary_failed`, charges nothing and may be retried. Request body: none.


        Errors: `403 feature_disabled`, `404` unknown/inaccessible attachment,

        `422 attachment_not_summarizable`, `429` rate limit (30/min per principal,

        60/min per workspace), `503 rate_limit_unavailable`.


        **Required Scopes:** `conversations:update`'
      operationId: summarize_attachment_api_v1_attachments__attachment_id__summary_post
      security:
      - HTTPBearer: []
      parameters:
      - name: attachment_id
        in: path
        required: true
        schema:
          type: string
          title: Attachment Id
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentSummaryActionResponse'
        '200':
          description: A summary already existed (no credits charged)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentSummaryActionResponse'
        '202':
          description: A summary is already being generated (poll GET)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentSummaryActionResponse'
        '403':
          description: AI features are not enabled for this workspace (`feature_disabled`)
        '404':
          description: Unknown or inaccessible attachment
        '422':
          description: Attachment type/size/direction not supported (`attachment_not_summarizable`)
        '429':
          description: Rate limit exceeded (30/min per user or API key, 60/min per workspace)
        '503':
          description: Rate limiter unavailable (`rate_limit_unavailable`), retry shortly
        '502':
          description: Summary generation failed (`summary_failed`, no credits charged, retry allowed)
components:
  schemas:
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    AttachmentUrlResponse:
      properties:
        url:
          type: string
          title: Url
          description: Signed download URL
        expires_in_minutes:
          type: integer
          title: Expires In Minutes
          description: Minutes until URL expires
      type: object
      required:
      - url
      - expires_in_minutes
      title: AttachmentUrlResponse
      description: Response for signed URL generation.
      example:
        expires_in_minutes: 60
        url: https://storage.googleapis.com/bucket/path?signature=...
    AttachmentFromUrlRequest:
      properties:
        url:
          type: string
          maxLength: 2083
          minLength: 1
          format: uri
          title: Url
          description: Public http(s) URL to fetch. file://, gopher://, etc. are rejected. Hostnames resolving to private/loopback/link-local IPs are blocked (SSRF protection).
        filename:
          anyOf:
          - type: string
            maxLength: 500
          - type: 'null'
          title: Filename
          description: Optional override for the stored filename. If omitted, the filename is derived from the URL path, falling back to a UUID-based name.
      type: object
      required:
      - url
      title: AttachmentFromUrlRequest
      description: 'Request body for POST /api/v1/attachments/from-url.


        Fetches a remote URL server-side, validates the bytes against the

        same MIME / size rules as POST /upload, stores them in our private

        GCS bucket, and returns an attachment ID. Per-tenant URL dedup: the

        same `url` will return the existing attachment without re-fetching.'
    AttachmentAISummary:
      properties:
        status:
          type: string
          enum:
          - ok
          - failed
          - pending
          title: Status
          description: '`ok` summary ready, `pending` being generated, `failed` generation failed (retry allowed).'
        kind:
          type: string
          enum:
          - image
          - pdf
          title: Kind
          description: File kind that was summarized.
        text:
          anyOf:
          - type: string
          - type: 'null'
          title: Text
          description: Full plain-text summary (untrusted customer-file content).
        sections:
          items:
            $ref: '#/components/schemas/AttachmentAISummarySection'
          type: array
          title: Sections
          description: Parsed sections; empty when the summary could not be split (show `text` instead).
        pages_read:
          anyOf:
          - type: integer
          - type: 'null'
          title: Pages Read
          description: 'PDF only: pages read (max 10).'
        pages_total:
          anyOf:
          - type: integer
          - type: 'null'
          title: Pages Total
          description: 'PDF only: total pages in the document.'
        truncated:
          type: boolean
          title: Truncated
          description: 'PDF only: true when only the first pages were read.'
          default: false
        model:
          anyOf:
          - type: string
          - type: 'null'
          title: Model
          description: Model that produced the summary.
        source:
          type: string
          enum:
          - agent
          - on_demand
          title: Source
          description: '`agent` = produced while a Conversational Agent read the file; `on_demand` = requested by a team member/API.'
        created_at:
          type: string
          title: Created At
          description: When the summary was created (UTC).
        updated_at:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated At
          description: When the summary was last updated (UTC).
      type: object
      required:
      - status
      - kind
      - source
      - created_at
      title: AttachmentAISummary
      description: 'AI-generated summary of an inbound image/PDF attachment.


        The text is derived from a CUSTOMER-SUPPLIED file: treat it as untrusted

        plain text (never render as HTML/markdown, never execute links).'
    AttachmentUploadResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique attachment identifier
        attachment_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Attachment Id
          description: Alias of `id` — preferred name for new callers. Persist this rather than the URL so future URL-form changes are transparent.
        filename:
          type: string
          title: Filename
          description: Original filename
        content_type:
          type: string
          title: Content Type
          description: MIME type of the file
        size:
          type: integer
          title: Size
          description: File size in bytes
        storage_path:
          type: string
          title: Storage Path
          description: Internal storage path
        download_url:
          type: string
          title: Download Url
          description: Authenticated proxy URL for downloading the attachment. Same-origin path (e.g. `/api/v1/attachments/{id}/download`) the browser fetches with the user's session cookie. The underlying GCS bucket is private; this is NOT a public URL. Use this for in-app render / agent UI / bot flows.
        public_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Public Url
          description: 'Absolute, **unauthenticated** public URL for the attachment (e.g. `https://api.sendseven.com/api/v1/attachments/public/{tenant_id}/{attachment_id}/{filename}`). Use this only for outbound contexts where an external service must `GET` the bytes — WhatsApp template `image.link` (Meta caches on first send), third-party webhook payloads, etc. The URL acts as a capability: anyone who has it can fetch the bytes. Don''t put it in places that don''t need it.'
      type: object
      required:
      - id
      - filename
      - content_type
      - size
      - storage_path
      - download_url
      title: AttachmentUploadResponse
      description: Response for successful file upload.
      example:
        attachment_id: 550e8400-e29b-41d4-a716-446655440000
        content_type: application/pdf
        download_url: /api/v1/attachments/550e8400-e29b-41d4-a716-446655440000/download
        filename: document.pdf
        id: 550e8400-e29b-41d4-a716-446655440000
        public_url: https://api.sendseven.com/api/v1/attachments/public/abc123/550e8400-e29b-41d4-a716-446655440000/document.pdf
        size: 102400
        storage_path: tenants/abc123/attachments/doc.pdf
    AttachmentAISummarySection:
      properties:
        key:
          type: string
          enum:
          - description
          - text
          - summary
          - key_facts
          title: Key
          description: 'Section label: `description`/`text` (images), `summary`/`key_facts` (PDFs).'
        text:
          type: string
          title: Text
          description: Plain-text section body (untrusted customer-file content).
      type: object
      required:
      - key
      - text
      title: AttachmentAISummarySection
      description: One labelled section of an AI file summary (plain text).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    app__schemas__attachment_schema__AttachmentResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique attachment identifier
        filename:
          type: string
          title: Filename
          description: Original filename
        content_type:
          type: string
          title: Content Type
          description: MIME type of the file
        file_size:
          type: integer
          title: File Size
          description: File size in bytes
        url:
          type: string
          title: Url
          description: Signed URL for downloading
      type: object
      required:
      - id
      - filename
      - content_type
      - file_size
      - url
      title: AttachmentResponse
      description: Response for attachment metadata.
      example:
        content_type: image/png
        file_size: 51200
        filename: image.png
        id: 550e8400-e29b-41d4-a716-446655440000
        url: https://storage.googleapis.com/...
    AttachmentSummaryActionResponse:
      properties:
        attachment_id:
          type: string
          title: Attachment Id
          description: The attachment that was summarized
        summary:
          anyOf:
          - $ref: '#/components/schemas/AttachmentAISummary'
          - type: 'null'
          description: The summary (status `ok`, or `pending` on 202)
        credits_charged:
          anyOf:
          - type: integer
          - type: number
          - type: 'null'
          title: Credits Charged
          description: AI credits charged by THIS call for a new summary, else 0. From 1 November 2026 the AI credits of the work used (may have decimals; null in the rare case it could not be read); before that 2 (image) / 3 (PDF).
          default: 0
      type: object
      required:
      - attachment_id
      title: AttachmentSummaryActionResponse
      description: 'Response of ``POST /api/v1/attachments/{attachment_id}/summary``.


        ``summary`` is the same object as ``ai_summary`` on message attachments.

        Its text comes from a CUSTOMER-SUPPLIED file: treat it as untrusted plain text.'
    Body_upload_attachment_api_v1_attachments_upload_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          title: File
      type: object
      required:
      - file
      title: Body_upload_attachment_api_v1_attachments_upload_post
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer