Exports API
Export annotation results from datasets and projects.
List Exports
GET /api/v1/exports/List all exported results, check status, and get download URLs.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
ordering | string | Field to order results by |
cursor | string | Pagination cursor |
limit | integer | Results per page |
Example
cURL
curl "https://server.avala.ai/api/v1/exports/" \
-H "X-Avala-Api-Key: $AVALA_API_KEY"Response
{
"next": null,
"previous": null,
"results": [
{
"uid": "export-uuid-001",
"name": "Training Data Export",
"format": "avala-json-external",
"status": "exported",
"total_task_count": 1000,
"exported_task_count": 1000,
"download_url": "https://...",
"datasets": ["dataset-uuid-001"],
"slices": [],
"projects": ["project-uuid-001"],
"organization": null,
"created_at": "2024-01-21T10:00:00Z"
}
]
}Create Export
POST /api/v1/exports/Export all dataset or project results asynchronously.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Export name (1-255 chars) |
format | string | Yes | Export format |
datasets | array | Yes | Array of dataset UUIDs |
projects | array | Yes | Array of project UUIDs |
slices | array | Yes | Array of slice UUIDs |
filter_query_string | string | No | Filter query |
Supported Formats
| Format | Description |
|---|---|
avala-json-external | Avala’s native JSON format with full metadata |
YOLO | YOLO format for object detection |
Example
cURL
curl -X POST "https://server.avala.ai/api/v1/exports/" \
-H "X-Avala-Api-Key: $AVALA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Export",
"format": "avala-json-external",
"datasets": ["550e8400-e29b-41d4-a716-446655440000"],
"projects": [],
"slices": []
}'Response
{
"uid": "export-uuid-001",
"name": "My Export",
"format": "avala-json-external",
"status": "requested",
"total_task_count": null,
"exported_task_count": null,
"download_url": null,
"datasets": ["550e8400-e29b-41d4-a716-446655440000"],
"slices": [],
"projects": [],
"organization": null,
"created_at": "2024-01-21T10:00:00Z"
}Export Fields
| Field | Type | Description |
|---|---|---|
uid | UUID | Unique identifier |
name | string | Export name |
format | string | Export format |
status | string | Current export status |
total_task_count | integer | Total tasks to export |
exported_task_count | integer | Tasks exported so far |
download_url | string | URL to download when ready |
datasets | array | Dataset UUIDs included |
projects | array | Project UUIDs included |
slices | array | Slice UUIDs included |
organization | object | Associated organization |
created_at | datetime | Creation timestamp |
Export Statuses
| Status | Description |
|---|---|
requested | Export has been requested |
exporting | Export is in progress |
exported | Export completed successfully |
failed | Export failed |
aborted | Export was aborted |
Polling for Completion
Exports are processed asynchronously. Poll the list endpoint to check status:
import time
def wait_for_export(export_uid):
while True:
response = requests.get(
f"{BASE_URL}/exports/",
headers=headers
)
exports = response.json()["results"]
export = next(
(e for e in exports if e["uid"] == export_uid),
None
)
if export and export["status"] == "exported":
return export["download_url"]
elif export and export["status"] == "failed":
raise Exception("Export failed")
time.sleep(5)Error Responses
Validation Error
{
"name": ["This field is required."],
"format": ["\"invalid\" is not a valid choice."]
}HTTP Status: 400
Last updated on