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

# Freeze a Build snapshot (owner only)

> Freeze the current Workspace content into an immutable snapshot
(the reference object for debug runs and publishing).

Guards: the workspace exists and its current content is valid
(otherwise 422 with issues); the body may carry expected_revision
(409 if modified concurrently between save and freeze). An existing
ready snapshot with the same content_hash is reused directly
(idempotent optimization, no duplicate rows). api kind is ready
immediately; code kind returns 202 and submits an image build
(a second submission while one is in flight for the same app is
409 — the single build host is serial anyway). Builds stay allowed
while deprecated (self-testing is harmless; what is rejected is a
new Release).



## OpenAPI

````yaml /jp/datahub/api/openapi.json post /v1/data-apps/{app_id}/builds
openapi: 3.1.0
info:
  title: DataHub API
  version: 0.2.0
  description: Public /v1 contract of Octoparse DataHub. Internal channels are excluded.
servers:
  - url: https://api-datahub.octoparse.com
security:
  - bearerAuth: []
tags:
  - name: Discovery
    description: >-
      Anonymous access: platform metadata (currency), data app search, detail
      and input contract, machine-readable manifest spec.
  - name: Publishing
    description: >-
      Self-service publishing channel (API Key auth), two-phase: validate first
      (validate / package, nothing persisted), then publish (POST /data-apps,
      the submission goes live as a new Release). api kind (declarative
      integration) becomes visible on publish; code kind (code package) returns
      202 and enters an async image build; once ready it is promoted to a
      Release, visible and runnable. Poll progress via GET
      /data-apps/{ref}/builds.
  - name: Runs & Results
    description: >-
      Start / query / cancel runs and read result records with pagination.
      Business inputs go in the request body; platform run options (wait,
      max_records) go in query parameters.
  - name: Datasets
    description: >-
      Metadata and record access for platform datasets (including seeded stock
      data).
  - name: Account
    description: Account info and cumulative usage for the current API Key.
  - name: Secrets
    description: >-
      CRUD for upstream credentials (environment entries referenced by manifest
      `runtime.env`). Plaintext is write-only: every read returns a mask.
paths:
  /v1/data-apps/{app_id}/builds:
    post:
      tags:
        - Publishing
      summary: Freeze a Build snapshot (owner only)
      description: |-
        Freeze the current Workspace content into an immutable snapshot
        (the reference object for debug runs and publishing).

        Guards: the workspace exists and its current content is valid
        (otherwise 422 with issues); the body may carry expected_revision
        (409 if modified concurrently between save and freeze). An existing
        ready snapshot with the same content_hash is reused directly
        (idempotent optimization, no duplicate rows). api kind is ready
        immediately; code kind returns 202 and submits an image build
        (a second submission while one is in flight for the same app is
        409 — the single build host is serial anyway). Builds stay allowed
        while deprecated (self-testing is harmless; what is rejected is a
        new Release).
      operationId: create_app_build_v1_data_apps__app_id__builds_post
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            title: App Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/BuildRequest'
                - type: 'null'
              title: Body
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataEnvelope_BuildCreateResult_'
        '202':
          description: >-
            code kind snapshot accepted; async image build started
            (build_status=building; poll progress via GET
            /data-apps/{ref}/builds/{build_id})
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataEnvelope_BuildCreateResult_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BuildRequest:
      properties:
        expected_revision:
          anyOf:
            - type: integer
            - type: 'null'
          title: Expected Revision
      type: object
      title: BuildRequest
      description: 'POST builds request body (optional): optimistic concurrency guard.'
    DataEnvelope_BuildCreateResult_:
      properties:
        data:
          $ref: '#/components/schemas/BuildCreateResult'
      type: object
      required:
        - data
      title: DataEnvelope[BuildCreateResult]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BuildCreateResult:
      properties:
        build_id:
          type: string
          title: Build Id
        build_status:
          type: string
          title: Build Status
        content_hash:
          type: string
          title: Content Hash
        source_revision:
          type: integer
          title: Source Revision
        reused:
          type: boolean
          title: Reused
          default: false
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
      type: object
      required:
        - build_id
        - build_status
        - content_hash
        - source_revision
      title: BuildCreateResult
      description: |-
        POST builds: api-type builds become ready synchronously (200); code-type
        builds return 202 building (poll GET builds/{id} until ready/failed).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: DataHub API Key

````