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

# Upload Files to Application

> Uploads a ZIP file to an application, replacing its contents. Optionally restarts the app after upload.

<ParamField path="id" type="string" required>
  The ID of the application to upload files to. If the application belongs to a workspace, include the workspace\_id in the format `appId-workspace_id`.
</ParamField>

<ParamField query="restart" type="string">
  If set to `"true"`, the application will automatically restart after the upload completes.
</ParamField>

<ParamField body="file" type="file" required>
  The ZIP file to upload. If a single root directory is detected, it will be automatically flattened.
</ParamField>

### Response

<ResponseField name="response" type="object">
  The result returned from the wing after the upload.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "response": {}
  }
  ```
</ResponseExample>

### Error Responses

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

  * `UNAUTHORIZED`: The user is not authenticated.
  * `ACCESS_DENIED`: The user does not have access to the application.
  * `APP_NOT_FOUND`: The specified application does not exist.
  * `NO_FILE_UPLOADED`: No file was provided in the request.
  * `UNKNOWN_ERROR`: An unexpected error occurred in the wing.
  * `INTERNAL_SERVER_ERROR`: An unexpected server error occurred.
</ResponseField>

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

  ```json Error Response (403) theme={null}
  {
    "code": "ACCESS_DENIED"
  }
  ```

  ```json Error Response (404) theme={null}
  {
    "code": "APP_NOT_FOUND"
  }
  ```

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