uploads.sh Maintenance API

Advanced workspace operations that can scan or delete stored objects.

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 2

POST /v1/workspaces/{workspace}/usage/reconcile Recount usage #
POST /v1/workspaces/{workspace}/usage/purge-expired Purge expired files #

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-maintenance-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-maintenance-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: uploads.sh Maintenance 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: Maintenance
  description: Advanced workspace operations that can scan or delete stored objects.
paths:
  /v1/workspaces/{workspace}/usage/reconcile:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    post:
      operationId: reconcileUsage
      security:
      - bearerAuth:
        - files:write
      summary: Recount usage
      tags:
      - Maintenance
      description: 'Potentially expensive: scans every object in the workspace''s active storage lanes and rebuilds the usage ledger. Requires a bearer token with `files:write`; browser sessions are not accepted.'
      x-uploads-potentially-expensive: true
      responses:
        '200':
          description: Reconciliation result and updated usage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReconcile'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
  /v1/workspaces/{workspace}/usage/purge-expired:
    parameters:
    - $ref: '#/components/parameters/Workspace'
    post:
      operationId: purgeExpiredFiles
      security:
      - bearerAuth:
        - files:delete
      summary: Purge expired files
      tags:
      - Maintenance
      description: 'Destructive: permanently deletes objects older than the workspace''s `retentionDays`, then reconciles usage. Requires a bearer token with `files:delete`; browser sessions are not accepted. The response is either `{ skipped: true }` or a purge and reconciliation result.'
      x-uploads-destructive: true
      responses:
        '200':
          description: Purge result, or `skipped` when retention does not apply.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsagePurgeExpired'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    ErrorEnvelope:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - type
          - message
          properties:
            code:
              type: string
            type:
              type: string
            message:
              type: string
            details: {}
    UsagePurgeExpired:
      oneOf:
      - type: object
        required:
        - skipped
        - reason
        properties:
          skipped:
            const: true
          reason:
            type: string
      - type: object
        required:
        - workspace
        - retentionDays
        - cutoff
        - deleted
        - freedBytes
        - keys
        - keysTruncated
        - reconcile
        properties:
          workspace:
            type: string
          retentionDays:
            type: integer
            minimum: 1
          cutoff:
            type: string
            format: date-time
          deleted:
            type: integer
            minimum: 0
          freedBytes:
            type: integer
            minimum: 0
          keys:
            type: array
            items:
              type: string
            description: Sample of deleted keys.
          keysTruncated:
            type: boolean
          reconcile:
            $ref: '#/components/schemas/UsageReconcile'
    UsageReconcile:
      type: object
      required:
      - workspace
      - bytes
      - objects
      - previous
      - changed
      - usage
      properties:
        workspace:
          type: string
        bytes:
          type: integer
          minimum: 0
        objects:
          type: integer
          minimum: 0
        previous:
          type: object
          required:
          - bytes
          - objects
          properties:
            bytes:
              type: integer
            objects:
              type: integer
        changed:
          type: boolean
        unprefixedBucket:
          type: boolean
        usage:
          type: object
          description: Usage after reconciling, in the `Usage` shape minus `scopes`, `plan` and `storage`.
  responses:
    Unauthorized:
      description: Missing or invalid credential.
      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'
  parameters:
    Workspace:
      name: workspace
      in: path
      required: true
      schema:
        type: string
  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