# Direct file uploads

The[ Create New App](/rest-api/create-new-app.md) and [Update Existing App](/rest-api/update-existing-app.md) endpoints require your app to be hosted at a **publicly accessible URL**.

If you prefer, you can upload the app **directly** as part of the API request using a `multipart/form-data` request.

### 🧾 Notes

* Use the field **`file`** to upload from your local file-system instead of the **`url`** field.
* All other field names stay the same.
* To **delete a field**, pass an **empty string** (e.g., `-F "field="`).
* `appPermissions` (normally a nested object in JSON) should be flattened:
  * e.g., `appPermissions.run`, `appPermissions.networkProxy`, etc.

### 📦 Examples

{% tabs %}
{% tab title="Upload New App" %}

```bash
curl -X POST https://api.appetize.io/v1/apps \
  -H "X-API-KEY: your_api_token" \
  -F "file=@file_to_upload.zip" \
  -F "platform=ios"
```

{% endtab %}

{% tab title="Update Existing App" %}

```bash
curl -X POST https://api.appetize.io/v1/apps/PUBLICKEY \
  -H "X-API-KEY: your_api_token" \
  -F "file=@file_to_upload.zip" \
  -F "platform=ios"
```

{% endtab %}

{% tab title="Specifying App Permissions" %}

```bash
curl -X POST https://api.appetize.io/v1/apps \
  -H "X-API-KEY: your_api_key_here" \
  -F "file=@file_to_upload.zip" \
  -F "platform=ios" \
  -F "appPermissions.run=public"
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appetize.io/rest-api/direct-file-uploads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
