V2 API Architecture
The URLert V2 API is designed around two core interaction patterns. Understanding when an endpoint is Synchronous (instant) versus Hybrid (async-capable) is key to building robust integrations.
The Hybrid Pattern (Async-Capable)
Most operations—such as threat analysis and domain classification—require significant processing time, which is why the API is asynchronous by default. For resource types that support it (such as Domain Classification), the API checks for existing results first to optimize for performance and cost; if a fresh result is found in our cache, it is returned immediately at a reduced price.
If a fresh result exists, it is returned immediately in the response body.
If no result exists, a background job is spawned and a job ID is returned.
The Synchronous Pattern (Lookup)
Retrieval operations are strictly synchronous. These endpoints only interact with existing data and are guaranteed never to trigger new background processing.
The requested data is returned immediately.
If the data does not exist, 404 is returned. This does not incur any charges.
Billing & Refunds
The V2 API standardizes patterns for how charges and refunds are handled for async tasks.
The X-Charge-Amount Header
To ensure transparent usage tracking, every V2 API response includes the X-Charge-Amount header. This value represents the precise amount deducted from your organization's balance
for that specific request.
For detailed pricing tiers and category-specific costs, please refer to the main Pricing Page.
The V2 Process Flow
Follow this 3-step sequence for any V2 resource request.
1. Checking Cache (Optional)
GETFor long-lived resources like Domain Classifications, you can use GET to check if a result already exists. This is the fastest, most cost-effective way to retrieve data when immediate real-time analysis isn't required.
curl -X GET "https://api.urlert.com/v2/domain-classification/example.com" \
-H "Authorization: Bearer YOUR_API_KEY"2. Request Creation
POSTIf Step 1 is not applicable or returns a 404, submit a POST request to initiate processing. The API will either return immediate results (internal cache hit) or spawn a background job.
curl -X POST "https://api.urlert.com/v2/domain-classification" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain": "example.com"}'{
"message": "Classification in progress",
"status_url": "https://api.urlert.com/v2/domain-classification/jobs/bb0e8400-e29b-41d4-a716-446655440006",
"timeout_seconds": 30.0
}3. Polling Results
GETUsing the status_url from Step 2, poll at a reasonable interval (e.g. 2-5s).
Depending on the job progress, you will receive one of the following standard responses.
curl -X GET "https://api.urlert.com/v2/domain-classification/jobs/bb0e8400-e29b-41d4-a716-446655440006" \
-H "Authorization: Bearer YOUR_API_KEY"Standard Job Responses
The polling endpoint returns a consistent JSON structure across all V2 resources. Depending on the job progress, you will receive one of the following responses.
Waiting State
The job is currently in the queue or actively running across our workers. The result field remains null during this phase.
{
"status": "processing",
"job_id": "bb0e8400-e29b-41d4-a716-446655440006",
"error": null,
"result": null
}Success State
The job finished successfully. The result object is now populated with
the full data payload specific to the resource.
{
"status": "complete",
"job_id": "bb0e8400-e29b-41d4-a716-446655440006",
"error": null,
"result": {
"domain": "example-startup.com",
"category": "Technology/SaaS",
"confidence": 0.98,
"generated_at": "2023-10-27T10:00:05Z"
}
}Error State
The task encountered a system error or timeout. The error field
contains the failure message. No charge applied.
{
"status": "failed",
"job_id": "bb0e8400-e29b-41d4-a716-446655440006",
"error": "Job exceeded maximum processing time",
"result": null
}