When creating a job, you can optionally provide aDocumentation Index
Fetch the complete documentation index at: https://docs.veritus.ai/llms.txt
Use this file to discover all available pages before exploring further.
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 acallbackUrl 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 theresultsfield in the job status response)event: Event metadata:api_version: API version used (currently “v1”)createdAt: ISO 8601 timestamp when the result was createdid: 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:- Return 200 OK: Respond with a 200 status code to acknowledge receipt
- Process Quickly: Keep processing time under 10 seconds to avoid timeouts
- Handle Duplicates: Be idempotent - the same callback may be sent multiple times due to retries
- Validate Job ID: Verify the
job.idmatches a job you created - 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:- ngrok - Create HTTPS tunnels to localhost
- webhook.site - Temporary webhook URLs for testing
- RequestBin - HTTP request inspector