Send feedback

REST API

Everything the SDK does is plain HTTPS and JSON, for any language.

Keys#

Server calls send the source’s secret key as a bearer token. The browser collector takes the publishable key in the body and checks the page’s domain.

HTTP
Authorization: Bearer sk_your_secret_key

Send events#

HTTP
POST https://enterprise.optiq.studio/api/v1/events
BodyTypeDescription
eventsrequiredEvent[]Up to 500. Each takes the fields on every event.
Request
{
  "events": [
    {
      "event_id": "dep_1042",
      "name": "first_deposit",
      "occurred_at": "2026-11-04T10:15:00Z",
      "person_hash": "<sha256 of the trimmed, lower-case email>",
      "value": 500,
      "currency": "GMD",
      "properties": { "branch": "Serrekunda" }
    }
  ]
}
Response 200
{ "accepted": 1, "duplicates": 0, "rejected": [] }

rejected lists each event that could not be kept, with its index and why (for example "older than 90 days"); the others are kept.

Forget a person#

HTTP
DELETE https://enterprise.optiq.studio/api/v1/people
BodyTypeDescription
email | phone | person_hash | visitor_idrequiredstringWho. One is enough.
Response 200
{ "deleted": 12 }

Read a profile#

HTTP
GET https://enterprise.optiq.studio/api/v1/people?email=ama@example.gm
Authorization: Bearer sk_your_secret_key

Also ?phone=, ?person_hash= or ?visitor_id=. Answers the profile, or 404 for someone the company has never seen.

Suggestions#

HTTP
GET https://enterpriseapi-951694748196.europe-west2.run.app/api/v1/suggest?key=pk_...&visitor=<optiq_vid>&product=SKU-42&limit=8     (a browser)
GET https://enterprise.optiq.studio/api/v1/suggest?email=ama@example.gm&limit=4                                         (your server)
Authorization: Bearer sk_your_secret_key

A browser asks with the publishable key, from your domains, for its own visitor id only; your server asks with the secret key, by email, phone, person hash or visitor id. Answers {suggestions, recentlyViewed}.

The browser collector#

The snippet and SDK send to the collector. Use it directly only for a browser or app of your own making.

HTTP
POST https://optiq-collect-951694748196.europe-west2.run.app/e
Content-Type: text/plain

{"key": "pk_your_publishable_key",
 "visit": {"id": "<20 letters and digits>", "started_at": "...", "landing": "/offer", "referrer": "...",
           "utm": {...}, "click": "fbclid", "ref": "AbCd1234", "lang": "en-GB", "tz": "Africa/Banjul"},
 "events": [{"event_id": "...", "name": "page_view", "visitor_id": "...", "page_url": "..."}]}

It answers 204, or 401 for an unknown key and 403 for a page outside the source’s domains. Up to 50 events a call, from the last day. A website’s key works only from its domains; an app’s key works from anywhere.

Limits and errors#

StatusWhenWhat to do
400The body is not JSON.Send JSON.
401The key is not one of ours, or was revoked.Make a new secret key on the Developer page.
413More than 500 events, or 2 MB, in one call.Send them in parts (the SDK does).
429More than 600 events in a minute for one source.Wait for Retry-After (60 s) and send the rest.
5xxSomething failed on our side.Send again: each event_id counts once.
Key point: Every write is safe to repeat. After any failure, send the same events with the same event_id.

Last updated 2026-11-04 UTC. The SDK is open source under the MIT licence. Tell us what is missing.