uploads.sh Files API

Upload files, read and update their metadata, and find them again.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 11

GET /v1/workspaces/{workspace}/files List files #
GET /v1/workspaces/{workspace}/files/search Search files #
GET /v1/workspaces/{workspace}/files/facets List metadata keys #
POST /v1/workspaces/{workspace}/files/sign Create an upload URL #
GET /v1/workspaces/{workspace}/files/by-path List files by path #
GET /v1/workspaces/{workspace}/files/file-url Get a file URL #
PATCH /v1/workspaces/{workspace}/files/visibility Update visibility #
PUT /v1/workspaces/{workspace}/files/{key} Upload a file #
GET /v1/workspaces/{workspace}/files/{key} Get file metadata #
PATCH /v1/workspaces/{workspace}/files/{key} Update metadata #
DELETE /v1/workspaces/{workspace}/files/{key} Delete a file #

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/uploads-sh:uploads-sh-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. 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

uploads-sh-files-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: uploads.sh Files API
  version: 1.0.0
  description: 'Workspace-scoped file hosting for agents and humans. The canonical public hierarchy is `/v1/workspaces/{workspace}/...`. Full narrative docs: https://uploads.sh/docs/api'
  contact:
    url: https://github.com/buildinternet/uploads
  license:
    name: Apache-2.0
    url: https://github.com/buildinternet/uploads/blob/main/LICENSE
servers:
- url: https://api.uploads.sh
  description: Production API
security:
- bearerAuth: []
tags:
- name: Files
  description: Upload files, read and update their metadata, and find them again.
