Skip to Content

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/jobs

Query Parameters

ParameterTypeDescription
limitintegerNumber of items to return (default: 20, max: 100)
offsetintegerNumber of items to skip (default: 0)
sortstringSort field and order (e.g., created_at:desc)
statusstringFilter by status: pending, running, completed, failed, cancelled
job_typestringFilter by type: import, export, model
source_idstringFilter by source
integration_idstringFilter 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

ParameterTypeDescription
jobIdstringThe 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-446655440012

Example 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}/cancel

Example Request

curl -X POST \ -H "Authorization: Bearer YOUR_API_KEY" \ https://app.vendodata.com/api/v1/jobs/job_220e8400-e29b-41d4-a716-446655440012/cancel

Example 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

StatusDescription
pendingJob is queued, waiting to start
runningJob is currently executing
completedJob finished successfully
failedJob encountered an error
cancelledJob was cancelled by user

Job Types

TypeDescription
importImporting data from a source into Vendo
exportExporting data to a destination
modelExecuting a Python data model

Trigger Types

TriggerDescription
scheduledTriggered by schedule
apiTriggered via API call
manualTriggered from web UI
webhookTriggered by external webhook
dependencyTriggered 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

MetricDescription
rows_importedNumber of rows imported
rows_updatedNumber of existing rows updated
duration_secondsTotal execution time

Export Jobs

MetricDescription
rows_processedRows read from source
rows_totalTotal rows to process
events_sentEvents sent to destination
api_callsAPI calls made to destination

Model Jobs

MetricDescription
input_rowsRows read from input table
output_rowsRows written to output table
execution_time_msPython execution time
Last updated on