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

# Start a Role, Call, or Critic run

> Starts a Role, Call, or Critic draft from pasted plain text (links and uploaded files stay on the web studio). Supports idempotency via Idempotency-Key.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/runs
openapi: 3.1.0
info:
  title: Enablement Studio API
  version: 1.0.0
  description: >-
    REST API v1 for Enablement Studio: inspect projects and kits, draft
    Role/Call/Critic runs, consult kit specialists, run deterministic
    learning-science audits, and publish SCORM/learner links.
  contact:
    name: Enablement Studio Support
    email: login@enablementstudio.app
    url: https://enablementstudio.ai/contact
servers:
  - url: https://enablementstudio.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Discovery
    description: Server metadata, signed-in account status, and public examples.
  - name: Library
    description: Read projects, kits, full kit documents, and deliverable exports.
  - name: Runs
    description: Start asynchronous Role, Call, and Critic drafts and poll status.
  - name: Specialists
    description: Read and message specialist agents; edits wait in Kit Review.
  - name: Learning Science
    description: Deterministic Mager, Bloom, Haladyna, and cognitive-load checks.
  - name: Delivery & Practice
    description: Online lessons, SCORM 1.2 exports, learner practice links, and results.
paths:
  /api/v1/runs:
    post:
      tags:
        - Runs
      summary: Start a Role, Call, or Critic run
      description: >-
        Starts a Role, Call, or Critic draft from pasted plain text (links and
        uploaded files stay on the web studio). Supports idempotency via
        Idempotency-Key.
      operationId: createRun
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            pattern: ^[A-Za-z0-9._:-]{1,128}$
          description: >-
            Optional key (1–128 chars) so retries return the existing run
            instead of drafting twice.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunStartRequest'
            example:
              product: role
              text: >-
                Account Executive onboarding: discovery qualification before
                pricing.
      responses:
        '200':
          description: Idempotent replay matching an existing run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResponse'
              example:
                run:
                  id: run-0f3a9c2b7d104e6a8b5c1d2e
                  product: role
                  status: running
                  stage:
                    id: read
                    label: Reading your source
                    steps:
                      - read
                      - design
                      - checks
                      - repair
                      - save
                  engine: ai
                  offline_reason: null
                  kit_id: null
                  kit_url: null
                  poll: /api/v1/runs/run-0f3a9c2b7d104e6a8b5c1d2e
                  poll_after: 3
                  created_at: 1700000000
        '201':
          description: Kit drafted immediately using Studio rules.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResponse'
              example:
                run:
                  id: run-0f3a9c2b7d104e6a8b5c1d2e
                  product: role
                  status: done
                  stage: null
                  engine: ai
                  offline_reason: null
                  kit_id: 12
                  kit_url: https://enablementstudio.ai/kit?run=12
                  poll: /api/v1/runs/run-0f3a9c2b7d104e6a8b5c1d2e
                  poll_after: null
                  created_at: 1700000000
        '202':
          description: Draft queued as a background workflow.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunResponse'
              example:
                run:
                  id: run-0f3a9c2b7d104e6a8b5c1d2e
                  product: role
                  status: running
                  stage:
                    id: read
                    label: Reading your source
                    steps:
                      - read
                      - design
                      - checks
                      - repair
                      - save
                  engine: ai
                  offline_reason: null
                  kit_id: null
                  kit_url: null
                  poll: /api/v1/runs/run-0f3a9c2b7d104e6a8b5c1d2e
                  poll_after: 3
                  created_at: 1700000000
        '400':
          description: Invalid product, empty/oversized paste, or links-only input.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: text_only
                  message: >-
                    Paste the words themselves. Links and files are read on the
                    web, not here yet.
        '401':
          description: Missing, expired, or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: signed_out
                  message: Sign in to continue.
        '403':
          description: >-
            Connector disabled, Pro API key entitlement required (pro_required),
            route forbidden (connector_forbidden or api_key_forbidden), or
            consent missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: connector_forbidden
                  message: >-
                    An AI app cannot do that. Open Enablement Studio on the web
                    to do it.
        '409':
          description: Idempotency-Key reused with a different payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: idempotency_conflict
                  message: >-
                    That Idempotency-Key was used for a different run. Use a new
                    key for a new run.
        '422':
          description: Door could not start or confirm the run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: could_not_start
                  message: >-
                    The run could not start. Nothing was drafted. Try again, or
                    start it on the web.
        '429':
          description: Hourly or daily run limit reached.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error:
                  code: rate_limited
                  message: >-
                    This account has started its runs for now (10 an hour, or 30
                    a day). Kits already made keep working.
components:
  schemas:
    RunStartRequest:
      type: object
      required:
        - product
        - text
      properties:
        product:
          type: string
          enum:
            - role
            - call
            - critic
        text:
          type: string
          minLength: 1
          maxLength: 200000
    RunResponse:
      type: object
      required:
        - run
      properties:
        run:
          type: object
          required:
            - id
            - product
            - status
            - stage
            - engine
            - offline_reason
            - kit_id
            - kit_url
            - poll
            - poll_after
            - created_at
          properties:
            id:
              type: string
              pattern: run-[0-9a-f]{24}
            product:
              type: string
              enum:
                - role
                - call
                - critic
            status:
              type: string
              enum:
                - running
                - done
                - failed
            stage:
              type:
                - object
                - 'null'
            engine:
              type: string
              enum:
                - ai
                - offline
            offline_reason:
              type:
                - string
                - 'null'
              enum:
                - allowance_spent
                - studio_paused
                - connector_paused
                - null
            kit_id:
              type:
                - integer
                - 'null'
            kit_url:
              type:
                - string
                - 'null'
            poll:
              type: string
            poll_after:
              type:
                - integer
                - 'null'
            error:
              type: string
            created_at:
              type: integer
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token from OAuth 2.1 MCP sign-in, native app sign-in, or a Pro
        developer API key (`es_live_...`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.