> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erdo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateWorkstreamAPI mirrors erdo_create_workstream.




## OpenAPI

````yaml /api/openapi.json post /v1/workstreams
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, and experiments. Authenticate with
    a Bearer API key (erdo_api_...) or scoped token (erdo_token_...).
  version: '2026-07-25'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/workstreams:
    post:
      summary: |
        CreateWorkstreamAPI mirrors erdo_create_workstream.
      operationId: POST:mcp.CreateWorkstreamAPI
      requestBody:
        content:
          application/json:
            schema:
              properties:
                description:
                  type: string
                phases:
                  items:
                    $ref: '#/components/schemas/mcp.WorkstreamPhaseInput'
                  type: array
                project_slug:
                  type: string
                slug:
                  type: string
                title:
                  type: string
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  events:
                    description: >
                      (newest first), embedded so cards/agents see activity
                      without a second call.
                    items:
                      $ref: '#/components/schemas/types.WorkstreamEvent'
                    title: >
                      Events is the most recent slice of the workstream's
                      chronological log
                    type: array
                  following:
                    description: >
                      detail page can render its follow toggle without a second
                      call (Wave E).
                    title: >
                      Following is whether the requesting user follows this
                      workstream, so the
                    type: boolean
                  phases:
                    items:
                      $ref: '#/components/schemas/types.WorkstreamPhase'
                    type: array
                  resources:
                    items:
                      $ref: '#/components/schemas/types.WorkstreamResource'
                    type: array
                  workstream:
                    $ref: '#/components/schemas/types.Workstream'
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    mcp.WorkstreamPhaseInput:
      properties:
        skill_slug:
          type: string
        slug:
          type: string
        title:
          type: string
      type: object
    types.WorkstreamEvent:
      description: >
        — a git-log-style record of what happened and what's next. Body is
        free-form; actor\_type/actor\_id is attribution (identity, not routing).
      properties:
        actor_id:
          format: uuid
          type: string
        actor_type:
          type: string
        body:
          type: string
        created_at:
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        organization_id:
          format: uuid
          type: string
        workstream_id:
          format: uuid
          type: string
      title: >
        WorkstreamEvent is one entry in a workstream's append-only,
        chronological log
      type: object
    types.WorkstreamPhase:
      properties:
        completed_at:
          format: date-time
          type: string
        created_at:
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        skill_slug:
          type: string
        slug:
          type: string
        sort_order:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        started_at:
          format: date-time
          type: string
        status:
          type: string
        thread_id:
          format: uuid
          type: string
        title:
          type: string
        updated_at:
          format: date-time
          type: string
        workstream_id:
          format: uuid
          type: string
      title: |
        WorkstreamPhase is an ordered step within a workstream.
      type: object
    types.WorkstreamResource:
      properties:
        created_at:
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        phase_id:
          format: uuid
          type: string
        relationship_type:
          type: string
        resource_id:
          format: uuid
          type: string
        resource_type:
          type: string
        title:
          type: string
        workstream_id:
          format: uuid
          type: string
      title: >
        WorkstreamResource is a typed link from a workstream to another domain
        object.
      type: object
    types.Workstream:
      description: >
        Operational state machine for multi-step work (campaign launches,
        reports, monitors).
      properties:
        autonomy_mode:
          description: >
            (autopilot|propose|strict); nil inherits the org-level setting. The
            engine gate resolves effective mode = workstream ?? org ?? propose.
          title: |
            AutonomyMode is this workstream's autonomy override
          type: string
        completed_at:
          format: date-time
          type: string
        created_at:
          format: date-time
          type: string
        description:
          type: string
        escalation_budget_per_day:
          format: int32
          maximum: 2147483647
          minimum: -2147483648
          type: integer
        id:
          format: uuid
          type: string
        organization_id:
          format: uuid
          type: string
        primary_thread_id:
          format: uuid
          type: string
        project_id:
          format: uuid
          type: string
        slug:
          type: string
        source_template_id:
          format: uuid
          type: string
        spent_millicents:
          format: int64
          type: integer
        started_at:
          format: date-time
          type: string
        status:
          type: string
        title:
          type: string
        token_budget_millicents:
          description: >
            ceiling (nil = unlimited); SpentMillicents is the running total
            accrued from completed engine work; EscalationBudgetPerDay caps
            urgent items per rolling 24h (nil = org default). Millicents =
            tenths of a cent.
          format: int64
          title: |
            Budget envelope (work-engine D6). TokenBudgetMillicents is the spend
          type: integer
        updated_at:
          format: date-time
          type: string
      title: |
        Workstream represents a piece of business work in motion.
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````