paths:
  /v1/workspaces/{workspace}/files:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    get:
      operationId: listFiles
      security:
      - bearerAuth:
        - files:read
      summary: List files
      parameters:
      - $ref: '#/components/parameters/Prefix'
      - name: delimiter
        in: query
        schema:
          type: string
        description: Return common prefixes for folder-style navigation.
      - $ref: '#/components/parameters/FileLimit'
      - $ref: '#/components/parameters/Cursor'
      - name: metadata
        in: query
        schema:
          type: string
          enum:
          - '0'
          - 'false'
        description: Pass `0` to skip metadata on each item.
      responses:
        '200':
          description: A page of files and an opaque continuation cursor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileList'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/search:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    get:
      operationId: searchFiles
      security:
      - bearerAuth:
        - files:read
      summary: Search files
      description: Requires at least one `meta.` equality filter or a `name` substring. Metadata filter names are dynamic query parameters.
      parameters:
      - name: name
        in: query
        schema:
          type: string
          minLength: 1
          maxLength: 128
      - $ref: '#/components/parameters/Prefix'
      - name: limit
        in: query
        schema:
          type: integer
          minimum: 1
          maximum: 100
          default: 100
      - $ref: '#/components/parameters/Cursor'
      - name: collapse
        in: query
        schema:
          type: string
          enum:
          - promoted
        description: Drop branch originals that were promoted to a PR copy.
      responses:
        '200':
          description: A bounded page. `truncated` is true and `cursor` is non-null when more matches remain; pass `cursor` back to continue.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileSearch'
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/facets:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    get:
      operationId: listFileFacets
      security:
      - bearerAuth:
        - files:read
      summary: List metadata keys
      parameters:
      - name: key
        in: query
        schema:
          type: string
        description: When present, list values for this metadata key. Otherwise list keys.
      responses:
        '200':
          description: Metadata key facets or value facets.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileFacets'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/sign:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    post:
      operationId: signFileUpload
      security:
      - bearerAuth:
        - files:write
      summary: Create an upload URL
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SignRequest'
      responses:
        '200':
          description: Presigned upload details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignedUpload'
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/by-path:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    get:
      operationId: listFilesByPath
      security:
      - bearerAuth:
        - files:read
      summary: List files by path
      description: 'Powers the web Screenshots page''s grouped-by-path view. Groups recently uploaded `gh.*`-tagged files by project and path. Files with a `screen` and no `path` group by screen name, marked `by: "screen"`.'
      parameters:
      - name: merged
        in: query
        schema:
          type: string
          enum:
          - '1'
        description: Set to `1` to include only files tagged from a merged PR.
      - name: type
        in: query
        schema:
          type: string
          enum:
          - screenshot
          - video
          - other
        description: Keep only files of this type, by key extension.
      - name: surface
        in: query
        schema:
          type: string
          enum:
          - mobile
          - desktop
          - tablet
        description: Keep only files the classifier labeled with this device (`ai.surface`).
      - name: since
        in: query
        schema:
          type: string
          pattern: ^[1-9][0-9]{0,2}d$
          example: 7d
        description: Keep only files uploaded in the last N days (1d to 365d).
      responses:
        '200':
          description: Path groups, a flat catalog, known projects, and a flat recent feed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileByPath'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/file-url:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    get:
      operationId: getFileUrl
      security:
      - bearerAuth:
        - files:read
      summary: Get a file URL
      description: Returns the workspace's public URL when configured, otherwise a short-lived signed download URL. Resolves across storage lanes so a file uploaded before a storage switch still resolves.
      parameters:
      - name: key
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: A usable URL.
          content:
            application/json:
              schema:
                type: object
                required:
                - url
                properties:
                  url:
                    type: string
                    format: uri
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/visibility:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    patch:
      operationId: setFileVisibility
      security:
      - bearerAuth:
        - files:write
      summary: Update visibility
      parameters:
      - name: key
        in: query
        required: true
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - visibility
              properties:
                visibility:
                  type: string
                  enum:
                  - public
                  - private
      responses:
        '200':
          description: The updated visibility.
          content:
            application/json:
              schema:
                type: object
                required:
                - key
                - visibility
                properties:
                  key:
                    type: string
                  visibility:
                    type: string
                    enum:
                    - public
                    - private
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Files
  /v1/workspaces/{workspace}/files/{key}:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    - $ref: '#/components/parameters/FileKey'
    put:
      operationId: putFile
      security:
      - bearerAuth:
        - files:write
      summary: Upload a file
      description: Send an Idempotency-Key to make retries safe for 24 hours. Reusing the key with the same effective request (keyed on the uploaded content) returns the original 201 response. Reusing it with a different request returns 409.
      parameters:
      - name: replace
        in: query
        schema:
          type: boolean
          default: false
        description: 'Allow replacement. `X-Uploads-Replace: 1` is an equivalent header form.'
      - name: dryRun
        in: query
        schema:
          type: boolean
          default: false
        description: Validate and resolve the final key without writing.
      - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
      responses:
        '200':
          description: Dry-run result when `dryRun` is enabled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FileDryRun'
        '201':
          description: The file was stored.
          headers:
            Idempotency-Replayed:
              description: Present with value `true` when the API replays a stored response.
              schema:
                type: string
                enum:
                - 'true'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilePut'
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '409':
          $ref: '#/components/responses/Conflict'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Files
    get:
      operationId: getFile
      security:
      - bearerAuth:
        - files:read
      summary: Get file metadata
      parameters:
      - name: metadata
        in: query
        schema:
          type: boolean
          default: false
        description: Return only the queryable metadata map.
      responses:
        '200':
          description: Object metadata, or a metadata-only response when requested.
          content:
            application/json:
              schema:
                oneOf:
                - $ref: '#/components/schemas/FileHead'
                - $ref: '#/components/schemas/MetadataResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      tags:
      - Files
    patch:
      operationId: patchFileMetadata
      security:
      - bearerAuth:
        - files:write
      summary: Update metadata
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MetadataPatch'
      responses:
        '200':
          description: The merged metadata map.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetadataResult'
        '400':
          $ref: '#/components/responses/Validation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Files
    delete:
      operationId: deleteFile
      security:
      - bearerAuth:
        - files:delete
      summary: Delete a file
      responses:
        '200':
          description: The file was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
      tags:
      - Files
