Decart Files API

The Files API from Decart — 2 operation(s) for files.

GitHub OpenAPI

Operations 5

GET /v1/files List Files #
POST /v1/files Upload File #
GET /v1/files/{file_id} Get File Metadata #
DELETE /v1/files/{file_id} Delete File #
GET /v1/files/by-md5/{md5} Get File By MD5 #

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/decart:decart-files-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

decart-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Decart Files API
  version: 1.0.0
tags:
- name: Files
paths:
  /v1/files:
    get:
      summary: List Files
      description: 'List your uploaded files, newest first. Expired files are omitted, as they 404 on `GET /v1/files/{file_id}`.


        Pages continue from the last file returned rather than from an offset, so an upload or delete between requests never repeats or skips a file. Pass the previous page''s `next_cursor` as `cursor`; the last page has `next_cursor: null`.'
      operationId: list_files_v1_files_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 1000
          default: 100
          title: Limit
        description: Files per page (1..1000); default 100.
      - name: cursor
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Cursor
        description: '`next_cursor` from the previous page. Omit for the first page.'
      - name: x-api-key
        in: header
        required: true
        schema:
          type: string
          description: API key for authentication
          title: X-Api-Key
        description: API key for authentication
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileListResponse'
        '422':
          description: Validation Error — `limit` out of range, or a `cursor` this endpoint did not return
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Files
    post:
      summary: Upload File
      description: 'Upload a file once and get back a `file_*` reference id you can reuse across generations.


        The same reference can be passed to realtime `set_image` as `image_ref`, avoiding a re-upload of the underlying bytes on every call.'
      operationId: upload_file_v1_files_post
      parameters:
      - name: x-api-key
        in: header
        required: true
        schema:
          type: string
          description: API key for authentication
          title: X-Api-Key
        description: API key for authentication
      - name: User-Agent
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: User-Agent
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_file_v1_files_post'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileReferenceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Files
  /v1/files/{file_id}:
    get:
      summary: Get File Metadata
      description: Get metadata for an uploaded file.
      operationId: get_file_metadata_v1_files__file_id__get
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          title: File Id
      - name: x-api-key
        in: header
        required: true
        schema:
          type: string
          description: API key for authentication
          title: X-Api-Key
        description: API key for authentication
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileReferenceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Files
    delete:
      summary: Delete File
      description: Delete an uploaded file early, before its TTL expires.
      operationId: delete_file_v1_files__file_id__delete
      parameters:
      - name: file_id
        in: path
        required: true
        schema:
          type: string
          title: File Id
      - name: x-api-key
        in: header
        required: true
        schema:
          type: string
          description: API key for authentication
          title: X-Api-Key
        description: API key for authentication
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Files
  /v1/files/by-md5/{md5}:
    get:
      summary: Get File By MD5
      description: Look up an uploaded file by the MD5 of its bytes, without knowing its `file_*` id. Returns the newest non-expired match when the same file was uploaded more than once. Compute the hash over the exact bytes you uploaded (for example `md5sum image.png`).
      operationId: get_file_by_md5_v1_files_by_md5__md5__get
      parameters:
      - name: md5
        in: path
        required: true
        schema:
          type: string
          pattern: ^[0-9a-fA-F]{32}$
          title: Md5
        description: Hex MD5 of the uploaded bytes
      - name: x-api-key
        in: header
        required: true
        schema:
          type: string
          description: API key for authentication
          title: X-Api-Key
        description: API key for authentication
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileReferenceResponse'
        '404':
          description: No non-expired upload with this MD5
          content:
            application/json:
              schema:
                type: object
                properties:
                  detail:
                    type: string
                required:
                - detail
                title: FileNotFound
              example:
                detail: File not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Files
components:
  schemas:
    Body_upload_file_v1_files_post:
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          format: binary
          title: File
          description: File to upload
        ttl_seconds:
          anyOf:
          - type: string
          - type: 'null'
          title: Ttl Seconds
          description: TTL in seconds (60..2_592_000), or "persistent" for no expiry. Omit for the platform default (24h).
      type: object
      required:
      - file
      title: Body_upload_file_v1_files_post
    FileListResponse:
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileReferenceResponse'
          title: Files
          description: Newest first.
        next_cursor:
          anyOf:
          - type: string
          - type: 'null'
          title: Next Cursor
          description: Pass back as `cursor` to fetch the next page; null on the last page.
      type: object
      required:
      - files
      - next_cursor
      title: FileListResponse
    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
    FileReferenceResponse:
      properties:
        id:
          type: string
          title: Id
        filename:
          anyOf:
          - type: string
          - type: 'null'
          title: Filename
        mime_type:
          type: string
          title: Mime Type
        size_bytes:
          type: integer
          title: Size Bytes
        md5:
          anyOf:
          - type: string
          - type: 'null'
          title: Md5
          description: Hex MD5 of the uploaded bytes. Null on files uploaded before hashes were recorded.
        created_at:
          type: string
          format: date-time
          title: Created At
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
      type: object
      required:
      - id
      - filename
      - mime_type
      - size_bytes
      - md5
      - created_at
      - expires_at
      title: FileReferenceResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
x-provenance:
  method: harvested
  publisher: Decart
  source: https://docs.platform.decart.ai/openapi.json
  note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
    stamped by stamp-openapi-provenance.py (roadmap#793)