Skip to main content
Read, export and erase the people of your workspace from your server. Every route is on https://api.maqetin.com, takes Authorization: Bearer mq_sec_… and acts in the key’s own workspace. A public key is a 401, and a key without the scope is a 403. A secret key made with no scopes has contacts:read only.

Two ids

userId is your own key for the person, the one you send with identify. id is the platform id Maqetin makes, and the routes that read one contact take it as contactId. To find it, list with userId and read id from data.items.

Limits

List contacts

GET /v1/public/contacts lists the contacts of the workspace, the most recently updated first.
A prefix of the email address or of the userId, 1 to 254 characters.
string
Your own key for the person, matched exactly, 1 to 256 characters.
number
default:"50"
The page size, a whole number from 1. At most 100.
string
The nextCursor of the page before.
object[]
required
string | null
required
The cursor of the next page, or null on the last page.
number | null
required
On the first page, the number of contacts in the workspace, whatever the filter. On a page read with a cursor, null.
boolean
required
true when the workspace has more than 10,000 contacts, so total is 10,000.

Get a contact

GET /v1/public/contacts/{contactId} reads one contact with its 20 newest events, including those of the person’s earlier anonymous visits. The reply has the fields of a listed contact, and these:
string
required
The platform id, id in a list.
boolean
required
Whether journey email may reach the person.
object | null
required
The suppression of the person’s address in your workspace, or null. It has a reason, one of hard_bounce, complaint, unsubscribe or manual, and the time it began, at. No message reaches a suppressed address.
string | null
required
The time of the person’s newest event, or null when there is none. An identify alone is not an event.
object[]
required
At most 20 devices, each with platform (ios, android, web or null) and lastSeenAt.
string | null
required
The time zone you sent as the timezone trait, or null.
object[]
required
The newest events, each with eventId, event, timestamp, userId, anonymousId and properties.

List the messages of a contact

GET /v1/public/contacts/{contactId}/messages lists the messages sent to the contact, the newest first.
string
required
The platform id.
number
default:"25"
The page size, a whole number from 1. At most 100.
string
The nextCursor of the page before.
object[]
required
string | null
required
The cursor of the next page, or null on the last page.

Get one message

GET /v1/public/contacts/{contactId}/messages/{messageId} reads one message of the contact with every event of it, the oldest first. A message of another contact answers 404. The reply has the fields of a listed message, and data.events.
string
required
The platform id.
string
required
The message’s id in the list.
object[]
required
Each event once, with eventId, type (sent, deferred, delivered, opened, clicked, bounced, complained, unsubscribed or failed), timestamp, likelyBot and reasonClass (hard, soft, policy, egress or null). An open or a click by a mail scanner is here, flagged likelyBot, though the counts leave it out.

Export a contact

GET /v1/public/contacts/{contactId}/export returns everything stored about the person, profile, events and messages, a page at a time. Use it to answer a person who asks for their data.
string
required
The platform id.
string
The events.nextCursor of the reply before.
string
The messages.nextCursor of the reply before.
The first call has no cursor and starts both sections. A section is complete when its nextCursor is null. Send eventsCursor and messagesCursor only for the sections that are not complete: a section you send no cursor for comes back empty.
object
required
In every reply: id, userId, email, anonymousIds, emailOptIn, traits, devices, lastSeenAt, createdAt and updatedAt.
object
required
items and nextCursor. Each event has eventId, event, timestamp, receivedAt, userId, anonymousId, channel, properties and context.
object
required
items and nextCursor. Each item is one event of a message sent to the person, with its messageId, eventType, timestamp, templateId and likelyBot. A click or an open by a security scanner is here, flagged likelyBot.

Delete a contact

DELETE /v1/public/contacts/{contactId} erases the person: their profile, their events, the events of their messages and their place in every journey. It needs the contacts:delete scope.
string
required
The platform id.
boolean
required
true. A repeat answers 404.
A delete cannot be undone. The suppression list keeps its entries: an address that was suppressed stays suppressed. A delete that fails part way leaves the contact in place; send the same request again to finish it.

Errors

Errors lists the rest.