> ## 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.

# Split a manifest into contract-folder files

> The inverse of assemble: one self-contained manifest → the
canonical contract-folder files map (JSON text per file; zipping is
the client's mechanical concern).

Split semantics (the single source of truth): platform-injected
read-back keys (scope / status / namespace) are stripped; input /
output each shed one `schema` layer, with output.id_field moved back
to the top of output_schema.json; runtime / pricing / examples become
standalone files whenever present (the export is always the
split-file form); an empty readme writes no README.md; the remaining
keys are dataapp.json in their original order. A split folder
re-assembled through POST contract/assemble reproduces the manifest
with zero warnings. Optional `translations` (`{source, locales}`)
additionally produces `i18n.json`.



## OpenAPI

````yaml /jp/datahub/api/openapi.json post /v1/data-apps/contract/split
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/contract/split:
    post:
      tags:
        - Publishing
      summary: Split a manifest into contract-folder files
      description: |-
        The inverse of assemble: one self-contained manifest → the
        canonical contract-folder files map (JSON text per file; zipping is
        the client's mechanical concern).

        Split semantics (the single source of truth): platform-injected
        read-back keys (scope / status / namespace) are stripped; input /
        output each shed one `schema` layer, with output.id_field moved back
        to the top of output_schema.json; runtime / pricing / examples become
        standalone files whenever present (the export is always the
        split-file form); an empty readme writes no README.md; the remaining
        keys are dataapp.json in their original order. A split folder
        re-assembled through POST contract/assemble reproduces the manifest
        with zero warnings. Optional `translations` (`{source, locales}`)
        additionally produces `i18n.json`.
      operationId: split_contract_v1_data_apps_contract_split_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContractSplitRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataEnvelope_ContractSplitResult_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ContractSplitRequest:
      properties:
        manifest:
          additionalProperties: true
          type: object
          title: Manifest
        translations:
          anyOf:
            - $ref: '#/components/schemas/ContractTranslations'
            - type: 'null'
      type: object
      required:
        - manifest
      title: ContractSplitRequest
      description: |-
        POST contract/split request body: any self-contained manifest object
        (e.g. the read-back of GET /data-apps/{ref}/manifest, injected keys
        included — they are stripped during the split). Optional `translations`
        additionally produces `i18n.json`.
    DataEnvelope_ContractSplitResult_:
      properties:
        data:
          $ref: '#/components/schemas/ContractSplitResult'
      type: object
      required:
        - data
      title: DataEnvelope[ContractSplitResult]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ContractTranslations:
      properties:
        source:
          type: string
          title: Source
        locales:
          additionalProperties:
            additionalProperties: true
            type: object
          type: object
          title: Locales
      type: object
      required:
        - source
      title: ContractTranslations
      description: |-
        The companion `i18n.json` of a contract folder: `source` is the locale
        the manifest is written in (required); `locales` maps each target locale
        to a flat entries object (path → string or string array; see
        GET/PUT /data-apps/{ref}/translations/{locale}). Never merged into the
        manifest — translations are stored per app, not per release.
    ContractSplitResult:
      properties:
        files:
          additionalProperties:
            type: string
          type: object
          title: Files
        folder_name:
          type: string
          title: Folder Name
          default: ''
      type: object
      title: ContractSplitResult
      description: >-
        Split result: canonical contract-folder form, dataapp.json first.

        README.md is omitted when the readme is empty (a folder may have 6
        files).

        Non-slot content (`_editor_state.json`, code packages) never appears —

        the input is an inline manifest, which carries no files map.
    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

````