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

# Create a staged legacy scaffold batch

> Machine-only staged contract for initiative/workstream/milestone/task nodes in one admitted workspace. Every child names its full hierarchy through explicit IDs or batch refs; implicit backlog generation is excluded before writes. Goal/objective references must be arrays. Rich node fields pass through the existing entity handler. The 4 MiB JSON body limit is enforced before execution. Results may be partial; do not replay a failed or uncertain write or fall back to another create endpoint. Existing entity guards, per-node credential admission and gateway token expiration still apply. Dedicated scaffold launch/mirror follow-ups remain at the existing client edge. Existing entity-write side effects are retained; this route does not grant action authority. Generic entity types, session credentials and parent context types outside the supported hierarchy/project/objective/goal set require the existing client path until a separately verified migration.



## OpenAPI

````yaml /openapi/v1.yaml post /workflows/legacy-scaffold-batch
openapi: 3.1.0
info:
  title: OrgX REST API v1
  version: '1'
  description: >-
    Build accountable work into your product with OrgX REST API v1.


    Create work with one field, attach evidence when it is complete, and keep
    the receipt. Every authenticated request is scoped to the workspace resolved
    from your credential.


    Start with `POST /work`. Human guide:
    https://docs.useorgx.com/docs/api/quickstart
  contact:
    name: OrgX Support
    url: https://useorgx.com/support
    email: support@useorgx.com
  license:
    name: Proprietary
    url: https://useorgx.com/terms
servers:
  - url: https://useorgx.com/api/v1
    description: Production
security: []
tags:
  - name: Work
    description: Create accountable work and complete it with evidence
  - name: Initiatives
    description: Organize related work around an outcome
  - name: Operating processes
    description: Evidence-backed company workflow/process lifecycle
  - name: Operating map
    description: Derived, rebuildable Operating Map projection over the process ledger
  - name: Discovery runs
    description: Wizard and deep-search workflow discovery over connected company sources
  - name: Handoffs
    description: Ledger-backed stage handoffs between operating-process stages
  - name: Events
    description: Replayable, workspace-scoped accepted ledger events
  - name: Projections
    description: Workspace-scoped, rebuildable read projections over OrgX sources
  - name: Episodes
    description: Mission-compatible Episode read adapters
  - name: Receipt validation
    description: Account-free Agent Work Receipt schema discovery and conformance
  - name: Receipt import
    description: Authenticated, workspace-scoped import into the hosted receipt ledger
  - name: Workload diagnosis
    description: >-
      Account-free evaluation of time, agents, systems, authority, and
      accountability boundaries
  - name: Content Studio
    description: >-
      Estimate, showcase, checkout, and payment event operations for Content
      Studio
  - name: Decisions
    description: Raise decisions for human ruling and read their state
  - name: Controllers
    description: Shadow-only domain controller status and reconciliation
  - name: Artifacts
    description: Register produced work against the entity it belongs to
  - name: Launches
    description: Preview and run an initiative launch through its spend gates
  - name: Runs
    description: Control agent runs with pause, resume, cancel, and rollback
  - name: Lifecycle
    description: Pause, resume, retry, or cancel work hierarchy nodes and runs
  - name: Deduplication
    description: Claim durable event fingerprints so duplicate triggers fire once
  - name: Credential
    description: >-
      Resolve the calling credential, the workspaces it reaches, and what it may
      do
  - name: API discovery
    description: Account-free error codes, request schemas, and closed vocabularies for v1
externalDocs:
  description: Human-readable OrgX REST API v1 reference
  url: https://docs.useorgx.com/docs/api/public-api
