Skip to main content

The two response shapes

A collection always returns the same five fields, whichever collection it is:
A single record returns the resource name and one object. Note that data is an object here, not an array:
An error is always this, and never an HTML page:
Branch on error.code, not on the message. The codes are stable; the messages are written for a person reading a log and may be reworded.

Every code

An unknown or revoked key gives the identical answer, so probing never confirms that a key used to exist. If you have just rotated a key and are seeing invalid_credential, you are almost certainly still sending the old one.
An unknown filter is refused, not ignored. Sending ?vendor= where the API expects ?vendor_id= returns 400 rather than quietly returning every record, so a sync job cannot pull unfiltered data for a month without anyone noticing.

Which failures deserve a retry

429, 500, 502 and 503. Everything else is a request that will fail the same way however many times you send it, and retrying a 401 in a loop just fills the access log. When a response carries Retry-After, wait that many seconds. Otherwise back off: 1, 2, 4, 8 seconds and so on. 503 not_yet_provisioned is worth handling properly. It means a Vensight deploy is in flight and the database is a few seconds behind the code. It is brief, not an outage, and the next attempt after Retry-After almost always succeeds. Treating it as a hard failure is how a nightly job appears to break on the one night someone shipped a change.

Headers on every response

On a 401 you also get WWW-Authenticate: Bearer realm="Vensight API", so a standard HTTP client can tell what kind of credential is wanted.

Rate limits

There is no published rate limit, and none is enforced today. That describes the API as it is now rather than a promise, so build as though one will arrive: keep limit at 200 for backfills so you make fewer requests, retry 429 as above, and prefer updated_since or a webhook over polling a whole collection on a short interval. If you expect a very high volume, get in touch before you build.

Your requests are logged

Every call is recorded with the key that made it, the path, the query string, the status, the row count, the duration and the address it came from. Calls refused for a missing or unknown key are recorded too, without a key, since there is none to name.
There is no screen for this log yet. The records are being written, and the Vensight team can pull them on request, but nothing in the product displays them today. To audit what a key has been doing, ask us.
Because the query string is recorded, never put a credential in a URL. The API refuses a key sent that way for exactly this reason.