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

# Adjust visibility and maintenance state

> App-level reversible operational state (orthogonal to lifecycle,
adjustable at any time):

- `scope`: public (marketplace visible) / private (owner only) /
  shared (grant list, managed via PUT/DELETE .../grants/{username});
- `accepting_runs`: maintenance switch. false = under maintenance;
  new runs from others are rejected (403 app-not-accepting-runs,
  message carrying `pause_message`); existing runs, purchased data
  and marketplace visibility are unaffected; the owner's self-tests
  are exempt. Flip back to true once the upstream is fixed — no
  lifecycle change needed.

- `source_locale`: the locale the manifest is written in
  (`language[-Script][-REGION]`, e.g. zh-CN / en-US). Unset = the
  deployment default. Translations for other locales overlay this
  original (see .../translations). If a translation already exists
  for the new source locale the response carries a
  `translation-shadowed-by-source` warning — it is not deleted
  automatically.

Zero-Release apps can be adjusted too (no external effect, but
keeping the settings is the unsurprising behavior).



## OpenAPI

````yaml /jp/datahub/api/openapi.json patch /v1/data-apps/{app_id}/settings
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}/settings:
    patch:
      tags:
        - Publishing
      summary: Adjust visibility and maintenance state
      description: |-
        App-level reversible operational state (orthogonal to lifecycle,
        adjustable at any time):

        - `scope`: public (marketplace visible) / private (owner only) /
          shared (grant list, managed via PUT/DELETE .../grants/{username});
        - `accepting_runs`: maintenance switch. false = under maintenance;
          new runs from others are rejected (403 app-not-accepting-runs,
          message carrying `pause_message`); existing runs, purchased data
          and marketplace visibility are unaffected; the owner's self-tests
          are exempt. Flip back to true once the upstream is fixed — no
          lifecycle change needed.

        - `source_locale`: the locale the manifest is written in
          (`language[-Script][-REGION]`, e.g. zh-CN / en-US). Unset = the
          deployment default. Translations for other locales overlay this
          original (see .../translations). If a translation already exists
          for the new source locale the response carries a
          `translation-shadowed-by-source` warning — it is not deleted
          automatically.

        Zero-Release apps can be adjusted too (no external effect, but
        keeping the settings is the unsurprising behavior).
      operationId: update_app_settings_v1_data_apps__app_id__settings_patch
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            title: App Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AppSettingsPatch'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataEnvelope_AppSettings_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AppSettingsPatch:
      properties:
        scope:
          anyOf:
            - type: string
              enum:
                - public
                - private
                - shared
            - type: 'null'
          title: Scope
        accepting_runs:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Accepting Runs
        pause_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Pause Message
        source_locale:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Locale
      type: object
      title: AppSettingsPatch
      description: >-
        PATCH settings request body: all fields optional; only provided keys
        change.
    DataEnvelope_AppSettings_:
      properties:
        data:
          $ref: '#/components/schemas/AppSettings'
      type: object
      required:
        - data
      title: DataEnvelope[AppSettings]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AppSettings:
      properties:
        scope:
          type: string
          title: Scope
        accepting_runs:
          type: boolean
          title: Accepting Runs
        pause_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Pause Message
        source_locale:
          type: string
          title: Source Locale
        warnings:
          items:
            $ref: '#/components/schemas/ContractWarning'
          type: array
          title: Warnings
      type: object
      required:
        - scope
        - accepting_runs
        - source_locale
      title: AppSettings
    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
    ContractWarning:
      properties:
        code:
          type: string
          title: Code
        params:
          additionalProperties: true
          type: object
          title: Params
      type: object
      required:
        - code
      title: ContractWarning
      description: >-
        One structured soft warning from contract assembly. `code` is a stable

        kebab-case identifier; `params` carries the variables (file names, the

        ignored-file list, ...). Localization happens in consuming display
        layers

        keyed by `code`; unknown codes should be shown as the code itself.


        Codes: `contract-file-missing` (a non-optional slot file is absent;

        params.file), `readme-missing`, `duplicate-contract-file` (same name at

        several levels; params.file/kept/ignored), `id-field-missing`

        (output_schema.json has no id_field and runtime has no dedup_by to infer

        it from), `pricing-missing` (no pricing.json and no pricing section in

        dataapp.json), `non-contract-files-ignored` (params.files is the full

        list), `folder-name-mismatch` (params.folder_name/declared_name).

        i18n.json codes (params.locale/path): `i18n-locale-is-source` (a locale

        equal to `source`, skipped), `i18n-path-unresolved` (path not in the

        translatable allowlist or absent from the manifest),
        `i18n-type-mismatch`

        (params.expected string/list), `i18n-length-mismatch` (`enum_titles`

        length differs from `enum`; params.expected/actual),
        `i18n-path-ambiguous`

        (duplicate pricing event / example id makes the path ambiguous).
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: DataHub API Key

````