Refonte AI

File Upload

File Upload Size: Each file can only be 80 MB in size. Need more? Get in touch.

Body Params

file file required

The local file to be uploaded.

display_name string

A human readable name for the file.

project_name string

Which project this file will be associated with. This is only used for the "Refonte Rapid" data labeling tool. In order to upload the same file to multiple projects, call the File Upload API multiple times with the same id and different project_name values.

reference_id string

A unique identifier for your file used for upload idempotency. Uploading two files with the same_reference_id will result in a 409 (Conflict) error.

metadata object

A JSON object used to store additional data associated with the file.

Request

Python

POST  /v1/files/upload
import requests
from requests.auth import HTTPBasicAuth
import json


url = "https://api.refonte.com/v1/files/upload"

auth = HTTPBasicAuth('{{api_key}}', '')

headers = {
    "Accept": "application/json",
}

with open("kitten.png", "rb") as f:
    response = requests.request(
        "POST",
        url,
        data={
            "project_name": "kitten_labeling",
            "metadata": json.dumps({"id": "kitten0"}),
        },
        files={"file": f},
        headers=headers,
        auth=auth,
    )
    print(response.text)

File Import

Body Params

file_url string required

The file url to be uploaded.

Request

Python

POST  /v1/files/import
import requests
url = "https://api.refonte.com/v1/files/import"
payload = { "file_url": "http://www.example.com/file.png" }
headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "<YOUR_API_KEY>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)

Get Assets

Path Params

projects string required

Project filter

metadata object

Metadata filter

cursor string

Cursor for pagination

Updated about 2 months ago