Skip to content

API reference/entity

Run a business monitor now

POST/api/v1/entity/monitors/{monitorId}/run

authentication
Secret API key as a bearer token
billing
Billed per identifier exactly like a single lookup, with 7-day repeats free.

Re-check the list now instead of waiting for the schedule. The run is queued and answers 202; poll the monitor for its results.

Parameters

name in type description
monitorIdrequiredpathinteger

Example request

curl -X POST https://spaw.co/api/v1/entity/monitors/{monitorId}/run \
  -H "Authorization: Bearer sk_live_…"
const response = await fetch('https://spaw.co/api/v1/entity/monitors/{monitorId}/run', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_live_…',
  },
});
const result = await response.json();
import requests

response = requests.post(
    'https://spaw.co/api/v1/entity/monitors/{monitorId}/run',
    headers={'Authorization': 'Bearer sk_live_…'},
)
result = response.json()
$ch = curl_init('https://spaw.co/api/v1/entity/monitors/{monitorId}/run');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => ['Authorization: Bearer sk_live_…'],
]);
$result = json_decode(curl_exec($ch), true);
from spaw import Client

client = Client('sk_live_…')
result = client.run_entity_monitor(monitor_id)
import Spaw from 'spaw';

const spaw = new Spaw({ apiKey: 'sk_live_…' });
const result = await spaw.runEntityMonitor(monitorId);
use Spaw\Client;

$spaw = new Client('sk_live_…');
$result = $spaw->runEntityMonitor($monitorId);

This endpoint has no console on its page. It writes to your account. A documentation page can show you the request; making the change is for the dashboard or for a call you make yourself.

Responses

202The run is queued.

401The key is missing, malformed, or revoked.

{
    "success": false,
    "error": {
        "code": "UNAUTHENTICATED",
        "message": "Provide a valid API key as a bearer token.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

404No such record on this account.

{
    "success": false,
    "error": {
        "code": "NOT_FOUND",
        "message": "No record with that id on this account.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

429Over 5 requests per second for the key. Retry after the limit resets.

{
    "success": false,
    "error": {
        "code": "RATE_LIMITED",
        "message": "Too many requests. Retry after the limit resets.",
        "request_id": "req_01m1kgdm4xngzmbmff68g94w0c"
    }
}

Error codes

Failures answer { success: false, error: { code, message, request_id } }. Each code has its own page.

markdown version·openapi.json