Requests

Create Async Task for several phone numbers

Submit a batch of phone numbers for an asynchronous HLR or Validate lookup. Each number in keys can carry a uid that is echoed back with its result. The response returns the task_id plus the estimated cost and valid / invalid / duplicate counts; poll /result/{job_id} or /metadata/{job_id} with it, or set respond_url to receive a webhook when the task completes.

post/async/{req_type}

Request

  • Base URL
    https://api.commpeak.com/lookup
  • URL
    https://api.commpeak.com/lookup/async/{req_type}
  • Auth
    API key in header Authorization

Path parameters

req_type'validate' | 'hlr' required

Request body

respond_urlstring nullable

Endpoint that will receive the result callback when the task completes.

respond_method'post' | 'post_json'
respond_format'metadata' | 'metadata_with_results'

Example request

{
  "keys": [
    {
      "key": "12125551234",
      "uid": "demo-1"
    }
  ],
  "respond_format": "metadata_with_results",
  "respond_method": "post_json",
  "respond_url": "https://demo.example.com/webhooks/lookup"
}

Response

Successful Response

costnumber

Estimated total cost of the task in customer credits.

task_idstring required

Identifier of the created task; use it on the result/metadata/download endpoints.

validinteger nullable

Count of valid numbers detected at submission time.

invalidinteger nullable

Count of invalid numbers detected at submission time.

duplicatesinteger nullable

Numbers that appeared more than once in the request (charged once).

Example response

{
  "cost": 0.003,
  "duplicates": 0,
  "invalid": 0,
  "task_id": "demo-task-1234",
  "valid": 1
}

Changes

No recorded changes to this operation across all 1 revision of this API.