Skip to content

GUIDES

Three things to get right before you ship.

Practical notes for integrating the Competitive Signals API: how keys behave, what the limiter does under load, and how to verify a webhook you did not expect. For every endpoint and field, read the API Reference.

Authentication

Create a key in the dashboard under Settings → API Keys. The raw key is shown once — copy it immediately; only its hash is stored. Send it as a Bearer token on every request.

HEADER
Authorization: Bearer vt_live_xxxxxxxx…

A 401 means the key is missing, malformed, or revoked. The response never distinguishes which, to prevent key enumeration.

FIVE ACTIVE KEYS

A workspace may hold up to five at once, so rotation never needs downtime.

ROTATE FORWARD

Generate the new key, deploy it, then revoke the old one.

REVOCATION IS FINAL

Immediate and permanent. A revoked key keeps returning 401 forever.

Rate limits

PLAN TIERREQ / MIN/V1/SNAPSHOT PER HOUR
Free60Not available (pro+ only)
Pro3003
Team1,0003

The per-minute limit is enforced per key. Exceeding it returns 429 with a Retry-After header, in seconds until the window frees up. /v1/snapshot carries a separate hard cap of three accepted calls per rolling hour, because each one triggers a real collection run.

THE LIMITER FAILS CLOSED

If the rate-limit check itself errors, the request is rejected with 429 rather than passed through. Handle 429 as a retry, not as an outage.

Webhook signature verification

X-Vaarta-Signaturesha256= followed by the HMAC-SHA256, hex-encoded, of the string X-Vaarta-Timestamp, a full stop, then the raw request body.
X-Vaarta-TimestampUnix seconds when the delivery was signed. It is part of the signed string, so changing it fails the signature. Retries of one delivery repeat it.
X-Vaarta-DeliveryA per-delivery UUID, repeated on retries. Not signed: dedupe on delivery_id in the verified body, which holds the same value.

Verify each delivery against your subscription secret, shown once on creation. The body is canonical JSON with object keys sorted. HMAC the timestamp header, a full stop and the exact raw bytes you receive. Do not re-serialize the body.

RECEIVER
signed = header["X-Vaarta-Timestamp"] + "." + raw_request_body
expected = "sha256=" + hex( HMAC_SHA256(secret, signed) )

# 1. constant-time compare against the header
if not constant_time_equals(expected, header["X-Vaarta-Signature"]):
    reject  # 401, bad signature

# 2. reject stale deliveries (replay protection); the timestamp is signed
if abs(now_unix_seconds - int(header["X-Vaarta-Timestamp"])) > 300:
    reject  # signature is valid but the delivery is too old

# 3. claim delivery_id from the VERIFIED body (never the unsigned header) with one atomic insert
event = json_parse(raw_request_body)
begin transaction
if not insert_unique(event["delivery_id"]):  # INSERT ... ON CONFLICT DO NOTHING; false if it was already there
    rollback
    return 200  # already claimed: acknowledge and do nothing

# 4. queue the work in the same transaction, commit, and answer within 5 seconds
enqueue(event)  # the slow part runs from the queue; if this throws, roll back and return 500
commit
return 200

The timestamp is part of the signed string, so a captured delivery cannot be given a fresh one: changing it fails step 1, and leaving it alone fails step 2 once it is outside the freshness window. Five minutes is a sensible default. A retry repeats the same delivery_id, so step 3 acknowledges it without queueing it twice. Claim the id with an insert that fails on a duplicate (a unique column and ON CONFLICT DO NOTHING), not a lookup followed by an insert: two attempts in flight would both pass the lookup. Claim it and queue the work in one transaction, so a failure on your side rolls both back and the retry is handled rather than lost.

Answer within 5 seconds. The sender abandons an attempt after 5 seconds and retries a timeout 1, 4 and 16 seconds later with the same delivery_id. If all four attempts time out, the delivery counts as failed even if you processed it: three failed deliveries in a row stop the run and ten disable the subscription. So verify, claim, queue and answer first, and do the slow part afterwards.

Register a subscription with POST /v1/webhooks or the MCP tool subscribe_events. The secret comes back once, in that response. Filters narrow signal.created to what you act on: competitors, signal_types, min_materiality, min_confidence and min_severity. They combine with AND, and a filter the API does not recognise is rejected rather than ignored. Each signal.created event carries the same signal object as GET /v1/signals. briefing.created and digest.created carry their own, smaller object under the same signal key, so branch on event_type before you read it. A run that matches more than 50 signals sends the 50 most material and marks each with truncated. A delivery that fails all its retries is not sent again, and a run stops sending to a subscription after three failures in a row, so do not wait for a marker: GET /v1/signals is how you catch up. It can also list rows that were never pushed (new-repository and new-subdomain rows, for workspaces that opted into them), so read a row you did not receive; do not treat it as a lost delivery.

Subscribe to pricing changes on one competitor
POST https://api.vaartahq.com/v1/webhooks
Authorization: Bearer vt_live_xxxxxxxx…
Content-Type: application/json

{
  "url": "https://example.com/hooks/vaarta",
  "event_types": ["signal.created"],
  "filters": {
    "competitors": ["Acme"],
    "signal_types": ["pricing_change"],
    "min_materiality": 0.8
  }
}