The San Francisco Compute Company Workspaces API

Resource containers scoped to an account.

Documentation

Specifications

Other Resources

OpenAPI Specification

the-san-francisco-compute-company-workspaces-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: sfc-api Account Workspaces API
  description: Public preview API - subject to change. See https://docs.sfcompute.com/preview/roadmap for details.
  version: 0.1.0
  x-apievangelist:
    method: searched
    generated: '2026-07-21'
    source: Reconstructed from per-operation OpenAPI blocks published on https://docs.sfcompute.com/preview/api-reference/* (Mintlify). 65 pages merged; paths + components unioned verbatim.
    note: Public preview API (subject to change). Base path /preview/v2 under server https://api.sfcompute.com.
servers:
- url: https://api.sfcompute.com
security:
- bearer_auth: []
tags:
- name: Workspaces
  description: Resource containers scoped to an account.
paths:
  /preview/v2/workspaces:
    post:
      tags:
      - Workspaces
      summary: Create workspace
      description: '> ⚠️ This endpoint is in [public preview](/preview/roadmap).


        Create a workspace.'
      operationId: create_workspace_handler
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceRequest'
        required: true
      responses:
        '201':
          description: Workspace created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
    get:
      tags:
      - Workspaces
      summary: List workspaces
      description: '> ⚠️ This endpoint is in [public preview](/preview/roadmap).


        List all workspaces for the authenticated account.'
      operationId: list_workspaces_handler
      parameters:
      - name: id
        in: query
        description: Filter by workspace ID, resource path, or name (repeatable).
        required: false
        schema:
          type: array
          items:
            $ref: '#/components/schemas/ResourcePathOrId_WorkspaceId'
        style: form
        explode: true
      responses:
        '200':
          description: List of workspaces.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWorkspacesResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
  /preview/v2/workspaces/{workspace}:
    delete:
      tags:
      - Workspaces
      summary: Delete workspace
      description: '> ⚠️ This endpoint is in [public preview](/preview/roadmap).


        Soft-delete a workspace by name or ID. Workspace must be empty (no capacities, instance templates, or images).'
      operationId: delete_workspace_handler
      parameters:
      - name: workspace
        in: path
        description: Workspace name or ID
        required: true
        schema:
          type: string
          description: A resource path like 'sfc:workspace:acme:my-workspace' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
          examples:
          - wksp_k3R-nX9vLm7Qp2Yw5Jd8F
          pattern: (wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,1})
      responses:
        '204':
          description: Workspace deleted.
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Workspace not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '422':
          description: Workspace is not empty.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
    get:
      tags:
      - Workspaces
      summary: Get workspace
      description: '> ⚠️ This endpoint is in [public preview](/preview/roadmap).


        Retrieve a workspace by name or ID.'
      operationId: get_workspace_handler
      parameters:
      - name: workspace
        in: path
        description: Workspace name or ID
        required: true
        schema:
          type: string
          description: A resource path like 'sfc:workspace:acme:my-workspace' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
          examples:
          - wksp_k3R-nX9vLm7Qp2Yw5Jd8F
          pattern: (wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,1})
      responses:
        '200':
          description: Workspace details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Workspace not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
    patch:
      tags:
      - Workspaces
      summary: Update workspace
      description: '> ⚠️ This endpoint is in [public preview](/preview/roadmap).


        Rename a workspace.'
      operationId: patch_workspace_handler
      parameters:
      - name: workspace
        in: path
        description: Workspace name or ID
        required: true
        schema:
          type: string
          description: A resource path like 'sfc:workspace:acme:my-workspace' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
          examples:
          - wksp_k3R-nX9vLm7Qp2Yw5Jd8F
          pattern: (wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,1})
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchWorkspaceRequest'
        required: true
      responses:
        '200':
          description: Workspace updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: Workspace not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    WorkspaceId:
      type: string
      examples:
      - wksp_k3R-nX9vLm7Qp2Yw5Jd8F
      pattern: wksp_[0-9a-zA-Z_-]{1,21}
    ForbiddenError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          properties:
            type:
              type: string
              const: forbidden
              default: forbidden
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    BadRequestError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          properties:
            type:
              type: string
              const: invalid_request_error
              default: invalid_request_error
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
            details:
              type: array
              items:
                $ref: '#/components/schemas/ErrorDetail'
    WorkspaceScope:
      type: object
      required:
      - id
      - resource_path
      - owner
      - name
      properties:
        id:
          $ref: '#/components/schemas/WorkspaceId'
        resource_path:
          $ref: '#/components/schemas/workspaceResourcePath_WorkspaceId'
        owner:
          $ref: '#/components/schemas/Name'
        name:
          $ref: '#/components/schemas/Name'
    ListWorkspacesResponse:
      type: object
      required:
      - object
      - data
      - has_more
      properties:
        object:
          type: string
          const: list
          default: list
          readOnly: true
        data:
          type: array
          items:
            $ref: '#/components/schemas/WorkspaceResponse'
        has_more:
          type: boolean
    InternalServerError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          properties:
            type:
              type: string
              const: api_error
              default: api_error
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    NotFoundError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          properties:
            type:
              type: string
              const: not_found
              default: not_found
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    Name:
      type: string
      examples:
      - my-resource-name
      maxLength: 255
      minLength: 1
      pattern: '[a-zA-Z0-9][a-zA-Z0-9._-]{0,254}'
    UnprocessableEntityError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          properties:
            type:
              type: string
              const: unprocessable_entity
              default: unprocessable_entity
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
            details:
              type: array
              items:
                $ref: '#/components/schemas/ErrorDetail'
    CreateWorkspaceRequest:
      type: object
      properties:
        name:
          oneOf:
          - type: 'null'
          - $ref: '#/components/schemas/Name'
    ResourcePathOrId_WorkspaceId:
      type: string
      description: A resource path like 'sfc:workspace:acme:my-workspace' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
      examples:
      - wksp_k3R-nX9vLm7Qp2Yw5Jd8F
      pattern: (wksp_[0-9a-zA-Z_-]{1,21})|(sfc:workspace:[a-zA-Z0-9._-]+(:[a-zA-Z0-9._-]+){1,1})
    UnixEpoch:
      type: integer
      format: int64
      description: Unix timestamp.
      example: 1738972800
    UnauthorizedError:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - type
          - message
          properties:
            type:
              type: string
              const: authentication_error
              default: authentication_error
              readOnly: true
            message:
              type: string
              x-speakeasy-error-message: true
    ErrorDetail:
      type: object
      required:
      - code
      - message
      properties:
        field:
          type:
          - string
          - 'null'
          description: The field that caused the error (for validation errors)
        code:
          type: string
          description: Specific error code for this detail
        message:
          type: string
          description: Human-readable error message
    PatchWorkspaceRequest:
      type: object
      properties:
        name:
          type:
          - string
          - 'null'
    WorkspaceResponse:
      allOf:
      - $ref: '#/components/schemas/WorkspaceScope'
      - type: object
        required:
        - object
        - created_at
        properties:
          object:
            type: string
            const: workspace
            default: workspace
            readOnly: true
          created_at:
            $ref: '#/components/schemas/UnixEpoch'
    workspaceResourcePath_WorkspaceId:
      type: string
      description: 'A resource path for a workspace resource. Format: sfc:workspace:<account>:<name>.'
      examples:
      - sfc:workspace:<account_id>:<name>
      pattern: sfc:workspace:([a-zA-Z0-9._-]+:){1}[a-zA-Z0-9._-]+
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Create an API token using `sf tokens create` or at https://sfcompute.com/account/api-keys.