Scott Ai agent-loop API

The agent-loop API from Scott Ai — 16 operation(s) for agent-loop.

Operations 20

GET /agent-loop/workspaces List Workspaces #
POST /agent-loop/workspaces Create Workspace #
DELETE /agent-loop/workspaces/{workspace_id} Delete Workspace #
PATCH /agent-loop/workspaces/{workspace_id} Update Workspace #
POST /agent-loop/workspaces/{workspace_id}/turns Create Turn #
PATCH /agent-loop/turns/{turn_id} Update Turn #
GET /agent-loop/workspaces/{workspace_id}/state Get Workspace State #
GET /agent-loop/workspaces/{workspace_id}/events Workspace Event Stream #
POST /agent-loop/workspaces/{workspace_id}/wake Wake Workspace #
GET /agent-loop/workspaces/{workspace_id}/context Get Workspace Context #
POST /agent-loop/workspaces/{workspace_id}/review-chat/turns Create Review Chat Turn #
GET /agent-loop/workspaces/{workspace_id}/review-chat/turns List Review Chat Turns #
GET /agent-loop/workspaces/{workspace_id}/review-chat/context Get Review Chat Context #
PATCH /agent-loop/review-chat/turns/{turn_id} Update Review Chat Turn #
POST /agent-loop/workspaces/{workspace_id}/access-token Mint Access Token #
GET /agent-loop/internal/workspaces/{workspace_id}/connected-sources/{connected_source_id}/retrieval-details Get Connected Source Retrieval Details #
POST /agent-loop/internal/agent-token/redeem Redeem Handoff Code #
POST /agent-loop/internal/sandbox/heartbeat Sandbox Heartbeat #
PUT /agent-loop/workspaces/{workspace_id}/cursor Upsert Cursor #
GET /agent-loop/workspaces/{workspace_id}/cursor Get Cursor #

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/scott-ai-agent-loop-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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

scott-ai-agent-loop-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: One-Shot access Agent Loop API
  version: 1.0.0
