Jobs API

Background Job Management

Wilkins Software

Jobs API reference

Call the API from trusted server code. Supply Authorization: Bearer with your jobs token and x-jobs-producer with your service name. Tokens, senders, recipients and quotas are scoped to each producer.

POST /api/send-email

{
  "to": "recipient@example.com",
  "from": "accounts@wilkins.software",
  "subject": "Welcome",
  "text": "<h1>Welcome</h1>",
  "expiresAt": "2030-01-01T12:00:00Z"
}

The text field contains HTML. to accepts one address or an array of up to 50 addresses. expiresAt is optional and may shorten the default 24-hour expiry. Requests are limited to 128 KiB.

Supply Idempotency-Key for retries of the same business event. Reusing that key with changed content returns HTTP 409; intentional resends require a new key.

{
  "message": "ok",
  "status": "Email task successfully triggered",
  "handleId": "job-identifier"
}

HTTP 200 confirms durable acceptance. It does not confirm delivery.

POST /api/capture-lead

Supply emailAddress and firstName or lastName. The acknowledgment uses the existing thank-you template. Optional expiresAt and Idempotency-Key behave as above. Its acceptance status is “Lead successfully captured”. No CRM write is performed.

GET /api/jobs/:handleId

Returns the producing service’s job state, attempts, expiry and recipient outcomes identified by address hashes. States are queued, sending, accepted, delivered, failed, expired and uncertain. An uncertain attempt requires reconciliation before an operator decides whether to resend.

Errors and health

400 invalid payload; 401 invalid credentials; 403 disallowed sender or recipient; 404 unknown or inaccessible job; 409 conflicting idempotency key; 413 oversized request; 429 producer quota reached; 503 acceptance paused or unavailable.

GET /healthcheck, /__status and /version are public. The simulated example, Sheets and quote-request endpoints return HTTP 410.