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.
Authorization: Bearer sk_your_secret_keySend events#
POST https://enterprise.optiq.studio/api/v1/events| Body | Type | Description |
|---|---|---|
| eventsrequired | Event[] | Up to 500. Each takes the fields on every event. |
{
"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" }
}
]
}{ "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#
DELETE https://enterprise.optiq.studio/api/v1/people| Body | Type | Description |
|---|---|---|
| email | phone | person_hash | visitor_idrequired | string | Who. One is enough. |
{ "deleted": 12 }Read a profile#
GET https://enterprise.optiq.studio/api/v1/people?email=ama@example.gm
Authorization: Bearer sk_your_secret_keyAlso ?phone=, ?person_hash= or ?visitor_id=. Answers the profile, or 404 for someone the company has never seen.
Suggestions#
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_keyA 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.
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#
| Status | When | What to do |
|---|---|---|
| 400 | The body is not JSON. | Send JSON. |
| 401 | The key is not one of ours, or was revoked. | Make a new secret key on the Developer page. |
| 413 | More than 500 events, or 2 MB, in one call. | Send them in parts (the SDK does). |
| 429 | More than 600 events in a minute for one source. | Wait for Retry-After (60 s) and send the rest. |
| 5xx | Something failed on our side. | Send again: each event_id counts once. |
Last updated 2026-11-04 UTC. The SDK is open source under the MIT licence. Tell us what is missing.