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

# Create Application

> Creates a new application with the provided configuration and files.

<ParamField body="file" type="file" required>
  The ZIP file containing the application code (maximum size: 100 MB).
</ParamField>

<ParamField body="memory" type="string" required>
  The amount of RAM to allocate for the application in MB.
</ParamField>

<ParamField body="autorestart" type="string">
  Whether the application should restart automatically (`true` or `false`). Requires plan support for auto-restart.
</ParamField>

<ParamField body="start" type="string">
  The application startup command.
</ParamField>

<ParamField body="main" type="string" required>
  The main file of the application.
</ParamField>

<ParamField body="version" type="string" required>
  The application runtime version (`recommended` or `latest`).
</ParamField>

<ParamField body="name" type="string" required>
  The application name.
</ParamField>

<ParamField body="description" type="string">
  An application description.
</ParamField>

<ParamField body="workspace_id" type="string">
  The workspace ID to associate with the application, if applicable.
</ParamField>

<ParamField body="subdomain" type="string">
  The subdomain for the application (e.g., `myapp`). Requires plan support for web publishing.
</ParamField>

<ParamField body="envs" type="string">
  A JSON string containing an array of environment variables, each with `key` and `value` properties (maximum 25 variables, maximum key length 100, maximum value 1000).
</ParamField>

### Response

<ResponseField name="response" type="object">
  The details of the created application.

  <Expandable title="Toggle object">
    <ResponseField name="id" type="string">
      The application ID.
    </ResponseField>

    <ResponseField name="owner_id" type="string">
      The application owner ID.
    </ResponseField>

    <ResponseField name="owner_plan_id" type="integer">
      The owner's plan ID.
    </ResponseField>

    <ResponseField name="name" type="string">
      The application name.
    </ResponseField>

    <ResponseField name="description" type="string">
      The application description.
    </ResponseField>

    <ResponseField name="cluster" type="integer">
      The application cluster ID.
    </ResponseField>

    <ResponseField name="status" type="string">
      The application status (e.g., `up`).
    </ResponseField>

    <ResponseField name="ram" type="integer">
      The application RAM in MB.
    </ResponseField>

    <ResponseField name="type" type="integer">
      The application type.
    </ResponseField>

    <ResponseField name="language" type="string">
      The application programming language (e.g., `javascript`).
    </ResponseField>

    <ResponseField name="subdomain" type="string | null">
      The application subdomain, if applicable.
    </ResponseField>

    <ResponseField name="custom_domain" type="string | null">
      The custom domain of the application, if applicable.
    </ResponseField>

    <ResponseField name="created_at" type="string" format="date-time">
      The timestamp when the application was created.
    </ResponseField>

    <ResponseField name="updated_at" type="string" format="date-time">
      The timestamp when the application was last updated.
    </ResponseField>

    <ResponseField name="last_snapshot" type="string | null" format="date-time">
      The timestamp of the application's last snapshot.
    </ResponseField>

    <ResponseField name="main_file" type="string">
      The main file of the application.
    </ResponseField>

    <ResponseField name="version" type="string">
      The runtime version (e.g., `recommended` or `latest`).
    </ResponseField>

    <ResponseField name="auto_restart" type="boolean">
      Whether the application automatically restarts on failure.
    </ResponseField>

    <ResponseField name="start_command" type="string | null">
      The startup command for the application, if specified.
    </ResponseField>

    <ResponseField name="use_credits" type="boolean">
      Whether the application uses credits.
    </ResponseField>

    <ResponseField name="credits_used" type="number">
      The amount of credits used by the application.
    </ResponseField>

    <ResponseField name="offline_since" type="string | null" format="date-time">
      The timestamp since the application went offline, if applicable.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "response": {
      "id": "app-abc123def456",
      "owner_id": "user-993591427428790342",
      "owner_plan_id": 1,
      "name": "API Simples",
      "description": "I have a description :)",
      "cluster": 1,
      "status": "up",
      "ram": 128,
      "type": 2,
      "language": "javascript",
      "subdomain": "myapp.vertraweb.app",
      "custom_domain": null,
      "last_snapshot": "2026-03-20T19:58:00Z",
      "main_file": "index.js",
      "version": "recommended",
      "auto_restart": false,
      "start_command": null,
      "use_credits": false,
      "credits_used": 0,
      "offline_since": null,
      "created_at": "2026-03-20T19:58:00Z",
      "updated_at": "2026-03-20T19:58:00Z"
    }
  }
  ```
</ResponseExample>

### Error Responses

<ResponseField name="code" type="string">
  The error code indicating the reason for the failure. Possible values:

  * `UNAUTHORIZED`: The user is not authenticated or does not have sufficient permissions.
  * `USER_NOT_FOUND`: The user's plan was not found.
  * `NO_FILE_UPLOADED`: No file was uploaded.
  * `FILE_TOO_LARGE`: The uploaded file exceeds the 100 MB limit.
  * `INVALID_VERSION`: The specified version is not `recommended` or `latest`.
  * `TOO_MANY_ENV_VARIABLES`: More than 25 environment variables were provided.
  * `ENV_VARIABLE_TOO_LONG`: An environment variable key or value exceeds length limits.
  * `INVALID_MEMORY`: The requested memory is invalid or exceeds plan limits.
  * `SUBDOMAIN_ALREADY_IN_USE`: The specified subdomain is already in use.
  * `INVALID_SUBDOMAIN_LENGTH`: The subdomain length is invalid (must be 5-63 characters).
  * `FORBIDDEN_SUBDOMAIN`: The specified subdomain is restricted.
</ResponseField>

<ResponseField name="message" type="string">
  A descriptive message providing additional details about the error.
</ResponseField>

<ResponseExample>
  ```json Error Response (403) theme={null}
  {
    "code": "UNAUTHORIZED"
  }
  ```

  ```json Error Response (400) theme={null}
  {
    "code": "NO_FILE_UPLOADED"
  }
  ```

  ```json Error Response (400) theme={null}
  {
    "code": "INVALID_MEMORY"
  }
  ```
</ResponseExample>
