6 min read

List Jobs

Retrieve a paginated list of all processing jobs with filtering and sorting options

Retrieve a paginated list of all document processing jobs for your organization. Supports filtering by status, date range, and sorting.

GET/v1/jobs

Request

Headers

ParameterTypeDescription
Authorizationrequired
stringBearer token or API key for authentication
X-API-Key
stringAlternative: API key for authentication (use instead of Authorization)

Query Parameters

ParameterTypeDescription
page
numberPage number for pagination
Default: 1
limit
numberNumber of jobs per page (max 100)
Default: 20
status
stringFilter by job status: pending, processing, completed, or failed
startDate
stringFilter jobs created on or after this date (ISO 8601 format)
endDate
stringFilter jobs created on or before this date (ISO 8601 format)
sortBy
stringSort field: createdAt or updatedAt
Default: createdAt
sortOrder
stringSort order: asc or desc
Default: desc
documentType
stringFilter by document type: invoice, receipt, contract, or general

Example Requests

curl
# Basic list request
curl -X GET "https://api.docurift.com/v1/jobs" \
-H "X-API-Key: frc_your_api_key_here"

# With filters
curl -X GET "https://api.docurift.com/v1/jobs?status=completed&limit=50&sortBy=createdAt&sortOrder=desc" \
-H "X-API-Key: frc_your_api_key_here"

# Date range filter
curl -X GET "https://api.docurift.com/v1/jobs?startDate=2024-01-01T00:00:00Z&endDate=2024-01-31T23:59:59Z" \
-H "X-API-Key: frc_your_api_key_here"
python
import requests
import os
from datetime import datetime, timedelta

API_KEY = os.getenv('DOCURIFT_API_KEY')
API_URL = 'https://api.docurift.com/v1'

# Basic list
response = requests.get(
  f'{API_URL}/jobs',
  headers={'X-API-Key': API_KEY}
)

# With filters
params = {
  'status': 'completed',
  'limit': 50,
  'sortBy': 'createdAt',
  'sortOrder': 'desc'
}

response = requests.get(
  f'{API_URL}/jobs',
  headers={'X-API-Key': API_KEY},
  params=params
)

jobs = response.json()
print(f"Total jobs: {jobs['data']['pagination']['total']}")

for job in jobs['data']['jobs']:
  print(f"Job {job['id']}: {job['status']} ({job['progress']}%)")

# Date range filter
end_date = datetime.utcnow()
start_date = end_date - timedelta(days=7)

params = {
  'startDate': start_date.isoformat() + 'Z',
  'endDate': end_date.isoformat() + 'Z'
}

response = requests.get(
  f'{API_URL}/jobs',
  headers={'X-API-Key': API_KEY},
  params=params
)

last_week_jobs = response.json()
print(f"Jobs in last 7 days: {last_week_jobs['data']['pagination']['total']}")
javascript
const API_KEY = process.env.DOCURIFT_API_KEY;
const API_URL = 'https://api.docurift.com/v1';

// Basic list
const response = await fetch(`${API_URL}/jobs`, {
headers: {
  'X-API-Key': API_KEY
}
});

const jobs = await response.json();
console.log(`Total jobs: ${jobs.data.pagination.total}`);

// With filters
const params = new URLSearchParams({
status: 'completed',
limit: '50',
sortBy: 'createdAt',
sortOrder: 'desc'
});

const filteredResponse = await fetch(`${API_URL}/jobs?${params}`, {
headers: {
  'X-API-Key': API_KEY
}
});

const filteredJobs = await filteredResponse.json();

for (const job of filteredJobs.data.jobs) {
console.log(`Job ${job.id}: ${job.status} (${job.progress}%)`);
}

// Paginate through all jobs
async function getAllJobs() {
const allJobs = [];
let page = 1;
let hasMore = true;

while (hasMore) {
  const res = await fetch(`${API_URL}/jobs?page=${page}&limit=100`, {
    headers: { 'X-API-Key': API_KEY }
  });

  const data = await res.json();
  allJobs.push(...data.data.jobs);

  hasMore = data.data.pagination.hasNextPage;
  page++;
}

return allJobs;
}

Response

Success Response

