Shardflux Operations API

Lifecycle operations (open, suspend, resume, fork, ...) and their progress.

GitHub OpenAPI

Operations 4

GET /v1/operations/{operation_id} Poll an asynchronous operation #
GET /v1/operations/{operation_id}/progress Read live suspension progress without waking the workspace #
POST /v1/operations/{operation_id}/cancel Cancel suspension preparation before its capture cut #
GET /v1/workspaces/{workspace_id}/operations List a workspace’s operations, newest first #

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/shardflux-dev:shardflux-dev-operations-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

shardflux-dev-operations-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Shardflux Operations API
  version: 0.1.0
  description: 'The public Shardflux HTTP API, as called by the TypeScript and Python SDKs and the CLI. Authenticate every request with a project API key: `Authorization: Bearer sfk__`. Error responses use the ErrorBody schema. Workspace tools (exec, PTY, processes, files, git, browser) are served by the workspace’s cell at `cell_endpoint` with a tool token from POST /v1/workspaces/{workspace_id}/tool-tokens and are not part of this document.'
servers:
- url: https://api.shardflux.dev
  description: Production
tags:
- name: Operations
  description: Lifecycle operations (open, suspend, resume, fork, ...) and their progress.
paths:
  /v1/operations/{operation_id}:
    get:
      operationId: getV1OperationsOperationId
      summary: Poll an asynchronous operation
      tags:
      - Operations
      description: 'Stays readable after its workspace is tombstoned. Bounded wait: with `Prefer: wait=` (at most 20) and an operation that is not terminal, the response is held until its `state` or `state_reason` changes or the wait elapses, then carries the fresh operation and `Preference-Applied: wait=`. Without `Preference-Applied` the server did not wait: poll with backoff.'
      parameters:
      - schema:
          type: string
          format: uuid
        in: path
        name: operation_id
        required: true
        description: UUIDv7, lowercase canonical form.
      - schema:
          type: string
          maxLength: 200
        in: header
        name: prefer
        required: false
        description: RFC 7240 preference, e.g. `wait=20`.
      security:
      - apiKey: []
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                - operation
                properties:
                  operation:
                    $ref: '#/components/schemas/Operation'
                additionalProperties: false
        4XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
        5XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
  /v1/operations/{operation_id}/progress:
    get:
      operationId: getV1OperationsOperationIdProgress
      summary: Read live suspension progress without waking the workspace
      tags:
      - Operations
      parameters:
      - schema:
          type: string
          format: uuid
        in: path
        name: operation_id
        required: true
        description: UUIDv7, lowercase canonical form.
      security:
      - apiKey: []
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                - progress
                properties:
                  progress:
                    $ref: '#/components/schemas/SuspendProgress'
                additionalProperties: false
        4XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
        5XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
  /v1/operations/{operation_id}/cancel:
    post:
      operationId: postV1OperationsOperationIdCancel
      summary: Cancel suspension preparation before its capture cut
      tags:
      - Operations
      description: 'Only a host-acknowledged pre-cut cancellation is accepted. 202 while the owning controller restores the original workspace and opens its tools; poll the same operation until canceled. After the capture cut: 409 suspend_capture_started; wait for the operation and resume. Never resets or replaces the workspace. Supports Idempotency-Key.'
      parameters:
      - schema:
          type: string
          format: uuid
        in: path
        name: operation_id
        required: true
        description: UUIDv7, lowercase canonical form.
      security:
      - apiKey: []
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                - operation
                - progress
                properties:
                  operation:
                    $ref: '#/components/schemas/Operation'
                  progress:
                    $ref: '#/components/schemas/SuspendProgress'
                additionalProperties: false
        '202':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                - operation
                - progress
                properties:
                  operation:
                    $ref: '#/components/schemas/Operation'
                  progress:
                    $ref: '#/components/schemas/SuspendProgress'
                additionalProperties: false
        4XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
        5XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
  /v1/workspaces/{workspace_id}/operations:
    get:
      operationId: getV1WorkspacesWorkspaceIdOperations
      summary: List a workspace’s operations, newest first
      tags:
      - Operations
      parameters:
      - schema:
          type: integer
          minimum: 1
          maximum: 200
          default: 50
        in: query
        name: limit
        required: false
      - schema:
          type: string
          maxLength: 200
        in: query
        name: cursor
        required: false
      - schema:
          type: string
          enum:
          - queued
          - capacity_pending
          - running
          - succeeded
          - failed
          - canceled
        in: query
        name: state
        required: false
      - schema:
          type: string
          enum:
          - open
          - suspend
          - resume
          - fork
          - snapshot
          - restore
          - delete
          - move
          - resize
          - upgrade
          - volume_create
          - volume_attach
          - volume_detach
          - volume_delete
          - reset
          - layer_snapshot
        in: query
        name: kind
        required: false
      - schema:
          type: string
          format: uuid
        in: path
        name: workspace_id
        required: true
        description: UUIDv7, lowercase canonical form.
      security:
      - apiKey: []
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - next_cursor
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Operation'
                  next_cursor:
                    anyOf:
                    - type: string
                    - type: 'null'
                additionalProperties: false
        4XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
        5XX:
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBody'
              examples:
                not_found:
                  $ref: '#/components/examples/not_found'
                rate_limited:
                  $ref: '#/components/examples/rate_limited'
                validation_failed:
                  $ref: '#/components/examples/validation_failed'