servers:
- url: https://api.tryscott.ai
  description: Base URL declared by the provider in apis.yml (roadmap#122).
tags:
- name: agent-loop
paths:
  /agent-loop/workspaces:
    get:
      tags:
      - agent-loop
      summary: List Workspaces
      description: List all workspaces the current user is a member of, ordered by most recent turn activity.
      operationId: list_workspaces
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListWorkspacesResponse'
      security:
      - HTTPBearer: []
    post:
      tags:
      - agent-loop
      summary: Create Workspace
      description: "Create a new workspace OR (for Scott pushes) upsert one keyed on\n`(captured_by_user_id, source_kind, source_id)`.\n\nTwo flows:\n  - No `scott_push`: classic workspace creation. Single transaction.\n  - With `scott_push`: idempotent. Same (user, source_kind, source_id)\n    returns the same planspace. Push artifact metadata is replaced in\n    place; scott_push turns are APPENDED past the existing chain tip\n    (never deleted). Non-scott_push turns the user added in the Scott\n    UI are never touched — they stay parented where the user put them\n    and become branches at the prior tip after the next push."
      operationId: create_workspace
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateWorkspaceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
  /agent-loop/workspaces/{workspace_id}:
    delete:
      tags:
      - agent-loop
      summary: Delete Workspace
      description: Delete workspace and all its turns (cascade).
      operationId: delete_workspace
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Delete Workspace
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - agent-loop
      summary: Update Workspace
      description: Update workspace settings.
      operationId: update_workspace
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateWorkspaceRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Update Workspace
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/turns:
    post:
      tags:
      - agent-loop
      summary: Create Turn
      description: 'Write-ahead: create a pending turn before agent starts running.'
      operationId: create_turn
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTurnRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTurnResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/turns/{turn_id}:
    patch:
      tags:
      - agent-loop
      summary: Update Turn
      description: 'Single completion call — updates turn with all results at once.


        Dual-auth (see ``require_turn_access``): a per-turn agent-svc JWT bound to

        this ``turn_id`` is the agent-service path; Stytch session is the user

        path. Both routes resolve to ``actor.user_id`` for cursor advances and

        downstream attribution.'
      operationId: update_turn
      parameters:
      - name: turn_id
        in: path
        required: true
        schema:
          type: string
          title: Turn Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTurnRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Update Turn
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/state:
    get:
      tags:
      - agent-loop
      summary: Get Workspace State
      description: 'Single call: all turns with DAG annotations + cursor position.

        Anonymous access allowed for public workspaces (cursor/member tracking skipped).

        Pure read — no E2B calls. Frontend calls /wake separately to ensure the sandbox is running.'
      operationId: get_workspace_state
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceStateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/events:
    get:
      tags:
      - agent-loop
      summary: Workspace Event Stream
      description: 'SSE stream of state-change events for workspace members.


        Strict-membership only: the agent-service shared-secret principal is

        rejected so the bypass in ``assert_workspace_access`` can''t be reused

        to subscribe to arbitrary workspaces.'
      operationId: workspace_event_stream
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      - name: token
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/wake:
    post:
      tags:
      - agent-loop
      summary: Wake Workspace
      description: 'Ensure the sandbox is running. Returns its current URL.


        For Electron workspaces returns ''electron'' immediately (no E2B calls).

        For E2B workspaces: health-checks the shared sandbox and recreates it if unhealthy.'
      operationId: wake_workspace
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WakeWorkspaceResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/context:
    get:
      tags:
      - agent-loop
      summary: Get Workspace Context
      description: Walk parent_id chain and optionally bind the response to one document node.
      operationId: get_workspace_context
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      - name: from_turn_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: From Turn Id
      - name: snapshot_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Snapshot Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkspaceSnapshotResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/review-chat/turns:
    post:
      tags:
      - agent-loop
      summary: Create Review Chat Turn
      description: 'Open or extend the caller''s private review-chat thread on a snapshot.


        Renderer-facing (workspace membership gates the call; the thread is the

        caller''s own). Writes a pending review_chat_turns row, then mints a handoff

        JWT carrying caps=[''review-chat-turn''] plus the snapshot_id claim that flips

        agent-service into the read-only review sandbox. The claim — never a body

        flag — is the source of truth for the turn kind. Returns the handoff code

        the renderer forwards to agent-service.'
      operationId: create_review_chat_turn
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReviewChatTurnRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateReviewChatTurnResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - agent-loop
      summary: List Review Chat Turns
      description: 'List the caller''s private review-chat thread on a snapshot (renderer-facing).


        Workspace membership gates the call; the thread is scoped to the

        authenticated reviewer, so one reviewer never sees another''s thread and the

        contributor sees none. Turns come back oldest-first so the Chat tab repaints

        the conversation on reload and chains the next message onto the last. The

        agent-facing context GET is the wrong surface here: it needs the review-chat

        JWT the renderer never holds and rebuilds one focal turn''s ancestry, not the

        whole thread.'
      operationId: list_review_chat_turns
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      - name: snapshot_id
        in: query
        required: true
        schema:
          type: string
          title: Snapshot Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewChatThreadResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/review-chat/context:
    get:
      tags:
      - agent-loop
      summary: Get Review Chat Context
      description: 'Snapshot-scoped context for an agent-service review-chat turn.


        Agent-service-facing (caps=[''review-chat-turn'']). The JWT''s snapshot_id and

        user_id (the reviewer) scope the entire response; request inputs cannot

        widen it. Returns the one snapshot''s content, workspace identity + connected

        sources, comments on that snapshot only, and this private thread''s ancestry.

        Deliberately never touches the workspace /context walk.'
      operationId: get_review_chat_context
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      - name: from_turn_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: From Turn Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewChatContextResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/review-chat/turns/{turn_id}:
    patch:
      tags:
      - agent-loop
      summary: Update Review Chat Turn
      description: 'Persist agent output onto a review-chat turn (agent-service-facing).


        The JWT is bound to this ``turn_id`` (caps=[''review-chat-turn'']); the

        service cross-checks workspace + reviewer ownership before writing. Same

        body shape as the contributor PATCH /turns/{id}. No cursor advance — review

        chat is off the DAG.'
      operationId: update_review_chat_turn
      parameters:
      - name: turn_id
        in: path
        required: true
        schema:
          type: string
          title: Turn Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTurnRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Update Review Chat Turn
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/access-token:
    post:
      tags:
      - agent-loop
      summary: Mint Access Token
      description: Issue a short-lived JWT for direct frontend → agent-service communication.
      operationId: mint_access_token
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessTokenResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/internal/workspaces/{workspace_id}/connected-sources/{connected_source_id}/retrieval-details:
    get:
      tags:
      - agent-loop
      summary: Get Connected Source Retrieval Details
      description: Per-turn agent-svc JWT (``turn-write`` OR ``review-chat-turn`` cap, ``workspace_id`` claim matches path).
      operationId: get_connected_source_retrieval_details
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      - name: connected_source_id
        in: path
        required: true
        schema:
          type: string
          title: Connected Source Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetrievalResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/internal/agent-token/redeem:
    post:
      tags:
      - agent-loop
      summary: Redeem Handoff Code
      operationId: redeem_handoff_code
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RedeemHandoffRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RedeemHandoffResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/internal/sandbox/heartbeat:
    post:
      tags:
      - agent-loop
      summary: Sandbox Heartbeat
      operationId: sandbox_heartbeat
      parameters:
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Sandbox Heartbeat
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /agent-loop/workspaces/{workspace_id}/cursor:
    put:
      tags:
      - agent-loop
      summary: Upsert Cursor
      description: Upsert workspace cursor — tracks where this user is in the Turn DAG.
      operationId: upsert_cursor
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertCursorRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    get:
      tags:
      - agent-loop
      summary: Get Cursor
      description: Get current cursor position for this user in the workspace.
      operationId: get_cursor
      security:
      - HTTPBearer: []
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          title: Workspace Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CursorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    GitHubSourceSelection:
      properties:
        repo:
          type: string
          title: Repo
        branch:
          type: string
          title: Branch
      type: object
      required:
      - repo
      - branch
      title: GitHubSourceSelection
      description: User's selection when connecting a GitHub source
    UploadedFileSourceSelection:
      properties:
        file_id:
          type: string
          title: File Id
        visibility:
          $ref: '#/components/schemas/SourceVisibility'
          default: private
      type: object
      required:
      - file_id
      title: UploadedFileSourceSelection
      description: User's selection when connecting an uploaded file source
    WorkspaceStateResponse:
      properties:
        turns:
          items:
            $ref: '#/components/schemas/TurnSummary'
          type: array
          title: Turns
        artifacts:
          items:
            $ref: '#/components/schemas/ArtifactSummary'
          type: array
          title: Artifacts
          default: []
        snapshot_nodes:
          items:
            $ref: '#/components/schemas/SnapshotNode'
          type: array
          title: Snapshot Nodes
          default: []
        commit_references:
          items:
            $ref: '#/components/schemas/CommitReferenceSummary'
          type: array
          title: Commit References
          default: []
        current_turn_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Current Turn Id
        current_snapshot_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Current Snapshot Id
        member_cursors:
          items:
            $ref: '#/components/schemas/MemberCursor'
          type: array
          title: Member Cursors
          default: []
        is_public:
          type: boolean
          title: Is Public
          default: false
        sandbox_url:
          anyOf:
          - type: string
          - type: 'null'
          title: Sandbox Url
        review_status:
          type: string
          title: Review Status
          default: draft
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
      type: object
      required:
      - turns
      - current_turn_id
      title: WorkspaceStateResponse
      description: Single call gives the renderer everything needed to paint the workspace page.
    ReviewChatThreadTurn:
      properties:
        id:
          type: string
          title: Id
        parent_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Id
        status:
          type: string
          title: Status
        user_message:
          anyOf:
          - type: string
          - type: 'null'
          title: User Message
        assistant_text:
          anyOf:
          - type: string
          - type: 'null'
          title: Assistant Text
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
      - id
      - parent_id
      - status
      - user_message
      - assistant_text
      - created_at
      title: ReviewChatThreadTurn
      description: 'One persisted review-chat turn for renderer rehydration. Mirrors the

        contributor TurnSummary fields the Chat tab paints: the reviewer''s message

        and the final assistant_text (history renders from the string, not blocks).'
    ReviewChatThreadResponse:
      properties:
        turns:
          items:
            $ref: '#/components/schemas/ReviewChatThreadTurn'
          type: array
          title: Turns
      type: object
      required:
      - turns
      title: ReviewChatThreadResponse
      description: 'The caller''s full private review-chat thread on one snapshot, oldest

        first. Scoped to (workspace, snapshot, reviewer); another reviewer''s thread

        is never included.'
    CanonicalMessageSpec:
      properties:
        role:
          type: string
          enum:
          - user
          - assistant
          title: Role
        content:
          type: string
          maxLength: 200000
          title: Content
        fidelity:
          anyOf:
          - type: string
            enum:
            - verbatim
            - paraphrased
            - summarized
          - type: 'null'
          title: Fidelity
        reconstructed:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Reconstructed
      additionalProperties: false
      type: object
      required:
      - role
      - content
      title: CanonicalMessageSpec
      description: One message in the verbatim conversation transcript.
    SubagentSummary:
      properties:
        agentId:
          type: string
          title: Agentid
        agentType:
          type: string
          title: Agenttype
        parentPromptKey:
          anyOf:
          - type: string
          - type: 'null'
          title: Parentpromptkey
        span:
          $ref: '#/components/schemas/SessionSpan'
        apiCalls:
          type: integer
          title: Apicalls
        usage:
          $ref: '#/components/schemas/TokenUsage'
      additionalProperties: false
      type: object
      required:
      - agentId
      - agentType
      - span
      - apiCalls
      - usage
      title: SubagentSummary
    Turn:
      properties:
        id:
          type: string
          title: Id
        workspace_id:
          type: string
          title: Workspace Id
        parent_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Parent Id
        status:
          type: string
          title: Status
        is_from_scott_push:
          type: boolean
          title: Is From Scott Push
          default: false
        user_message:
          anyOf:
          - type: string
          - type: 'null'
          title: User Message
        assistant_text:
          anyOf:
          - type: string
          - type: 'null'
          title: Assistant Text
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
        created_at:
          type: string
          format: date-time
          title: Created At
        completed_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Completed At
        user_id:
          anyOf:
          - type: string
          - type: 'null'
          title: User Id
        user_display_name:
          anyOf:
          - type: string
          - type: 'null'
          title: User Display Name
        tool_calls:
          anyOf:
          - {}
          - type: 'null'
          title: Tool Calls
        message_deltas:
          anyOf:
          - {}
          - type: 'null'
          title: Message Deltas
        usage:
          anyOf:
          - {}
          - type: 'null'
          title: Usage
      type: object
      required:
      - id
      - workspace_id
      - parent_id
      - status
      - user_message
      - assistant_text
      - created_at
      - completed_at
      title: Turn
      description: 'Agent-service turn shape (GET /context). Includes LLM internals

        so the agent can rebuild context across the parent_id chain.'
    FileRetrievalDetails:
      properties:
        kind:
          $ref: '#/components/schemas/RetrievalKind'
          default: file
        download_url:
          type: string
          title: Download Url
        filename:
          type: string
          title: Filename
        content_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Content Type
        size_bytes:
          anyOf:
          - type: integer
          - type: 'null'
          title: Size Bytes
      type: object
      required:
      - download_url
      - filename
      title: FileRetrievalDetails
      description: Details for retrieving source via file download
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SessionSpan:
      properties:
        firstTs:
          type: string
          title: Firstts
        lastTs:
          type: string
          title: Lastts
        wallClockMs:
          type: integer
          title: Wallclockms
        activeMs:
          type: integer
          title: Activems
      additionalProperties: false
      type: object
      required:
      - firstTs
      - lastTs
      - wallClockMs
      - activeMs
      title: SessionSpan
    ConnectedSourceSelection:
      properties:
        adapter:
          $ref: '#/components/schemas/AdapterType'
        selection:
          anyOf:
          - $ref: '#/components/schemas/GitHubSourceSelection'
          - $ref: '#/components/schemas/SlackSourceSelection'
          - $ref: '#/components/schemas/UploadedFileSourceSelection'
          title: Selection
      type: object
      required:
      - adapter
      - selection
      title: ConnectedSourceSelection
    ArtifactSummary:
      properties:
        id:
          type: string
          title: Id
        workspace_id:
          type: string
          title: Workspace Id
        name:
          anyOf:
          - type: string
          - type: 'null'
          title: Name
        produced_at_turn_id:
          type: string
          title: Produced At Turn Id
        created_at:
          type: string
          format: date-time
          title: Created At
        content:
          $ref: '#/components/schemas/ArtifactContent'
        diff:
          anyOf:
          - items:
              $ref: '#/components/schemas/ChangeEntry'
            type: array
          - type: 'null'
          title: Diff
      type: object
      required:
      - id
      - workspace_id
      - produced_at_turn_id
   

# --- truncated at 32 KB (70 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/scott-ai/refs/heads/main/openapi/scott-ai-agent-loop-api-openapi.yml