Exports enable you to download annotated data, labels, and results from Avala in various formats for use in training pipelines and external tools.
Overview
The Exports resource allows you to:
- Export annotations from projects
- Download dataset items and labels
- Generate training-ready data
- Access results in standard formats (COCO, YOLO, etc.)
- Track export status and download URLs
Each export is asynchronous and provides a download URL when ready.
Export structure
interface Export {
uid: string;
status: string | null;
downloadUrl: string | null;
createdAt: string | null;
updatedAt: string | null;
}
Properties
Unique identifier for the export
Current export status: ‘pending’, ‘processing’, ‘completed’, or ‘failed’
URL to download the export file (available when status is ‘completed’)
ISO 8601 timestamp when export was requested
ISO 8601 timestamp of last status update
Creating an export
Request a new export from a project or dataset:
Export from project
Export from dataset
const exportJob = await avala.exports.create({
project: 'proj_abc123'
});
console.log(`Export created: ${exportJob.uid}`);
console.log(`Status: ${exportJob.status}`);
const exportJob = await avala.exports.create({
dataset: 'dataset_xyz789'
});
console.log(`Export created: ${exportJob.uid}`);
Create options
Project UID to export annotations from
Dataset UID to export items from
Provide either project or dataset, not both. The export will include all relevant data from the specified resource.
Listing exports
Retrieve all exports with pagination:
const page = await avala.exports.list({
limit: 20
});
for (const exp of page.items) {
console.log(`${exp.uid}: ${exp.status}`);
if (exp.downloadUrl) {
console.log(` Download: ${exp.downloadUrl}`);
}
}
// Get next page
if (page.hasMore) {
const nextPage = await avala.exports.list({
cursor: page.nextCursor
});
}
Maximum number of exports to return (default: 20)
Cursor for fetching the next page of results
Getting an export
Retrieve details about a specific export:
const exportJob = await avala.exports.get('export_uid_here');
console.log(`Status: ${exportJob.status}`);
if (exportJob.status === 'completed') {
console.log(`Download: ${exportJob.downloadUrl}`);
}
Export lifecycle
Exports progress through several status values:
Pending
Export has been created and is queued for processing{ status: 'pending', downloadUrl: null }
Processing
Export is actively being generated{ status: 'processing', downloadUrl: null }
Completed
Export is ready for download{
status: 'completed',
downloadUrl: 'https://storage.avala.ai/exports/...'
}
Failed
Export encountered an error{ status: 'failed', downloadUrl: null }
Common workflows
Export and download
Check recent exports
Automated export
List all exports
// Create export
const exportJob = await avala.exports.create({
project: 'proj_123'
});
// Poll for completion
let status = exportJob.status;
while (status === 'pending' || status === 'processing') {
await new Promise(resolve => setTimeout(resolve, 5000));
const updated = await avala.exports.get(exportJob.uid);
status = updated.status;
if (status === 'completed') {
console.log(`Download ready: ${updated.downloadUrl}`);
break;
}
if (status === 'failed') {
console.error('Export failed');
break;
}
}
const recent = await avala.exports.list({ limit: 10 });
const completed = recent.items.filter(
exp => exp.status === 'completed'
);
console.log(`${completed.length} completed exports`);
for (const exp of completed) {
console.log(exp.downloadUrl);
}
async function exportAndDownload(projectUid: string) {
// Request export
const exportJob = await avala.exports.create({
project: projectUid
});
// Wait for completion (with timeout)
const maxAttempts = 60; // 5 minutes
for (let i = 0; i < maxAttempts; i++) {
const current = await avala.exports.get(exportJob.uid);
if (current.status === 'completed') {
return current.downloadUrl;
}
if (current.status === 'failed') {
throw new Error('Export failed');
}
await new Promise(resolve => setTimeout(resolve, 5000));
}
throw new Error('Export timeout');
}
const url = await exportAndDownload('proj_123');
console.log(`Download: ${url}`);
// Fetch all exports using pagination
const allExports = [];
let cursor: string | null = null;
do {
const page = await avala.exports.list({
limit: 50,
cursor: cursor || undefined
});
allExports.push(...page.items);
cursor = page.nextCursor;
} while (cursor);
console.log(`Total exports: ${allExports.length}`);
List operations return paginated results:
interface CursorPage<Export> {
items: Export[];
nextCursor: string | null;
previousCursor: string | null;
hasMore: boolean;
}
Best practices
Poll efficiently
Wait 5-10 seconds between status checks to avoid rate limits
Handle failures
Always check for ‘failed’ status and implement error handling
Set timeouts
Implement reasonable timeouts when polling for export completion
Cache download URLs
Store download URLs temporarily as they may expire after some time
Download URLs are temporary and may expire. Download the export file promptly after it becomes available.
Depending on your project configuration, exports may be available in formats like:
- COCO JSON - Common Objects in Context format
- YOLO - YOLO training format
- Pascal VOC - Pascal VOC XML format
- CSV - Tabular export of annotations
- JSON - Raw annotation data
Export formats are determined by your project settings and data type. Configure your project’s export format in the Avala dashboard.
- Projects: Export annotations from projects - see Projects
- Datasets: Export dataset items - see Datasets
- Storage Config: Configure export storage destination