paths:
  /workflows/legacy-scaffold-batch:
    post:
      tags:
        - Initiatives
      summary: Create a staged legacy scaffold batch
      description: >-
        Machine-only staged contract for initiative/workstream/milestone/task
        nodes in one admitted workspace. Every child names its full hierarchy
        through explicit IDs or batch refs; implicit backlog generation is
        excluded before writes. Goal/objective references must be arrays. Rich
        node fields pass through the existing entity handler. The 4 MiB JSON
        body limit is enforced before execution. Results may be partial; do not
        replay a failed or uncertain write or fall back to another create
        endpoint. Existing entity guards, per-node credential admission and
        gateway token expiration still apply. Dedicated scaffold launch/mirror
        follow-ups remain at the existing client edge. Existing entity-write
        side effects are retained; this route does not grant action authority.
        Generic entity types, session credentials and parent context types
        outside the supported hierarchy/project/objective/goal set require the
        existing client path until a separately verified migration.
      operationId: createLegacyScaffoldBatch
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 200
            pattern: ^[A-Za-z0-9][A-Za-z0-9._:/-]{0,199}$
          description: >-
            Optional header accepted for forward compatibility. This staged
            batch does not use the header to claim, cache or deduplicate
            execution; the same header does not make resending safe. Reconcile
            partial or uncertain results before considering further writes.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LegacyEntityBatchRequest'
            example:
              version: legacy_entity_batch_v1
              workspace_id: 33333333-3333-4333-8333-333333333333
              entities:
                - type: initiative
                  title: Prepare release documentation
                  ref: release
      responses:
        '200':
          description: Indexed results, including partial or failed creation
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/LegacyEntityBatchSummary'
                  meta:
                    type: object
                    required:
                      - apiVersion
                      - batchVersion
                      - workspaceId
                    properties:
                      apiVersion:
                        const: '1'
                      batchVersion:
                        const: legacy_entity_batch_v1
                      workspaceId:
                        type: string
                        format: uuid
              example:
                data:
                  summary: Created 1/1 entities.
                  total: 1
                  created_count: 1
                  failed_count: 0
                  results:
                    - index: 0
                      success: true
                      type: initiative
                      ref: release
                      id: 44444444-4444-4444-8444-444444444444
                      title: Prepare release documentation
                      data:
                        id: 44444444-4444-4444-8444-444444444444
                        title: Prepare release documentation
                        owner_id: 55555555-5555-4555-8555-555555555555
                        workspace_id: 33333333-3333-4333-8333-333333333333
                  created:
                    - index: 0
                      type: initiative
                      id: 44444444-4444-4444-8444-444444444444
                      title: Prepare release documentation
                      ref: release
                  failed: []
                  warnings: []
                  ref_map:
                    release: 44444444-4444-4444-8444-444444444444
                meta:
                  apiVersion: '1'
                  batchVersion: legacy_entity_batch_v1
                  workspaceId: 33333333-3333-4333-8333-333333333333
        '400':
          description: Unsupported reference shape or implicit hierarchy profile
        '401':
          description: Missing, invalid or expired machine credential/delegation
        '404':
          description: Workspace, owner or referenced resource is not admitted
        '413':
          description: Body exceeds the 4 MiB bound
        '415':
          description: Content-Type must be application/json
        '422':
          description: Unsupported or invalid batch envelope
        '429':
          description: Existing v1 principal write rate limit exceeded
        '503':
          description: Scope authorization storage is unavailable
      security:
        - bearerAuth: []
components:
  schemas:
    LegacyEntityBatchRequest:
      type: object
      properties:
        version:
          type: string
          const: legacy_entity_batch_v1
        workspace_id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        entities:
          minItems: 1
          type: array
          items: {}
        owner_id:
          anyOf:
            - type: string
            - type: 'null'
        continue_on_error:
          type: boolean
        concurrency:
          type: number
          minimum: 1
          maximum: 20
      required:
        - version
        - workspace_id
        - entities
      additionalProperties: false
    LegacyEntityBatchSummary:
      type: object
      properties:
        summary:
          type: string
        total:
          type: number
        created_count:
          type: number
        failed_count:
          type: number
        results:
          type: array
          items:
            type: object
            properties:
              index:
                type: number
              success:
                type: boolean
              type:
                anyOf:
                  - type: string
                  - type: 'null'
              ref:
                type: string
              id:
                type: string
              title:
                anyOf:
                  - type: string
                  - type: 'null'
              data:
                anyOf:
                  - type: object
                    propertyNames:
                      type: string
                    additionalProperties: {}
                  - type: 'null'
              error:
                type: string
              skipped:
                type: boolean
              warnings:
                type: array
                items:
                  type: object
                  properties:
                    path:
                      type: string
                    from:
                      type: string
                    to:
                      type: string
                    reason:
                      type: string
                  required:
                    - path
                    - from
                    - to
                    - reason
                  additionalProperties: false
            required:
              - index
              - success
              - type
            additionalProperties: false
        created:
          type: array
          items:
            type: object
            properties:
              index:
                type: number
              type:
                type: string
              id:
                type: string
              title:
                anyOf:
                  - type: string
                  - type: 'null'
              ref:
                type: string
            required:
              - index
              - type
              - id
            additionalProperties: false
        failed:
          type: array
          items:
            type: object
            properties:
              index:
                type: number
              type:
                anyOf:
                  - type: string
                  - type: 'null'
              ref:
                type: string
              error:
                type: string
            required:
              - index
              - type
              - error
            additionalProperties: false
        warnings:
          type: array
          items:
            type: object
            properties:
              path:
                type: string
              from:
                type: string
              to:
                type: string
              reason:
                type: string
            required:
              - path
              - from
              - to
              - reason
            additionalProperties: false
        ref_map:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
      required:
        - summary
        - total
        - created_count
        - failed_count
        - results
        - created
        - failed
        - warnings
        - ref_map
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'OrgX API key, sent as `Authorization: Bearer oxk_...`'

````

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