components:
  schemas:
    Metadata:
      type: object
      additionalProperties:
        type: string
    FilePut:
      allOf:
      - $ref: '#/components/schemas/FileHead'
      - type: object
        required:
        - workspace
        - replaced
        properties:
          workspace:
            type: string
          replaced:
            type: boolean
          provenance:
            $ref: '#/components/schemas/Provenance'
          holdCheck:
            const: pending
            description: Present when the classifier may still hold this file for review. It decides after the response.
    FileHead:
      type: object
      required:
      - key
      - size
      - contentType
      - url
      - embedUrl
      properties:
        key:
          type: string
        size:
          type: integer
          minimum: 0
        contentType:
          type: string
        uploaded:
          type: string
          format: date-time
        url:
          type:
          - string
          - 'null'
          format: uri
        embedUrl:
          type:
          - string
          - 'null'
          format: uri
        metadata:
          $ref: '#/components/schemas/Metadata'
        visibility:
          type: string
          enum:
          - public
          - private
        provenance:
          $ref: '#/components/schemas/Provenance'
        pageUrl:
          type: string
          format: uri
          description: Public `/f/` page. Listing only, when the file has a public URL.
    FileDryRun:
      type: object
      required:
      - workspace
      - key
      - url
      - embedUrl
      - replaced
      - wouldRefuse
      - dryRun
      properties:
        workspace:
          type: string
        key:
          type: string
        url:
          type:
          - string
          - 'null'
          format: uri
        embedUrl:
          type:
          - string
          - 'null'
          format: uri
        replaced:
          type: boolean
        wouldRefuse:
          type: boolean
        dryRun:
          const: true
    FileList:
      type: object
      required:
      - files
      - cursor
      properties:
        files:
          type: array
          items:
            $ref: '#/components/schemas/FileHead'
        prefixes:
          type: array
          items:
            type: string
        cursor:
          type:
          - string
          - 'null'
    SignRequest:
      type: object
      required:
      - key
      - contentType
      properties:
        key:
          type: string
        contentType:
          type: string
        maxSize:
          type: integer
          minimum: 1
        expiresIn:
          type: integer
          minimum: 1
          maximum: 86400
          description: 'Seconds until the signed URL expires. Capped at 900 for SVG and XML content types (issue #929).'
        replace:
          type: boolean
          default: false
    MetadataPatch:
      type: object
      properties:
        set:
          $ref: '#/components/schemas/Metadata'
        delete:
          type: array
          items:
            type: string
    FileSearchItem:
      type: object
      required:
      - key
      - url
      - embedUrl
      - metadata
      properties:
        key:
          type: string
        url:
          type:
          - string
          - 'null'
          format: uri
        embedUrl:
          type:
          - string
          - 'null'
          format: uri
        metadata:
          $ref: '#/components/schemas/Metadata'
        updatedAt:
          type: string
          format: date-time
    FileByPath:
      type: object
      required:
      - groups
      - catalog
      - projects
      - latest
      - truncated
      - catalogTruncated
      properties:
        groups:
          type: array
          items:
            type: object
        catalog:
          type: array
          items:
            type: object
        projects:
          type: array
          items:
            type: string
        latest:
          type: array
          items:
            type: object
        truncated:
          type: boolean
        catalogTruncated:
          type: boolean
    DeleteResult:
      type: object
      required:
      - deleted
      properties:
        id:
          type: string
        key:
          type: string
        deleted:
          const: true
      anyOf:
      - required:
        - id
      - required:
        - key
    Provenance:
      type: object
      additionalProperties:
        type: string
      description: Server-stamped object provenance (`client`, `source-name`, `content-sha256`).
    SignedUpload:
      type: object
      required:
      - workspace
      - key
      - expiresIn
      - publicUrl
      - embedUrl
      - upload
      properties:
        workspace:
          type: string
        key:
          type: string
        maxSize:
          type: integer
          minimum: 1
        expiresIn:
          type: integer
          minimum: 1
          description: Seconds until the signed target expires.
        publicUrl:
          type:
          - string
          - 'null'
          format: uri
        embedUrl:
          type:
          - string
          - 'null'
          format: uri
        upload:
          oneOf:
          - type: object
            required:
            - method
            - url
            properties:
              method:
                const: PUT
              url:
                type: string
                format: uri
              headers:
                $ref: '#/components/schemas/Metadata'
          - type: object
            required:
            - method
            - url
            - fields
            properties:
              method:
                const: POST
              url:
                type: string
                format: uri
              fields:
                $ref: '#/components/schemas/Metadata'
          description: 'Send the bytes here: a PUT with `headers`, or a multipart POST with `fields`.'
    ErrorEnvelope:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - type
          - message
          properties:
            code:
              type: string
            type:
              type: string
            message:
              type: string
            details: {}
    FileSearch:
      type: object
      required:
      - items
      - truncated
      - cursor
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/FileSearchItem'
        truncated:
          type: boolean
        cursor:
          type:
          - string
          - 'null'
          description: Opaque continuation for the next page, or null on the last page.
    FileFacets:
      oneOf:
      - type: object
        required:
        - keys
        - truncated
        properties:
          keys:
            type: array
            items:
              type: object
          truncated:
            type: boolean
      - type: object
        required:
        - key
        - values
        - truncated
        properties:
          key:
            type: string
          values:
            type: array
            items:
              type: object
          truncated:
            type: boolean
    MetadataResult:
      type: object
      required:
      - metadata
      properties:
        metadata:
          $ref: '#/components/schemas/Metadata'
  parameters:
    Workspace:
      name: workspace
      in: path
      required: true
      schema:
        type: string
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: A caller-scoped retry key retained for 24 hours. Use 1 to 255 visible ASCII characters.
      schema:
        type: string
        minLength: 1
        maxLength: 255
    Cursor:
      name: cursor
      in: query
      schema:
        type: string
      description: Opaque cursor returned by the previous page.
    Prefix:
      name: prefix
      in: query
      schema:
        type: string
    FileLimit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 1000
        default: 100
    FileKey:
      name: key
      in: path
      required: true
      schema:
        type: string
      description: Object key. It may include slashes.
  responses:
    Validation:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: The credential lacks the required scope or role.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Unauthorized:
      description: Missing or invalid credential.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: The resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    RateLimited:
      description: The workspace rate limit or upload budget was exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    UnsupportedMediaType:
      description: The bytes are not an allowed media type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    PayloadTooLarge:
      description: The upload exceeds the workspace limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Conflict:
      description: The request conflicts with current resource state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Workspace token from `uploads login` or `/account/developers`. Canonical routes can also accept an uploads.sh browser session, but public API integrations should use a workspace token. Tokens carry named scopes `files:read`, `files:write`, and `files:delete`; each operation lists the required scope as a role name on this scheme. REST v1 does not accept OAuth access tokens (those are for the hosted MCP). Scope catalog: https://api.uploads.sh/.well-known/oauth-protected-resource'
    oauth2:
      type: oauth2
      description: 'Named permission scopes for workspace tokens (this API) and for OAuth 2.1 access tokens on the hosted MCP at https://agents.uploads.sh/mcp. REST v1 authenticates with `bearerAuth` only. Request the scopes listed on each operation. Discovery: https://uploads.sh/.well-known/oauth-authorization-server and https://api.uploads.sh/.well-known/oauth-protected-resource'
      flows:
        authorizationCode:
          authorizationUrl: https://uploads.sh/api/auth/oauth2/authorize
          tokenUrl: https://auth.uploads.sh/api/auth/oauth2/token
          scopes:
            files:read: List, search, read metadata, usage, galleries, and feeds.
            files:write: Upload, update metadata, galleries, feeds, and usage reconcile.
            files:delete: Delete stored objects and purge expired objects.
x-tagGroups:
- name: Core
  tags:
  - Files
  - Review
- name: Sharing
  tags:
  - Galleries
  - Live links
  - Public
- name: Workspace
  tags:
  - GitHub
  - Usage
  - Maintenance