components:
  schemas:
    SuspendProgress:
      type: object
      required:
      - operation_id
      - state
      - workspace_state
      - phase
      - cancelable
      - supported
      - safe_action
      properties:
        operation_id:
          type: string
          format: uuid
          description: UUIDv7, lowercase canonical form.
        state:
          type: string
          enum:
          - queued
          - capacity_pending
          - running
          - succeeded
          - failed
          - canceled
        workspace_state:
          type: string
          enum:
          - creating
          - starting
          - running
          - suspending
          - suspended
          - resuming
          - forking
          - stopping
          - failed
          - deleting
          - deleted
        phase:
          type: string
          minLength: 1
          maxLength: 64
          pattern: ^[a-z][a-z0-9_]*$
          description: Actual snapshot preparation/capture phase, or an explicitly unavailable control status.
        cancelable:
          type: boolean
          description: True only while the host can acknowledge cancellation before its capture cut.
        supported:
          type: boolean
        safe_action:
          type: string
          enum:
          - wait_for_terminal
          - resume
          - retry_tools
          - inspect_failure
        phase_started_at:
          type: string
          format: date-time
          description: RFC 3339 UTC timestamp with Z.
        deadline_at:
          type: string
          format: date-time
          description: RFC 3339 UTC timestamp with Z.
        accepted:
          type: boolean
      additionalProperties: false
    ErrorBody:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - code
          - message
          - request_id
          - retryable
          properties:
            code:
              type: string
              enum:
              - bad_request
              - token_invalid
              - unauthenticated
              - invalid_credentials
              - entitlement_required
              - card_required
              - allowance_exhausted
              - quota_exceeded
              - forbidden
              - feature_unavailable
              - mfa_required
              - email_unverified
              - csrf_failed
              - step_up_required
              - not_found
              - conflict
              - stale_epoch
              - payload_too_large
              - unsupported_media_type
              - validation_failed
              - idempotency_mismatch
              - rate_limited
              - internal_error
              - capacity_pending
              - dependency_unavailable
              - authorization_pending
              - slow_down
              - access_denied
              - expired_token
              description: Closed set of error codes (docs/INTEGRATION_CONTRACTS.md).
            message:
              type: string
              description: Safe, human-readable text.
            request_id:
              type: string
            retryable:
              type: boolean
            operation_id:
              type: string
              format: uuid
              description: UUIDv7, lowercase canonical form.
            details:
              type: object
              properties: {}
              additionalProperties: true
              description: 'Operation-specific fields. Block-volume reasons: volume_kind_mismatch, volume_in_use, block_volumes_not_enabled, block_volumes_unsupported_base, block_volumes_schema_unavailable, block_volume_restart_required, block_volume_default_not_supported, not_supported_with_block_volumes, fork_source_volume_unavailable. fork_source_volume_unavailable is non-retryable: a generation captured by the fork source checkpoint is unavailable; choose another checkpoint. volume_in_use includes attachment_id and workspace_id when visible; detaching holders are retryable with retry_after_seconds (1–5). Block quota limits: workspace_disk_gib_max and block_volume_attachments_per_workspace (2).'
          additionalProperties: false
      additionalProperties: false
    Operation:
      type: object
      required:
      - id
      - kind
      - state
      - workspace_id
      - created_at
      - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: UUIDv7, lowercase canonical form.
        kind:
          type: string
          enum:
          - open
          - suspend
          - resume
          - fork
          - snapshot
          - restore
          - delete
          - move
          - resize
          - upgrade
          - volume_create
          - volume_attach
          - volume_detach
          - volume_delete
          - reset
          - layer_snapshot
        state:
          type: string
          enum:
          - queued
          - capacity_pending
          - running
          - succeeded
          - failed
          - canceled
        workspace_id:
          anyOf:
          - type: string
            format: uuid
            description: UUIDv7, lowercase canonical form.
          - type: 'null'
        volume_id:
          anyOf:
          - type: string
            format: uuid
            description: UUIDv7, lowercase canonical form.
          - type: 'null'
        created_at:
          type: string
          format: date-time
          description: RFC 3339 UTC timestamp with Z.
        updated_at:
          type: string
          format: date-time
          description: RFC 3339 UTC timestamp with Z.
        started_at:
          anyOf:
          - type: string
            format: date-time
            description: RFC 3339 UTC timestamp with Z.
          - type: 'null'
          description: 'When the cell started executing the operation: set once, in the transaction that first moves it to `running`, and never changed afterwards (it stays set if the operation later returns to `capacity_pending`, e.g. when a host rejects the start). null while the operation is `queued`, or `capacity_pending` before it ever ran, and on an operation canceled before it started. An operation the cell finishes without running it (e.g. `dependency_failed`) gets started_at = completed_at. created_at to started_at is the time queued; started_at to completed_at the time running.'
        completed_at:
          anyOf:
          - type: string
            format: date-time
            description: RFC 3339 UTC timestamp with Z.
          - type: 'null'
        state_reason:
          anyOf:
          - type: string
            description: 'Closed reason code while waiting (e.g. capacity_pending: no_ready_host).'
          - type: 'null'
        input:
          type: object
          properties: {}
          additionalProperties: true
        error:
          type: object
          properties: {}
          additionalProperties: true
        result:
          type: object
          properties:
            durable:
              type: boolean
              description: 'suspend and fork: whether the capture is in durable storage. false while `durability.state` is pending (the suspend completed on its host) or lost; true once it committed. Absent on other kinds.'
            suspend_path:
              type: string
              description: 'suspend: `local_commit` when the suspend completed on its host and the durable copy followed in the background.'
            durability:
              type: object
              required:
              - state
              properties:
                state:
                  type: string
                  enum:
                  - pending
                  - durable
                  - lost
                  description: 'pending: sealed on its host, the durable copy is being written; durable: the copy committed; lost: the copy could not be made and the previous recovery point stays current.'
                checkpoint_id:
                  type: string
                  description: The checkpoint being made durable.
                generation_id:
                  type: string
                  description: Its generation on the host.
                local_commit_at:
                  type: string
                  description: 'RFC 3339: when the suspend (or fork) completed on its host.'
                durable_by:
                  type: string
                  description: 'RFC 3339: when the durable copy is expected to have committed (local_commit_at + the deadline).'
                durable_at:
                  type: string
                  description: 'RFC 3339 (state durable): when the durable copy committed.'
                local_commit_to_durable_ms:
                  type: number
                  description: 'State durable: local_commit_at to durable_at, in milliseconds.'
                overdue_at:
                  type: string
                  description: 'RFC 3339: set once durable_by passed while the copy was still pending; it keeps retrying.'
                reason:
                  type: string
                  description: 'State lost: why, e.g. host_lost.'
                code:
                  type: string
                  description: 'State lost: the error code of the failed copy.'
                recovery_point_checkpoint_id:
                  anyOf:
                  - type: string
                    description: 'State lost: the durable checkpoint that stays the recovery point (null when there is none).'
                  - type: 'null'
              additionalProperties: true
            lost_suspend:
              type: object
              required:
              - checkpoint_id
              properties:
                checkpoint_id:
                  type: string
                  description: The suspend checkpoint whose durable copy was lost.
                generation_id:
                  type: string
                  description: Its generation on the host.
                reason:
                  type: string
                  description: Why it was lost, e.g. host_lost.
                suspended_at:
                  type: string
                  description: 'RFC 3339: when that suspend captured the workspace.'
                restored_checkpoint_id:
                  type: string
                  description: The earlier durable checkpoint this resume restored.
                state_as_of:
                  type: string
                  description: 'RFC 3339: when the restored checkpoint committed; the workspace state is as of then.'
              additionalProperties: true
            host_lost:
              type: object
              required:
              - detected_at
              properties:
                detected_at:
                  type: string
                  description: 'RFC 3339: when the host failure was detected; the workspace was suspended then.'
                restored_from:
                  type: string
                  enum:
                  - disk
                  - checkpoint
                  description: 'resume and open: disk when the workspace booted from its disk (files kept, processes and memory not); checkpoint when it was restored from its newest checkpoint (see state_as_of). Absent on a suspend.'
                restored_checkpoint_id:
                  type: string
                  description: 'restored_from checkpoint: the checkpoint this resume restored.'
                state_as_of:
                  type: string
                  description: 'restored_from checkpoint, RFC 3339: when that checkpoint committed; the workspace state is as of then.'
              additionalProperties: true
          additionalProperties: true
        progress:
          $ref: '#/components/schemas/SuspendProgress'
      additionalProperties: false
  examples:
    not_found:
      summary: Resource outside the caller’s tenant or nonexistent
      value:
        error:
          code: not_found
          message: Project not found.
          request_id: req-2f1c9a7e44d1
          retryable: false
    rate_limited:
      summary: Durable rate limit exhausted (Retry-After header is also set)
      value:
        error:
          code: rate_limited
          message: Too many requests. Try again later.
          request_id: req-9b0e1d2c3f4a
          retryable: true
          details:
            retry_after_seconds: 42
    validation_failed:
      summary: Request body failed schema validation
      value:
        error:
          code: validation_failed
          message: Request validation failed.
          request_id: req-5a6b7c8d9e0f
          retryable: false
          details:
            issues:
            - path: /body
              message: must have required property 'password'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sfk_<key_id>_<secret>
externalDocs:
  description: Endpoint reference
  url: https://docs.shardflux.dev/reference/http-api/endpoints