# Exchange already uploaded app version

Sometimes it makes sense to replace an already uploaded app version without changing the chronology in the app version history.

1. Go to the build history / app version history page
2. Select your app version you would like to exchange
3. Click on exchange file button
4. Upload your new app file
5. Add a comment
6. Click on save

The newly uploaded app file will be exchanged and a change history will be added to the specific app version details with information about the user who changed the file, the added comment, and the timestamp of the file exchange.

{% hint style="info" %}
If an app file is replaced, only the app file and the meta-information extracted change, the previously provided public installation link will redirect the user to the new app file.&#x20;
{% endhint %}

## Exchange the already uploaded app version with CURL

The exchange with CURL needs to steps:

1. First, you need to upload your app version to the server
2. Secondly you need to replace an existing app version

First of all you need to pre-upload the new app version to the Updraft server:

## Pre-upload new app version

<mark style="color:green;">`POST`</mark> `POST https://getupdraft.com/api/applicationadd/?preload=1&app={{ AppID }} (content-type: multipart/form-data) app={{ BuildFile }}`

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| content-type  | object | multipart/form-data |
| Authorization | object | Authorization Token |

{% tabs %}
{% tab title="200 " %}

```
{“preload_path”: {{ preload_path }},
“title”: {{ AppTitle }},
“version”: “1.1",
“build_version_number”: “4",
“version_exist”: true
}
```

{% endtab %}
{% endtabs %}

## Replace existing app file

<mark style="color:orange;">`PUT`</mark> `Put PUT https://getupdraft.com/api/versions/{{ buildID }}/ (content-type: application/json) {“preload_path”: {{ preload_path }}, “comment”:“”}`

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | object | Authorization Token |

{% tabs %}
{% tab title="200 " %}

```
```

{% 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.getupdraft.com/your-projects/builds/exchange-already-uploaded-build-app-version.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.
