Skip to Content
API ReferenceTrack Cargo

Track Cargo

Get the current status of a submitted request.

GET /cargo/{cargo_id}/tracking

Authentication

This endpoint requires the X-API-Key header with a valid project API key.

-H "X-API-Key: convoy_sk_your_key_here"

Project Scoping: You can only track cargo that belongs to your project. Attempting to track cargo from another project returns 404 Not Found.

Path Parameters

ParameterTypeDescription
cargo_idstringThe cargo ID from /cargo/load response

Response

{ "cargo_id": "crg_abc123def456", "status": "processing", "status_description": "Batch is being processed by the provider", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:35:00Z" }
FieldDescription
cargo_idRequest identifier
statusCurrent status (see below)
status_descriptionHuman-readable status
created_atWhen request was submitted
updated_atLast status change

Status Values

StatusDescription
pendingWaiting to be assigned to a batch
batchedAssigned to a batch job
processingBatch is being processed
completedProcessing completed
failedProcessing failed
callback_pendingResult ready, delivering callback
callback_deliveredCallback sent successfully
callback_failedCallback delivery failed

Examples

curl

curl -H "X-API-Key: convoy_sk_your_key_here" \ https://api.cnvy.ai/cargo/crg_abc123def456/tracking

Python

import httpx cargo_id = "crg_abc123def456" response = httpx.get( f"https://api.cnvy.ai/cargo/{cargo_id}/tracking", headers={"X-API-Key": "convoy_sk_your_key_here"} ) data = response.json() print(f"Status: {data['status']}") print(f"Description: {data['status_description']}")

Polling Example

import httpx import time def wait_for_completion(cargo_id: str, api_key: str, timeout: int = 3600) -> dict: """Poll until cargo is processed or timeout.""" start = time.time() terminal_statuses = {"callback_delivered", "callback_failed", "failed"} while time.time() - start < timeout: response = httpx.get( f"https://api.cnvy.ai/cargo/{cargo_id}/tracking", headers={"X-API-Key": api_key} ) data = response.json() if data["status"] in terminal_statuses: return data time.sleep(30) # Poll every 30 seconds raise TimeoutError(f"Cargo {cargo_id} not completed in {timeout}s") # Usage result = wait_for_completion( "crg_abc123def456", "convoy_sk_your_key_here" )

JavaScript

async function trackCargo(cargoId, apiKey) { const response = await fetch( `https://api.cnvy.ai/cargo/${cargoId}/tracking`, { headers: { "X-API-Key": apiKey } } ); return response.json(); } // Usage const status = await trackCargo( "crg_abc123def456", "convoy_sk_your_key_here" ); console.log(`Status: ${status.status}`);

Errors

StatusDescription
401Missing or invalid API key
403Project is inactive
404Cargo not found or not owned by your project
500Internal server error

Error Response Examples

{"detail": "API key required. Include X-API-Key header."}
{"detail": "Cargo not found"}

A 404 response may mean the cargo doesn’t exist OR it belongs to a different project. This prevents information leakage about other projects’ cargo.

Last updated on