Jobs
Jobs represent individual sync operations — imports from sources, exports to destinations, or model executions. Use the Jobs API to monitor progress, view logs, and cancel running jobs.
List Jobs
Retrieve jobs for your account.
GET /api/v1/jobsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
limit | integer | Number of items to return (default: 20, max: 100) |
offset | integer | Number of items to skip (default: 0) |
sort | string | Sort field and order (e.g., created_at:desc) |
status | string | Filter by status: pending, running, completed, failed, cancelled |
job_type | string | Filter by type: import, export, model |
source_id | string | Filter by source |
integration_id | string | Filter by integration |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://app.vendodata.com/api/v1/jobs?status=running&limit=10"Example Response
{
"data": [
{
"id": "job_220e8400-e29b-41d4-a716-446655440012",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"integrationId": "dd0e8400-e29b-41d4-a716-446655440008",
"jobType": "export",
"status": "running",
"trigger": "scheduled",
"progress": 45,
"startedAt": "2024-03-04T10:25:00Z",
"completedAt": null,
"metrics": {
"rows_processed": 15000,
"rows_total": 33000
},
"createdAt": "2024-03-04T10:25:00Z",
"updatedAt": "2024-03-04T10:28:00Z"
},
{
"id": "job_330e8400-e29b-41d4-a716-446655440013",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"sourceId": "880e8400-e29b-41d4-a716-446655440003",
"jobType": "import",
"status": "completed",
"trigger": "api",
"progress": 100,
"startedAt": "2024-03-04T10:00:00Z",
"completedAt": "2024-03-04T10:15:00Z",
"metrics": {
"rows_imported": 5000,
"duration_seconds": 900
},
"createdAt": "2024-03-04T10:00:00Z",
"updatedAt": "2024-03-04T10:15:00Z"
}
],
"meta": {
"pagination": {
"total": 2,
"limit": 10,
"offset": 0,
"hasMore": false
}
}
}Get Job Details
Retrieve details for a specific job.
GET /api/v1/jobs/{jobId}Path Parameters
| Parameter | Type | Description |
|---|---|---|
jobId | string | The job’s unique identifier |
Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://app.vendodata.com/api/v1/jobs/job_220e8400-e29b-41d4-a716-446655440012Example Response
{
"data": {
"id": "job_220e8400-e29b-41d4-a716-446655440012",
"accountId": "123e4567-e89b-12d3-a456-426614174000",
"integrationId": "dd0e8400-e29b-41d4-a716-446655440008",
"sourceId": null,
"jobType": "export",
"status": "running",
"trigger": "scheduled",
"progress": 67,
"errorMessage": null,
"config": {
"data_type": "events",
"date_range": {
"start": "2024-02-25",
"end": "2024-03-04"
}
},
"metrics": {
"rows_processed": 22000,
"rows_total": 33000,
"events_sent": 22000,
"api_calls": 220
},
"startedAt": "2024-03-04T10:25:00Z",
"completedAt": null,
"createdAt": "2024-03-04T10:25:00Z",
"updatedAt": "2024-03-04T10:30:00Z"
}
}Cancel Job
Cancel a running or pending job.
POST /api/v1/jobs/{jobId}/cancelExample Request
curl -X POST \
-H "Authorization: Bearer YOUR_API_KEY" \
https://app.vendodata.com/api/v1/jobs/job_220e8400-e29b-41d4-a716-446655440012/cancelExample Response
{
"data": {
"id": "job_220e8400-e29b-41d4-a716-446655440012",
"status": "cancelled",
"message": "Job cancellation requested"
}
}Error: Job Not Cancellable
{
"error": {
"code": "BAD_REQUEST",
"message": "Job is not in a cancellable state. Current status: completed"
}
}Job Statuses
| Status | Description |
|---|---|
pending | Job is queued, waiting to start |
running | Job is currently executing |
completed | Job finished successfully |
failed | Job encountered an error |
cancelled | Job was cancelled by user |
Job Types
| Type | Description |
|---|---|
import | Importing data from a source into Vendo |
export | Exporting data to a destination |
model | Executing a Python data model |
Trigger Types
| Trigger | Description |
|---|---|
scheduled | Triggered by schedule |
api | Triggered via API call |
manual | Triggered from web UI |
webhook | Triggered by external webhook |
dependency | Triggered by upstream job completion |
Polling for Job Completion
To wait for a job to complete, poll the job status:
async function waitForJob(apiKey, jobId) {
const maxAttempts = 60;
const delayMs = 5000; // 5 seconds
for (let i = 0; i < maxAttempts; i++) {
const response = await fetch(
`https://app.vendodata.com/api/v1/jobs/${jobId}`,
{ headers: { 'Authorization': `Bearer ${apiKey}` } }
);
const { data } = await response.json();
if (['completed', 'failed', 'cancelled'].includes(data.status)) {
return data;
}
await new Promise(resolve => setTimeout(resolve, delayMs));
}
throw new Error('Job timed out');
}
// Usage
const job = await waitForJob('vendo_sk_xxx', 'job_123');
console.log(`Job ${job.status}: ${job.metrics.rows_processed} rows`);Common Metrics
Import Jobs
| Metric | Description |
|---|---|
rows_imported | Number of rows imported |
rows_updated | Number of existing rows updated |
duration_seconds | Total execution time |
Export Jobs
| Metric | Description |
|---|---|
rows_processed | Rows read from source |
rows_total | Total rows to process |
events_sent | Events sent to destination |
api_calls | API calls made to destination |
Model Jobs
| Metric | Description |
|---|---|
input_rows | Rows read from input table |
output_rows | Rows written to output table |
execution_time_ms | Python execution time |
Last updated on