Caliu Attachments API

The Attachments API from Caliu — 7 operation(s) for attachments.

Operations 8

POST /attachments Upload attachment #
GET /attachments Attachment metadata #
POST /attachments/import Import an image from a URL #
POST /attachments/uploads Create upload link #
PUT /attachments/uploads/{token} Upload to a link #
PUT /attachments/{attId}/text Set attachment text #
DELETE /attachments/{attId} Delete attachment #
GET /attachments/{attId}/download Download 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/caliuapp-com:caliuapp-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. See our Privacy Policy and Terms.

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

OpenAPI Specification

caliuapp-com-attachments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Caliu Attachments API
  version: 1.0.0
  description: 'API-first notes app. Access your notes programmatically using an API key.


    Create an API key in the app settings, then pass it as `Authorization: Bearer caliu_xxx` header.'
  contact:
    name: Caliu
    url: https://caliuapp.com
servers:
- url: https://api.caliuapp.com
  description: Production
security:
- bearerAuth: []
tags:
- name: Attachments
paths:
  /attachments:
    post:
      tags:
      - Attachments
      summary: Upload attachment
      description: Upload a user-owned file attachment. Any file type, max 100MB.
      security:
      - bearerAuth: []
      - cookieAuth: []
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  nullable: true
                id:
                  type: string
      responses:
        '200':
          description: Idempotent replay - attachment already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachment:
                    $ref: '#/components/schemas/Attachment'
                required:
                - attachment
        '201':
          description: File uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachment:
                    $ref: '#/components/schemas/Attachment'
                required:
                - attachment
        '400':
          description: Invalid file or id
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Free storage limit reached (Caliu Pro required)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '409':
          description: id already owned by another user
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '500':
          description: Storage failure
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: postAttachments
      x-operation-id-source: derived
    get:
      tags:
      - Attachments
      summary: Attachment metadata
      description: Name, type and size of the caller's attachments with the given ids (comma-separated, at most 100), so a file shows its size without downloading it. Unknown ids and other users' attachments are left out.
      security:
      - bearerAuth: []
      - cookieAuth: []
      parameters:
      - schema:
          type: string
          description: Comma-separated attachment ids
        required: true
        description: Comma-separated attachment ids
        name: ids
        in: query
      responses:
        '200':
          description: Metadata of the attachments found
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachments:
                    type: array
                    items:
                      $ref: '#/components/schemas/AttachmentMetadata'
                required:
                - attachments
        '400':
          description: Too many ids
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: getAttachments
      x-operation-id-source: derived
  /attachments/import:
    post:
      tags:
      - Attachments
      summary: Import an image from a URL
      description: Fetch an image from an http(s) URL and store it as an attachment under the given id. Images only, max 25MB.
      security:
      - bearerAuth: []
      - cookieAuth: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                id:
                  type: string
              required:
              - url
              - id
      responses:
        '200':
          description: Idempotent replay - attachment already exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachment:
                    $ref: '#/components/schemas/Attachment'
                required:
                - attachment
        '201':
          description: Image imported
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachment:
                    $ref: '#/components/schemas/Attachment'
                required:
                - attachment
        '400':
          description: Invalid URL or id
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '402':
          description: Free storage limit reached (Caliu Pro required)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '409':
          description: id already owned by another user
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '413':
          description: Image too large
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '422':
          description: The URL did not give an image
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '500':
          description: Storage failure
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: postAttachmentsImport
      x-operation-id-source: derived
  /attachments/uploads:
    post:
      tags:
      - Attachments
      summary: Create upload link
      description: Mint a one-time link to upload one file with a plain PUT of its bytes (no multipart, no base64). Single use, valid for an hour, max 100MB.
      security:
      - bearerAuth: []
      - cookieAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  minLength: 1
                  maxLength: 255
                content_type:
                  type: string
                  pattern: ^[A-Za-z0-9!#$&^_.+-]{1,64}\/[A-Za-z0-9!#$&^_.+-]{1,64}(;\s*[A-Za-z0-9_.-]+=[A-Za-z0-9_.-]+)*$
                  description: Defaults to application/octet-stream.
              required:
              - filename
      responses:
        '201':
          description: Upload link created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadLink'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: postAttachmentsUploads
      x-operation-id-source: derived
  /attachments/uploads/{token}:
    put:
      tags:
      - Attachments
      summary: Upload to a link
      description: 'Send the raw bytes of the file an upload link was made for. The token in the path is the credential: no Authorization header.'
      parameters:
      - schema:
          type: string
          description: From upload_url
        required: true
        description: From upload_url
        name: token
        in: path
      responses:
        '201':
          description: File uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  attachment:
                    $ref: '#/components/schemas/Attachment'
                required:
                - attachment
        '402':
          description: Free storage limit reached (Caliu Pro required)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '404':
          description: Link unknown, used or expired
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '411':
          description: Content-Length missing
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '413':
          description: File over 100MB
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '500':
          description: Storage failure
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: putAttachmentsUploadsByToken
      x-operation-id-source: derived
  /attachments/{attId}/text:
    put:
      tags:
      - Attachments
      summary: Set attachment text
      description: The words a device read from one of the caller's attachments (an image's text, a PDF's pages), so search finds the note it is in. An empty string means nothing was found. Text past 100000 characters is cut. Every device of the caller gets it through sync.
      security:
      - bearerAuth: []
      - cookieAuth: []
      parameters:
      - schema:
          type: string
          description: Attachment ID
        required: true
        description: Attachment ID
        name: attId
        in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
              required:
              - text
      responses:
        '200':
          description: Text stored
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '403':
          description: Another user's attachment
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '404':
          description: Not found (yet)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: putAttachmentsByAttIdText
      x-operation-id-source: derived
  /attachments/{attId}:
    delete:
      tags:
      - Attachments
      summary: Delete attachment
      description: Remove a user-owned file attachment from R2 storage and database.
      security:
      - bearerAuth: []
      - cookieAuth: []
      parameters:
      - schema:
          type: string
          description: Attachment ID
        required: true
        description: Attachment ID
        name: attId
        in: path
      responses:
        '200':
          description: Attachment deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                required:
                - ok
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: deleteAttachmentsByAttId
      x-operation-id-source: derived
  /attachments/{attId}/download:
    get:
      tags:
      - Attachments
      summary: Download attachment
      description: Stream a file attachment from R2 storage. Its uploader, plus anyone who can open a note referencing it that its owner or one of its editors uploaded it to; a note on a link makes it downloadable without authentication.
      security:
      - bearerAuth: []
      - cookieAuth: []
      parameters:
      - schema:
          type: string
          description: Attachment ID
        required: true
        description: Attachment ID
        name: attId
        in: path
      responses:
        '200':
          description: File stream
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      operationId: getAttachmentsByAttIdDownload
      x-operation-id-source: derived
components:
  schemas:
    UploadLink:
      type: object
      properties:
        upload_url:
          type: string
          description: PUT the raw file bytes here, with a Content-Length. Single use, expires after an hour.
        method:
          type: string
          enum:
          - PUT
        attachment_id:
          type: string
        download_url:
          type: string
          description: Where the file will be, for note markdown.
        content_type:
          type: string
        expires_at:
          type: string
        max_bytes:
          type: number
      required:
      - upload_url
      - method
      - attachment_id
      - download_url
      - content_type
      - expires_at
      - max_bytes
    AttachmentMetadata:
      type: object
      properties:
        id:
          type: string
        filename:
          type: string
        content_type:
          type: string
        size_bytes:
          type: number
      required:
      - id
      - filename
      - content_type
      - size_bytes
    Attachment:
      type: object
      properties:
        id:
          type: string
        filename:
          type: string
        content_type:
          type: string
        size_bytes:
          type: number
        r2_key:
          type: string
        created_at:
          type: string
      required:
      - id
      - filename
      - content_type
      - size_bytes
      - r2_key
      - created_at
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key (caliu_xxx) or session token
    cookieAuth:
      type: apiKey
      in: cookie
      name: caliu_session