Skip to main content
When creating a job, you can optionally provide a callbackUrl to receive a notification when the job completes. This allows you to avoid polling the job status endpoint.

Setting Up Callbacks

To enable callbacks, include a callbackUrl field in your job creation request body:

Callback URL Requirements

  • Protocol: Must be HTTPS (HTTP and localhost URLs are not allowed)
  • Format: Must be a valid URL
  • Example: https://api.example.com/webhooks/veritus

Callback Payload

When a job completes successfully, a POST request will be sent to your callback URL with the following JSON payload:

Callback Payload Fields

  • data: Array of paper results (same structure as the results field in the job status response)
  • event: Event metadata:
    • api_version: API version used (currently “v1”)
    • createdAt: ISO 8601 timestamp when the result was created
    • id: Unique result identifier
  • job: Job information:
    • id: The job ID that was returned when creating the job

Callback Behavior

  • When Sent: Callbacks are only sent when a job completes successfully (status: "success")
  • Retries: The system automatically retries failed callback requests
  • No Callback on Error: If a job fails (status: "error"), no callback will be sent
  • HTTP Method: Callbacks are sent via POST request
  • Content-Type: The request body is JSON with Content-Type: application/json

Handling Callbacks

Your callback endpoint should:
  1. Return 200 OK: Respond with a 200 status code to acknowledge receipt
  2. Process Quickly: Keep processing time under 10 seconds to avoid timeouts
  3. Handle Duplicates: Be idempotent - the same callback may be sent multiple times due to retries
  4. Validate Job ID: Verify the job.id matches a job you created
  5. Store Results: Save the results data for later retrieval

Example Callback Handler

Here’s an example of a simple callback handler:

Testing Callbacks

To test callbacks locally, you can use services like: Note: Localhost URLs are not accepted. You must use a publicly accessible HTTPS endpoint.