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

# Publish data app (deprecated)

> One-shot publish sugar for api-type apps: submit and publish. Superseded by the contract import wizard and the three-step chain.

<Warning>
  **Deprecated.** Submissions now go through the portal contract import wizard (backed by the assemble-contract endpoint) or the three-step chain (save workspace → create build → create release). This endpoint remains for the built-in console and existing tests; removal will be scheduled separately.
</Warning>

**`POST`** `https://api-datahub.octoparse.com/v1/data-apps`

Authentication: API key required (`Authorization: Bearer <API Key>`).

One-shot publish sugar for api-type (declarative) apps: internally an atomic chain of create identity → save workspace → create build → create release. Submit means publish.

**Version is decided by the publish action**: by default the patch segment of the current max version increments by one (first is `0.1.0`). The submission neither needs nor carries a version number (this path ignores `identity.version`). To set an explicit version, use create release in the three-step chain. code-type does not use this sugar: image builds are asynchronous, so "submit and publish" does not hold.

Namespace is inferred from auth: `identity.app_name` in the manifest is only the app name; the app lands under the publisher's own (user, app name). `app_id` is minted once and survives username or app-name changes; external references are always two-segment. Releases are immutable: publishing again appends a new version and never overwrites an old one. Two name gates run before publish: the account must have a username (`400`); historical ownership of (username, app name) must be yours — after a username transfer, names the predecessor used enter a 30-day freeze (`409`).

## Request

### Request body

<ParamField body="manifest" type="string" required>
  Raw manifest text.
</ParamField>

<ParamField body="files" type="object">
  Attached files.
</ParamField>

<ParamField body="secrets" type="object">
  Map of secret names to plaintext values.
</ParamField>

### Example request

```bash theme={null}
curl -X POST \
  -H "Authorization: Bearer $OCTOPARSE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"manifest": "spec_version: \"0.2\"\n…", "secrets": {"EXAMPLE_API_KEY": "sk-example"}}' \
  "https://api-datahub.octoparse.com/v1/data-apps"
```

## Response

### 200 success

```json theme={null}
{
  "data": {
    "app_id": "app_6dfe4e839ccf",
    "namespace": "carol",
    "app_name": "reviews-query",
    "version": "0.1.0",
    "build_id": "bld_a583f440a0ab",
    "published_at": "2026-09-15T08:00:00+00:00"
  }
}
```

The payload is wrapped in `data`. Fields:

<ResponseField name="app_name" type="string" required>
  App name.
</ResponseField>

<ResponseField name="namespace" type="string">
  Publisher username.
</ResponseField>

<ResponseField name="version" type="string">
  Published version number.
</ResponseField>

<ResponseField name="status" type="string">
  —
</ResponseField>

<ResponseField name="card" type="object" required>
  —
</ResponseField>

<ResponseField name="missing_secrets" type="string[]">
  —
</ResponseField>

<ResponseField name="name_reused_from" type="string">
  —
</ResponseField>

### Errors

| HTTP | `code`              | `category`      | Description                                                                                  |
| ---- | ------------------- | --------------- | -------------------------------------------------------------------------------------------- |
| 401  | `unauthorized`      | `forbidden`     | Missing or invalid API key.                                                                  |
| 422  | `invalid-manifest`  | `invalid_input` | Manifest failed validation; `issues[]` lists the problems.                                   |
| 400  | `username-required` | `invalid_input` | Account has no username yet, so a `<username>/<app_name>` reference cannot be formed.        |
| 409  | `app-name-reserved` | `forbidden`     | Name is held by someone else's historical binding (30-day freeze after a username transfer). |
| 400  | `invalid-app-name`  | `invalid_input` | Name fails naming rules or is a reserved word.                                               |

Error responses use `{"error": {code, category, message, retryable}}`. See <a href="/docs/en/datahub/api/reference/introduction#errors">Errors</a>.

## Client libraries

The Python and JavaScript SDKs do not wrap this endpoint yet. Call REST directly.