response.json
{
"success": true,
"data": {
  "jobs": [
    {
      "id": "job_abc123def456",
      "status": "completed",
      "progress": 100,
      "documentType": "invoice",
      "documentId": "doc_xyz789ghi012",
      "createdAt": "2024-01-27T10:30:00Z",
      "updatedAt": "2024-01-27T10:30:45Z",
      "completedAt": "2024-01-27T10:30:45Z"
    },
    {
      "id": "job_def456ghi789",
      "status": "processing",
      "progress": 67,
      "documentType": "receipt",
      "createdAt": "2024-01-27T10:35:00Z",
      "updatedAt": "2024-01-27T10:35:20Z"
    },
    {
      "id": "job_ghi789jkl012",
      "status": "failed",
      "progress": 15,
      "documentType": "contract",
      "error": {
        "code": "UNSUPPORTED_FORMAT",
        "message": "The document format is not supported"
      },
      "createdAt": "2024-01-27T10:25:00Z",
      "updatedAt": "2024-01-27T10:25:10Z",
      "failedAt": "2024-01-27T10:25:10Z"
    },
    {
      "id": "job_jkl012mno345",
      "status": "pending",
      "progress": 0,
      "documentType": "general",
      "createdAt": "2024-01-27T10:40:00Z",
      "updatedAt": "2024-01-27T10:40:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 156,
    "totalPages": 8,
    "hasNextPage": true,
    "hasPrevPage": false
  }
}
}

Response Fields

ParameterTypeDescription
jobs
arrayArray of job objects
jobs[].id
stringUnique identifier for the job
jobs[].status
stringCurrent job status: pending, processing, completed, or failed
jobs[].progress
numberProcessing progress percentage (0-100)
jobs[].documentType
stringType of document being processed
jobs[].documentId
stringID of the created document (only for completed jobs)
jobs[].error
objectError details (only for failed jobs)
jobs[].createdAt
stringISO 8601 timestamp when the job was created
jobs[].updatedAt
stringISO 8601 timestamp when the job was last updated
pagination.page
numberCurrent page number
pagination.limit
numberNumber of items per page
pagination.total
numberTotal number of jobs matching the filter criteria
pagination.totalPages
numberTotal number of pages available
pagination.hasNextPage
booleanWhether there is a next page of results
pagination.hasPrevPage
booleanWhether there is a previous page of results
💡

Empty Results

When no jobs match your filter criteria, the API returns an empty jobs array with pagination.total set to 0.

Error Responses

error.json
{
"success": false,
"error": {
  "code": "INVALID_PARAMETER",
  "message": "Invalid status filter. Must be one of: pending, processing, completed, failed"
}
}

Common Error Codes

| Code | Status | Description | |------|--------|-------------| | UNAUTHORIZED | 401 | Missing or invalid authentication credentials | | INVALID_API_KEY | 401 | The provided API key is invalid or expired | | INVALID_PARAMETER | 400 | Invalid query parameter value | | INVALID_DATE_FORMAT | 400 | startDate or endDate is not a valid ISO 8601 date | | INVALID_DATE_RANGE | 400 | endDate is before startDate | | RATE_LIMIT_EXCEEDED | 429 | Too many requests, please slow down |

⚠️

Pagination Limits

The maximum value for the limit parameter is 100. Requesting more than 100 items per page will automatically be capped at 100.

Filtering Examples

Filter by Status

curl
# Get all pending jobs
curl -X GET "https://api.docurift.com/v1/jobs?status=pending" \
-H "X-API-Key: frc_your_api_key_here"

# Get all failed jobs
curl -X GET "https://api.docurift.com/v1/jobs?status=failed" \
-H "X-API-Key: frc_your_api_key_here"

Filter by Date Range

curl
# Get jobs from the last 24 hours
curl -X GET "https://api.docurift.com/v1/jobs?startDate=2024-01-26T10:00:00Z" \
-H "X-API-Key: frc_your_api_key_here"

# Get jobs from a specific week
curl -X GET "https://api.docurift.com/v1/jobs?startDate=2024-01-15T00:00:00Z&endDate=2024-01-21T23:59:59Z" \
-H "X-API-Key: frc_your_api_key_here"

Sort by Most Recently Updated

curl
curl -X GET "https://api.docurift.com/v1/jobs?sortBy=updatedAt&sortOrder=desc" \
-H "X-API-Key: frc_your_api_key_here"

Combined Filters

curl
# Get completed invoice jobs from the last week, sorted by creation date
curl -X GET "https://api.docurift.com/v1/jobs?status=completed&documentType=invoice&startDate=2024-01-20T00:00:00Z&sortBy=createdAt&sortOrder=desc&limit=50" \
-H "X-API-Key: frc_your_api_key_here"