Two ids
Every profile has two ids. userId is your own key for the person. id is the platform id Maqetin makes. A route that reads one profile takes the platform id.
Set traits with identify
Identify upserts a profile. It creates the profile the first time and updates its traits after that.
| Trait | Type |
|---|---|
| A valid email address | |
| phone, firstName, lastName, plan, country | A string |
| createdAt | An ISO date-time in UTC |
| Any other trait | Any JSON value |
{
"userId": "user_123",
"traits": {
"email": "ada@example.com",
"firstName": "Ada",
"lastName": "Lovelace",
"plan": "pro"
},
"channel": "rest"
}The events page lists every field of the call.
Anonymous visits
Before someone signs in, the SDK tags their events with an anonymousId. Send the same anonymousId with identify and the earlier events join the profile.
The SDK keeps the anonymous id in the browser's storage. reset() starts a new one.
Read a profile from your server
A secret key with the contacts:read scope reads profiles. A key made with no scopes only reads contacts.
| Route | What it does | Scope |
|---|---|---|
| GET /v1/public/contacts | Lists profiles. Filter with search (a prefix of the email or the userId), userId (an exact match), limit and cursor. | contacts:read |
| GET /v1/public/contacts/:contactId | Reads one profile and its activity. | contacts:read |
| GET /v1/public/contacts/:contactId/export | Returns everything stored about the person, a page at a time. | contacts:read |
| DELETE /v1/public/contacts/:contactId | Erases the person. | contacts:delete |
To find the platform id from your own key, list with userId. The profiles are in data.items, and each has an id.
curl 'https://api.maqetin.com/v1/public/contacts?userId=user_123' \
-H 'Authorization: Bearer mq_sec_…'Export a profile
An export returns the profile, the events and the messages. The first call has no cursor. A section is complete when its nextCursor is null. Send eventsCursor and messagesCursor for the sections that are not complete.
A click or an open by a security scanner is in the messages, flagged likelyBot.
Delete a profile
A delete erases the profile, its events, its message events and its place in every journey. The data of the reply is { "deleted": true }, and a repeat answers 404.
A delete cannot be undone. The suppression list keeps its entries.