> For the complete documentation index, see [llms.txt](https://docs.imerit.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/upload_files.md).

# upload\_files

`imerit_ango.sdk.SDK.`

## upload\_files(project\_id, file\_paths, storage\_id, batches, priority)

Upload local files to your project.

### Parameters

* **project\_id:** string
  * The unique identifier for the project. You can find the project ID in [the user interface](/sdk/sdk-documentation.md#project-ids) or retrieve it using the [`list_projects`](/sdk/sdk-documentation/project-level-sdk-functions/list_projects.md) function.
* **file\_paths:** List\[str]
  * A list containing absolute paths to files and, optionally, their contextData.
  * Example:

```json
[
    {
        "data": "/Users/lorenzo/Desktop/Gassino,_arrival_of_tramway_auto_x2.jpg",
        "metadata": {
            "width": 1500,
            "height": 1200
        },
        "contextData": {
            "key1": "value1"
        }
    }
]
```

* **storage\_id:** string, *Optional, default None*
  * This parameter has no function anymore and will be deprecated in the next version of the SDK.
* **batches**: List\[str], *Optional, default None*
  * You may assign the files you are uploading to one or more batches that exist in your project by providing their IDs here. You may create new batches with [create\_batch](#create_batch-project_id-batch_name) and you can get a list of batches with [get\_batches](#get_batches-project_id).
  * Example: `['0000000aa0a00a0000aaaa0a', '0000000aa0a00a0000aaaa0b']`
* **priority:** int, *Optional, default 0*
  * The new priority value to assign to the uploaded assets.
  * **Note:** The priority value must be between -1000 and 1000. Higher values indicate higher priority.

Returns:

* **output:** dict
  * A dictionary containing the result of the operation.
  * Including a `status` field indicating whether the request was successful and a `data` field containing the response payload with updated resources produced by the operation.

{% hint style="info" %}
The SDK does not set a separate maximum number of files for one `upload_files` call. Project and organization quotas count assets. After uploading the local files, this method registers them through `upload_files_cloud`; that final JSON request is limited to **50 MiB (52,428,800 bytes)** by the API. File contents are uploaded separately and do not count toward the JSON request size.

For large imports, split files across smaller calls. See [Import Limits](/data/importing-assets.md#import-limits) for project quotas and deployment-specific request limits.
{% endhint %}

{% hint style="warning" %}
The `upload_files` function is supported only for Ango projects. Local file uploads are disabled for PCT projects, please use the [`upload_files_cloud`](/sdk/sdk-documentation/project-level-sdk-functions/upload_files_cloud.md) function instead.
{% endhint %}

<details open>

<summary><strong>How to verify in Ango Hub?</strong></summary>

After successfully executing the `upload_files` function, you can validate the changes directly in Ango Hub.

Navigate to: **Projects → \[Your Project] → Asset**

* Ensure that all assets have been successfully imported and are visible in the project.

{% hint style="info" %}
Changes made via the SDK are reflected in Ango Hub in near real-time. If updates are not immediately visible, please refresh the page.
{% endhint %}

</details>

### Example

Importing two local files:

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

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

files = ["data/my_image_1.png", "data/my_image_2.png"]
ango_sdk.upload_files(project_id=project_id, file_paths=files)
```

{% endtab %}
{% endtabs %}

Importing a file with a custom external ID:

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

```python
import os
from dotenv import load_dotenv
from imerit_ango.sdk import SDK

load_dotenv('variables.env')
api_key = os.getenv('API_KEY')
project_id = os.getenv('PROJECT_ID')

ango_sdk = SDK(api_key)

files = [{"data": "data/my_image_1.png", "externalId": "custom_external_id"}]
ango_sdk.upload_files(project_id=project_id, file_paths=files)
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**See also**

[upload\_files\_cloud](/sdk/sdk-documentation/project-level-sdk-functions/upload_files_cloud.md), [upload\_files\_with\_asset\_builder](/sdk/sdk-documentation/project-level-sdk-functions/upload_files_with_asset_builder.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.imerit.net/sdk/sdk-documentation/project-level-sdk-functions/upload_files.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
