Webmarketer API (1.0.0)
Webmarketer is a marketing tool allowing to collect interactions, events and attribute them. This API allows you to interact with your data.
Webmarketer API uses the date-time format as specified in RFC3339. RFC3339 is a profile of the ISO 8601 standard for date and time formats which is widely used in Internet protocols and standards.
The API uses this format to represent an instant with any timezone offset.
Note : If a timezone offset is not provided, the API will consider the date-time as UTC.
For example, 2022-04-01Z05:00:00, 2022-04-01T06:00:00+01:00 and 2022-04-01T03:00:00-02:00 represent the same instant in UTC, UTC +1 and UTC -2 respectively.
Everything about interactions.
An interaction is a contact between a visitor and your brand. It is either an online interaction (a website visit, called a session, made of the hits or page views collected by the tracking script) or an offline interaction, imported through the API: a phone call, a CRM record, a store visit. Every interaction carries the traffic source it was resolved to, so events attributed to it can be credited to that source.
Search interactions
This endpoint allows you to retrieve the interactions of a project.
The result is paginated and every property of the request body is optional: an empty body returns the whole project history, most recent ingestion order first is not guaranteed, so pass sort when order matters.
Two parameters select the population the endpoint looks at, each on three states: filtered for the traffic captured by one of the project's traffic filters, isBot for bot traffic. Both default to false, so an ordinary request answers on real traffic only. true restricts the response to that population, null leaves both in.
/interactions/insights takes the same two parameters with the same defaults, so a search and an insight on identical criteria cover the same interactions.
Both online (session) and offline (offline) interactions are returned. The two types do not carry the same properties: fields such as firstPage, hitCount or userAgent only exist on a session.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| since | string <date-time> Only return interactions that started at or after this date, see Date Specification section. |
| until | string <date-time> Only return interactions that started at or before this date, see Date Specification section. |
Filter predicate (object) or Filter condition (object) (Interaction filter) Filter the interactions on their own properties. Either a single predicate, or a condition grouping several of them. Conditions nest, so any boolean expression can be built. | |
object (Node query condition) Restrict the selection to the interactions resolved to the traffic source nodes matching this query. The node tree is resolved server-side: a condition matching a campaign also selects the interactions of its children. | |
| projection | Array of strings (Interaction property) non-empty Items Enum: "_id" "projectId" "type" "userId" "userLifetimeIndex" "startDate" "endDate" "duration" "ingestedAt" "createdAt" "updateDate" "userData" "integrationId" "nodeId" "externalId" "firstHitId" "hitCount" "isBot" "referrer" "referrerType" "trafficFilterId" "partialResolvedWmktId" "ndrstndUpdateDate" "rawUserData" "rawNodeData" "firstPage" "firstPageUrl" "firstPageUrl.protocol" "firstPageUrl.hostname" "firstPageUrl.port" "firstPageUrl.origin" "firstPageUrl.pathname" "firstPageUrl.search" "firstPageUrl.hash" "userAgent" "userAgent.ua" "userAgent.browser" "userAgent.browser.name" "userAgent.browser.version" "userAgent.browser.major" "userAgent.engine" "userAgent.engine.name" "userAgent.engine.version" "userAgent.os" "userAgent.os.name" "userAgent.os.version" "userAgent.device" "userAgent.device.vendor" "userAgent.device.model" "userAgent.device.type" "userAgent.cpu" "userAgent.cpu.architecture" "asn" "asn.asnId" "asn.asnName" "geo" "geo.countryCode" "geo.state" "geo.city" "geo.latitude" "geo.longitude" "geo.zipcode" The interaction properties to return. When omitted, every property listed in the When the array is provided, only the requested properties are returned, plus Nested properties can be requested on their own ( |
object Sort the results. Keys are interaction properties (the same ones accepted by | |
| offset | number <integer> Items to skip (pagination) |
| limit | number <integer> The maximum number of interactions returned. Without it the whole matching set is returned, which can be very large on an active project. Always paginate. |
| filtered | boolean or null Default: false Selects the traffic-filter population. Captured interactions carry a non-null On a project exposed to bots, filtered traffic can be a large share of the interactions. Always pass |
| isBot | boolean or null Default: false Selects the bot population. Offline interactions are never bot traffic: they are returned by |
Responses
Request samples
- Payload
{- "since": "2024-03-01T00:00:00.000Z",
- "until": "2024-03-31T23:59:59.000Z",
- "interactionFilter": {
- "type": "predicate",
- "field": "geo.countryCode",
- "operator": "equals",
- "value": "FR"
}, - "nodeFilter": {
- "id": "root",
- "type": "condition",
- "condition": "AND",
- "rules": [
- {
- "id": "rule-1",
- "type": "predicate",
- "filterId": "campaign-name",
- "operator": "contains",
- "value": "black-friday"
}
]
}, - "projection": [
- "_id",
- "startDate",
- "firstPage",
- "nodeId",
- "userData"
], - "sort": {
- "startDate": -1
}, - "offset": 0,
- "limit": 50,
- "filtered": true,
- "isBot": null
}Response samples
- 200
- 400
- 401
- 403
- 429
{- "offset": 0,
- "limit": 2,
- "count": 2,
- "total": 1280,
- "data": [
- {
- "_id": "652f1f3b8f1b2c0012a4d5e6",
- "type": "session",
- "projectId": "my-project",
- "userId": "6512ab34cd56ef7890123456",
- "startDate": "2024-03-12T09:14:22.000Z",
- "endDate": "2024-03-12T09:16:56.000Z",
- "duration": 154,
- "firstHitId": "9f8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
- "hitCount": 4,
- "isBot": false,
- "referrerType": "externalReferrer",
- "integrationId": "5f4f94defceb8e00285c2b43",
- "nodeId": "62b1c3976c88c80512b9c5ef",
- "userData": {
- "ndrstndUserId": "0f2c7f5e-64a1-4f0c-9b2e-7d1a3c5e8f40"
}
}, - {
- "_id": "652f1f3b8f1b2c0012a4d5e7",
- "type": "offline",
- "projectId": "my-project",
- "userId": "6512ab34cd56ef7890123456",
- "startDate": "2024-03-14T15:02:00.000Z",
- "createdAt": "2024-03-14T15:04:11.000Z",
- "integrationId": "5f4f94defceb8e00285c2b44",
- "nodeId": "62b1c3976c88c80512b9c5f0",
- "rawNodeData": {
- "wmktId": "1234",
- "cid": "5678"
}, - "userData": {
- "email": "example@email.com"
}
}
]
}Get an interaction by ID
This endpoint allows you to retrieve a single interaction by its id.
Every property of the interaction is returned, userData included.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string^[a-f0-9]{24}$ Example: 652f1f3b8f1b2c0012a4d5e6 The interaction id, as returned in the |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
{- "_id": "652f1f3b8f1b2c0012a4d5e6",
- "projectId": "my-project",
- "type": "session",
- "userId": "6512ab34cd56ef7890123456",
- "userLifetimeIndex": 3,
- "startDate": "2024-03-12T09:14:22.000Z",
- "endDate": "2024-03-12T09:16:56.000Z",
- "duration": 154,
- "ingestedAt": "2024-03-12T09:17:01.000Z",
- "updateDate": "2024-03-12T09:17:01.000Z",
- "firstHitId": "9f8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
- "hitCount": 4,
- "isBot": false,
- "userAgent": {
- "ua": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
- "browser": {
- "name": "Chrome",
- "version": "85.0.4183.121",
- "major": "85"
}, - "device": {
- "type": "desktop"
}, - "engine": {
- "name": "Blink",
- "version": "85.0.4183.121"
}, - "os": {
- "name": "Windows",
- "version": "10"
}, - "cpu": {
- "architecture": "amd64"
}
}, - "referrerType": "externalReferrer",
- "firstPageUrl": {
- "protocol": "https:",
- "hostname": "www.example.com",
- "pathname": "/landing",
- "search": "?utm_source=google"
}, - "asn": {
- "asnId": "1234",
- "asnName": "AS1234"
}, - "geo": {
- "countryCode": "FR",
- "state": "Île-de-France",
- "city": "Paris",
- "latitude": 48.8566,
- "longitude": 2.3522,
- "zipcode": "75000"
}, - "integrationId": "5f4f94defceb8e00285c2b43",
- "nodeId": "62b1c3976c88c80512b9c5ef",
- "userData": {
- "ndrstndUserId": "0f2c7f5e-64a1-4f0c-9b2e-7d1a3c5e8f40"
}
}Get the hits of an interaction
This endpoint allows you to retrieve the hits (page views) of an online interaction, ordered by ingestion date, oldest first.
The interaction is addressed by its firstHitId, the id of the hit that opened the session, and not by its _id. That value is returned by the search endpoint on every session interaction.
Offline interactions have no hits and no firstHitId. An unknown firstHitId returns an empty array, not a 404.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| firstHitId required | string <uuid> Example: 9f8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d The id of the first hit of the session ( |
Responses
Response samples
- 200
- 401
- 403
- 429
[- {
- "id": "9f8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
- "projectId": "my-project",
- "sessionId": "652f1f3b8f1b2c0012a4d5e6",
- "serverDate": "2024-03-12T09:14:22.000Z",
- "timezoneOffset": -60,
- "isBot": false,
- "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
- "pageUrl": {
- "protocol": "https:",
- "hostname": "www.example.com",
- "pathname": "/landing",
- "search": "?utm_source=google"
}, - "referrerType": "externalReferrer",
- "hitType": "pageview",
- "asn": {
- "asnId": "1234",
- "asnName": "AS1234"
}, - "geo": {
- "countryCode": "FR",
- "city": "Paris"
}
}
]Get interaction insights
This endpoint aggregates interactions into counters instead of returning them one by one: how many interactions, how many hits and how much time they represent, optionally broken down by a property (group) and/or by a time bucket (interval).
The response is an array with one record per combination of group and interval. Without either, it holds a single record covering the whole selection.
Default selection. filtered and isBot select the population the counters cover, each on three states, exactly as on /interactions/search. Both default to false, so an ordinary request counts real traffic only. Offline interactions are part of the counts: this is why sessionCount is a count of interactions, online and offline alike, despite its name.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| since | string <date-time> Only aggregate interactions that started at or after this date, see Date Specification section. |
| until | string <date-time> Only aggregate interactions that started at or before this date, see Date Specification section. |
Filter predicate (object) or Filter condition (object) (Interaction filter) Filter the interactions on their own properties. Either a single predicate, or a condition grouping several of them. Conditions nest, so any boolean expression can be built. | |
object (Node query condition) Restrict the selection to the interactions resolved to the traffic source nodes matching this query. The node tree is resolved server-side: a condition matching a campaign also selects the interactions of its children. | |
| group | string Break the counters down by this interaction property. It must be a single property backed by a single column: Grouping by |
| interval | string (Time interval) Enum: "year" "semester" "semesterOfYear" "quarter" "quarterOfYear" "month" "monthOfYear" "week" "weekOfYear" "day" "dayOfYear" "dayOfMonth" "dayOfWeek" "hourOfDay" "custom" Break the counters down by time bucket. Ignored unless both Chronological buckets ( |
| segmentCount | number <integer> The number of buckets to split the |
object Sort the returned records. Keys are response fields ( | |
| filtered | boolean or null Default: false Selects the traffic-filter population. |
| isBot | boolean or null Default: false Selects the bot population. |
Responses
Request samples
- Payload
{- "since": "2024-03-01T00:00:00.000Z",
- "until": "2024-03-31T23:59:59.000Z",
- "interactionFilter": {
- "type": "predicate",
- "field": "geo.countryCode",
- "operator": "equals",
- "value": "FR"
}, - "nodeFilter": {
- "id": "root",
- "type": "condition",
- "condition": "AND",
- "rules": [
- {
- "id": "rule-1",
- "type": "predicate",
- "filterId": "campaign-name",
- "operator": "contains",
- "value": "black-friday"
}
]
}, - "group": "geo.countryCode",
- "interval": "year",
- "segmentCount": 12,
- "sort": {
- "sessionCount": -1
}, - "filtered": true,
- "isBot": null
}Response samples
- 200
- 400
- 401
- 403
- 429
[- {
- "group": "FR",
- "interval": "2024-03",
- "sessionCount": 1280,
- "hitCount": 3120,
- "durationSum": 198400
}, - {
- "group": "BE",
- "interval": "2024-03",
- "sessionCount": 210,
- "hitCount": 495,
- "durationSum": 28150
}
]Create offline interaction
This endpoint allows you to create offline interaction.
An offline interaction is a user interaction with your brand out of your website that you want to track with Webmarketer.
Offline interaction can/should be only associated to a custom integration (eg: Google Spreadsheet) according to nodeData property.
nodeData property is used to identify the targeted advertiser node, you must provide a wmktId to allow Webmarketer to identify the integration and the advertiser needed properties (eg: cid for campaign ID).
userData property is used to identify the user, you must only provide identity field according to the project's user schema (eg: email, phone...).
Offline interaction ingestion is synchronous, so you will receive a 400 response if the interaction payload is invalid.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| date | string <date-time> Date of the offline interaction, see Date Specification section for more information. |
| userData | object Data used to identify the user |
| nodeData | object Data used to identify the advertiser node |
Responses
Request samples
- Payload
{- "date": "2023-08-01T22:00:00.000Z",
- "userData": {
- "email": "example@email.com"
}, - "nodeData": {
- "wmktId": "1234",
- "cid": "5678"
}
}Response samples
- 400
- 401
- 403
- 429
{- "statusCode": 400,
- "message": "wmktId must be present in nodeData",
- "error": "Bad Request"
}Create an event asynchronously
This endpoint allows you to send an event to Webmarketer.
An event represent an user action on your website or application that you want to track with Webmarketer.
Ensure you have properly configured your event types in Webmarketer before sending events and the event data you are sending matches your declared event-type schema.
With this enpoint, event ingestion is asynchronous, so you will receive a 200 response even if the event is not yet processed or invalid. You can consult the trashed events in the Webmarketer interface.
Request Body schema: application/jsonrequired
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ Your Webmarketer project id |
| eventType required | string Event Type reference of the event to send |
| eventDate | string <date-time> Date of the event, see Date Specification section for more information. |
| trackerId | string Tracker ID of the user who made the event (if not provided, Webmarketer won't be able to attach the event to user interactions) |
| nonce required | string A unique identifier used to deduplicate event in case of multiple sends |
| data required | object Data of the event (must match the event type schema) |
Responses
Request samples
- Payload
{- "projectId": "string",
- "eventType": "purchase",
- "eventDate": "1955-11-12T22:00:00Z",
- "trackerId": "23jkfs1ufeuih1fh",
- "nonce": "123456789",
- "data": {
- "first_name": "John",
- "last_name": "Locke",
- "email": "john.locke@webmarketer.io",
- "turnover": {
- "amount": 100,
- "currency": "EUR"
}
}
}Response samples
- 200
- 400
- 500
"da717cf8-cd33-4a6d-a052-68e2096f06b9"Create an event synchronously
This endpoint allows you to send an event to Webmarketer.
An event represent an user action on your website or application that you want to track with Webmarketer. Ensure you have properly configured your event types in Webmarketer before sending events and the event data you are sending matches your declared event-type schema.
Event ingestion is synchronous on this endpoint, so you will receive a 200 response when the event is fully processed.
Request Body schema: application/jsonrequired
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ Your Webmarketer project id |
| eventType required | string Event Type reference of the event to send |
| eventDate | string <date-time> Date of the event, see Date Specification section for more information. |
| trackerId | string Tracker ID of the user who made the event (if not provided, Webmarketer won't be able to attach the event to user interactions) |
| nonce required | string A unique identifier used to deduplicate event in case of multiple sends |
| data required | object Data of the event (must match the event type schema) |
Responses
Request samples
- Payload
{- "projectId": "string",
- "eventType": "purchase",
- "eventDate": "1955-11-12T22:00:00Z",
- "trackerId": "23jkfs1ufeuih1fh",
- "nonce": "123456789",
- "data": {
- "first_name": "John",
- "last_name": "Locke",
- "email": "john.locke@webmarketer.io",
- "turnover": {
- "amount": 100,
- "currency": "EUR"
}
}
}Response samples
- 200
- 400
- 409
- 500
"da717cf8-cd33-4a6d-a052-68e2096f06b9"Gets a Raw Event by ID
This endpoint allows you to retrieve a raw event by its id (Event ids are generated by Webmarketer and are globally unique)
The raw event is the event as it was sent to the Webmarketer API, without any transformation, this endpoint does not allow to get the data computed by Webmarketer.
If your want to get the computed data, please use the /projects/{projectId}/users/{id}/events or /projects/{projectId}/events/{id} endpoint.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string <uuid> (event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "e5be5b04-0721-4a6e-87eb-b880f81a12d2",
- "projectId": "your-project",
- "nonce": "e5be5b04-0721-4a6e-87eb-b880f81a12d2",
- "eventType": "complaint",
- "trackerId": "ru1cc7QHeklGu2_3MOzLkLncu3KJAQ",
- "createdAt": "2004-09-22 14:15:00Z",
- "data": {
- "message": "Our plane got lost...",
- "flight": "Oceanic 815",
- "from": "SYD - Sydney",
- "to": "LAX - Los Angeles",
- "seat": "24D",
- "first_name": "John",
- "last_name": "Locke",
- "email": "john.locke@webmarketer.io",
- "location": {
- "zipcode": "33000",
- "country": "France"
}
}
}Get Trashed events
This endpoint allows you to fetch the trashed events.
When an event cannot be processed by Webmarketer (when a mandatory field is missing, or when some fields values are invalid)
the event will be stored in the "trash collection", allowing you to investigate and debug.
⚠️ Note: the field key in the errors array will be removed in a near future, the field will be changed to a string.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
query Parameters
| since | string <date-time> Example: since=2023-08-19T22:00:00.000Z Allow you to filter by a lower date limit (optional) |
| until | string <date-time> Example: until=2023-08-21T21:59:59.999Z Allow you to filter by a upper date limit (optional) |
| offset | integer Example: offset=50 Items to skip (pagination) |
| limit | integer Example: limit=10 Max returned items (pagination) |
Responses
Response samples
- 200
- 400
- 401
- 403
- 429
{- "count": 2,
- "total": 36,
- "data": [
- {
- "_id": "4b51a5d9-4cd0-4c2b-8925-cf7c8ebc973c",
- "projectId": "my-project",
- "errors": [
- {
- "type": "invalid-field",
- "field": {
- "isReconciliationField": true,
- "entity": "user",
- "storageKey": "phone",
- "isPii": true,
- "isMostProbableLocation": false,
- "type": "phone",
- "ingestionKey": "phone",
- "optional": false
}, - "value": "0613"
}
], - "eventTypeId": "64c27df69d741cd3db897b93",
- "eventTypeRef": "call-me-back",
- "processingDate": "2023-08-21T19:22:19.600Z",
- "rawEventDate": "2023-08-21T19:22:17.095Z"
}, - {
- "_id": "99232bfd-af33-4373-af7b-6dffd2938e0b",
- "projectId": "my-project",
- "errors": [
- {
- "type": "invalid-field",
- "field": {
- "isReconciliationField": false,
- "entity": "user",
- "storageKey": "location",
- "isPii": false,
- "isMostProbableLocation": true,
- "type": "location",
- "ingestionKey": "location",
- "optional": false
}, - "value": {
- "zipcode": "wd",
- "country": "wd"
}
}
], - "eventTypeId": "64c27df69d741cd3db897b93",
- "eventTypeRef": "call-me-back",
- "processingDate": "2023-08-20T18:47:15.520Z",
- "rawEventDate": "2023-08-20T18:47:13.159Z"
}
]
}Event insights (without attribution)
This endpoint allows you to generate the insight about event.
⚠️ Note that this endpoint get data from the event without using the attribution, if you want insights about attributed data, please refer to TODO.
This endpoint allows you to retrieve multiple metrics and aggregate them by a date dimension and by event-type if needed.
The metrics can be :
- Your statistics technical keys (ie:
turnoverif you used the e-commerce project bootstrap) - Your states technical keys (ie:
rdvorconvertedif you declared theses offline states) event-countthis one is a built-in metric that count the number of events
The classic date dimension can be :
- day
- week
- month
- quarter
- semester
- year
If needed you can use a non-linear date dimension, allowing you to identify seasonality in your data.
- dayOfWeek
- dayOfMonth
- dayOfYear
- weekOfYear
- monthOfYear
- quarterOfYear
- semesterOfYear
You can also use the event-type breakdown, this option will generate an output entry for each couple date interval/event-type.
This endpoint is designed to generate graphs so it is not paginated.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| since required | string <date-time> Allow you to set a lower date limit (optional) |
| until required | string <date-time> Allow you to set an upper date limit (optional) |
| metrics required | Array of strings List of the metrics you want to retrieve, the keys must be the technical keys of state, statistics or ⚠️ Note that invalid keys will not generate an error, the returned value will always be 0. |
| groupBy required | string The desired breakdown ( |
| interval required | string The desired interval can be: |
| filter | any Only pertinent for event-type breakdown, this parameters restrict the retrieved breakdowns. |
Responses
Request samples
- Payload
{- "since": "2023-08-01T22:00:00.000Z",
- "until": "2023-08-19T22:00:00.000Z",
- "metrics": [
- "event-count",
- "turnover",
- "qualified",
- "rdv",
- "converted"
], - "groupBy": "`project` or `event-type`",
- "interval": "`day`, `week`, `month`, `monthOfYear`, etc.",
- "filter": null
}Response samples
- 200
- 400
- 401
- 403
- 429
Project breakdown with day interval
[- {
- "identifier": "my-project",
- "interval": "2023-08-21",
- "values": {
- "event-count": 10,
- "turnover": 6532
}
}, - {
- "identifier": "my-project",
- "interval": "2023-08-22",
- "values": {
- "event-count": 3,
- "turnover": 1275
}
}
]Update an event state
This endpoint allows you to update a state of an event.
After being generated, an event state can evolve. It is common to see a call-me-back event pass to a qualified
state after having been qualified by your sales team, then set the converted state when the user order.
If in this example, the event seems to only have one state at a time, this is not how Webmarketer models your events.
For the example above, Webmarketer will store :
qualifiedon 2023-08-10T14:30:00Zconvertedon 2023-08-18T17:30:00Z
Each event state is described with a date.
In the future, this modeling will allow you to analyze the transients between theses states
(e.g. how long does it take to get a lead from qualified to converted when it comes from Facebook).
Troubleshooting
If you encounter 404 response telling that "No storageKey matching field in this eventType"
(the service names storageKey what an event type calls the key of the field it uses) :
- You may have a typo in the state name
- The state did not exists at the time the event you trying to update where created
In the second case, if you need to update state of past events for which a state did not exists, our team can manually add them to allow historical updates : please contact us.
Even if we love giving you the autonomy to manage your data, we prefer to be cautious about this kind of update, backdating the states can cause inconsistencies (e.g. when renaming states over time), our experts will ensure that "backdating" will not cause side effects)
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string <uuid> (event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
| key required | string Example: converted The |
Request Body schema: application/jsonrequired
| value required | number The value of the state (0 or 1) |
| date | string <date-time> The date when the state changed, leave it blank if not relevant |
Responses
Request samples
- Payload
{- "value": 1,
- "date": "2023-05-04T12:00:00.000Z"
}Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}Update an event statistic
This endpoint allows you to update a statistic of an event.
Event statistic allow you to inform Webmarketer about your event metrics (like turnover, or quoted amount).
A classical situation is when an event leads to a sale of 4 000€.
By updating the "turnover" stat, you allow Webmarketer to affect this amount to the campaigns that led to this event (according to your attribution models).
E.g. : with a linear model and two interactions : 50% google (2000€), 50% facebook (2000€)
As for event state, a statistic can also be set to a specific date.
In the future, this modeling will allow you to analyze the transients between theses states
(e.g. how long does it take to get a lead from qualified to converted when it comes from Facebook).
Troubleshooting
If you encounter 404 response telling that "No storageKey matching field in this eventType"
(the service names storageKey what an event type calls the key of the field it uses) :
- You may have a typo in the state name
- The state did not exists at the time the event you trying to update where created
In the second case, if you need to update state of past events for which a state did not exists, our team can manually add them to allow historical updates : please contact us.
Even if we love giving you the autonomy to manage your data, we prefer to be cautious about this kind of update, backdating the states can cause inconsistencies (e.g. when renaming states over time), our experts will ensure that "backdating" will not cause side effects)
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string <uuid> (event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
| key required | string Example: turnover The |
Request Body schema: application/jsonrequired
| value required | number The value of the statistic |
| date | string <date-time> The date you want the statistic changed, leave it blank if not relevant |
Responses
Request samples
- Payload
{- "value": 4000,
- "date": "2023-05-04T12:00:00.000Z"
}Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}Gets an Event by ID
This endpoint allows you to retrieve an event by its id (Event ids are generated by Webmarketer and are globally unique)
The event is the computed event from the raw event which was sent to the Webmarketer API (linked user, passed data parsed).
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string <uuid> (event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "projectId": "demo-ecommerce",
- "userId": "668fdaae3a8d910335ec56b1",
- "eventDate": "2024-04-16T20:37:02.000Z",
- "eventType": "order",
- "attributable": true,
- "expirationPolicy": null,
- "event": { },
- "user": {
- "firstname": {
- "raw": "Felicita",
- "current": "Felicita",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "lastname": {
- "raw": "Tillman",
- "current": "Tillman",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "email": {
- "raw": "lenora.greenfelder@stoltenberg.com",
- "current": "lenora.greenfelder@stoltenberg.com",
- "type": "email",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "phone": {
- "raw": "+13072805881",
- "current": "+1 307 280 5881",
- "type": "phone",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "address": {
- "raw": {
- "country": "France",
- "zipcode": "10928"
}, - "type": "location",
- "current": {
- "formattedAddress": "France",
- "location": {
- "type": "Point",
- "coordinates": [
- 2.213749,
- 46.227638
]
}, - "extra": {
- "googlePlaceId": "ChIJMVd4MymgVA0R99lHx5Y__Ws",
- "confidence": 0.5,
- "premise": null,
- "subpremise": null,
- "neighborhood": "France",
- "establishment": null
}, - "administrativeLevels": { },
- "city": null,
- "zipcode": null,
- "streetName": null,
- "streetNumber": null,
- "country": "France",
- "countryCode": "FR"
}, - "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "external-id": {
- "raw": "02c5fa45-be95-304b-90ed-2fb213594279",
- "current": "02c5fa45-be95-304b-90ed-2fb213594279",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}
}, - "metrics": [
- {
- "_id": "668fdff63a8d910335ec5ae1",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "turnover",
- "type": "statistic",
- "data": {
- "type": "currency",
- "date": "2024-04-16T20:37:02.000Z",
- "raw": {
- "amount": 70.23,
- "currency": "EUR"
}, - "current": {
- "currency": "EUR",
- "amount": 70.23
}, - "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae2",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "product-count",
- "type": "statistic",
- "data": {
- "raw": 3,
- "current": 3,
- "type": "number",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae3",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "paid",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-16T20:37:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.802Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae4",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "refund",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-19T20:50:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:44.487Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae5",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "event-count",
- "type": "statistic",
- "data": {
- "current": 1,
- "date": "2024-04-16T20:37:02.000Z",
- "raw": 1,
- "type": "number",
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae6",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-paid",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-16T20:37:17.000Z",
- "raw": 15,
- "current": 15,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:55.676Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae7",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-refund",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-19T20:50:17.000Z",
- "raw": 259995,
- "current": 259995,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:45.962Z",
- "deletedAt": null
}
], - "createdAt": "2024-07-11T13:36:53.922Z",
- "updatedAt": "2024-07-11T13:36:53.922Z"
}Everything about users.
A user is a visitor of your website, as Webmarketer knows them. They are built from the user fields of the events you send: an event carrying an email creates or enriches the user holding that email. Their interactions and events form the customer journey that attribution then works on.
A user gathers three kinds of information: the fields collected about them, the counters derived from their events and interactions, and the audiences they belong to.
Search users
This endpoint allows you to retrieve the users of a project.
It is served on
/api/v2, not on the/api/v1base URL shown > elsewhere in this reference. The full path is >https://api.webmarketer.io/api/v2/projects/{projectId}/users/search.
Unlike the other list endpoints, fields decides what the response holds. A user carries an open set of fields and counters, most of them specific to the project, so nothing is returned by default: name what you need and the response carries that, and only that. An empty array falls back to _id alone.
Three vocabularies share the same namespace, and they are the same in fields, in sort and in the export endpoint:
fields.{fieldKey}for a user field, as declared in the project's user schema, for instancefields.email;eventTypesCount.{eventTypeReference}for the number of events of one type, for instanceeventTypesCount.contact-form;metrics.{metricKey}.{aggregation}for an aggregated metric, where the aggregation issum,max,min,countoraverage, for instancemetrics.revenue.sum;any counter of the user itself, used as is:
eventCount,interactionCount,hitCount,firstEventDate,audienceIds…
An unknown key is rejected with a 400, so the response never silently drops what you asked for.
The result is paginated. On large projects, prefer keyset pagination (sort: "_id" with idAfter) over a growing offset.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| fields required | Array of strings The data to return for each user. See the three vocabularies above. An empty array returns |
User filter predicate (object) or User filter operation (object) (User filter) Filter the users on their fields, metrics, event types, traffic source nodes or browser identifiers. Either a single predicate, or an operation grouping several of them, which nest. | |
object Restrict the result to the users matching this audience condition. Mutually exclusive with | |
| sqlQuery | string Restrict the result to the user ids yielded by the first column of this query. Mutually exclusive with |
| sort | string The key to sort on, taken from the same vocabulary as |
| order | string Enum: "ASC" "DESC" Sort direction. Ascending when omitted. |
| idAfter | string^[a-f0-9]{24}$ Keyset lower bound, exclusive: only the users whose |
| idFrom | string^[a-f0-9]{24}$ Range lower bound, inclusive, on the user |
| idTo | string^[a-f0-9]{24}$ Range upper bound, exclusive, on the user |
| multiFieldMode | string (Multi-value field mode) Default: "latest" Enum: "latest" "earliest" "alphabetical" How a field holding several values is reduced when it is returned or sorted on. |
| offset | number <integer> Items to skip (pagination) |
| limit | number <integer> The maximum number of users returned |
Responses
Request samples
- Payload
{- "fields": [
- "_id",
- "fields.email",
- "eventCount",
- "metrics.revenue.sum"
], - "filters": {
- "type": "fields",
- "field": "email",
- "operatorType": "string",
- "operator": "contains",
- "value": "@example.com"
}, - "audienceCondition": { },
- "sqlQuery": "string",
- "sort": "_id",
- "order": "ASC",
- "idAfter": "6512ab34cd56ef7890123456",
- "idFrom": "string",
- "idTo": "string",
- "multiFieldMode": "latest",
- "offset": 0,
- "limit": 50
}Response samples
- 200
- 400
- 401
- 403
- 404
- 429
{- "offset": 0,
- "limit": 2,
- "count": 2,
- "total": 4213,
- "data": [
- {
- "_id": "6512ab34cd56ef7890123456",
- "fields": {
- "email": [
- {
- "type": "email",
- "current": "example@email.com",
- "raw": "Example@Email.com",
- "date": "2024-03-12T09:16:02.000Z",
- "invalid": false,
- "anonymized": false,
- "reconciliationValue": "example@email.com",
- "from": {
- "type": "event",
- "id": "64ea0e9471360401bc438ef6"
}
}
]
}, - "eventCount": 7,
- "metrics": {
- "revenue": {
- "sum": 249.9
}
}
}, - {
- "_id": "6512ab34cd56ef7890123457",
- "fields": {
- "email": [
- {
- "type": "email",
- "current": "other@email.com",
- "raw": "other@email.com",
- "date": "2024-03-14T11:02:41.000Z",
- "invalid": false,
- "anonymized": false,
- "reconciliationValue": "other@email.com",
- "from": {
- "type": "event",
- "id": "64ea0e9db67c7a3a8310c633"
}
}
]
}, - "eventCount": 1,
- "metrics": {
- "revenue": {
- "sum": 0
}
}
}
]
}Get a user by ID
This endpoint allows you to retrieve a single user by their id.
Everything Webmarketer holds about them is returned: their fields, their counters and their audiences. There is no projection here, unlike the search endpoint.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string^[a-f0-9]{24}$ Example: 6512ab34cd56ef7890123456 The user id, as returned in the |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
{- "_id": "6512ab34cd56ef7890123456",
- "projectId": "string",
- "fields": {
- "property1": [
- {
- "type": "string",
- "current": null,
- "raw": null,
- "date": "2019-08-24T14:15:22Z",
- "invalid": true,
- "anonymized": true,
- "reconciliationValue": null,
- "from": {
- "type": "event",
- "id": "string"
}
}
], - "property2": [
- {
- "type": "string",
- "current": null,
- "raw": null,
- "date": "2019-08-24T14:15:22Z",
- "invalid": true,
- "anonymized": true,
- "reconciliationValue": null,
- "from": {
- "type": "event",
- "id": "string"
}
}
]
}, - "ndrstndUserIds": [
- "string"
], - "audienceIds": [
- "string"
], - "mostProbableLocation": {
- "source": "event-based",
- "confidence": 0,
- "location": {
- "type": "Point",
- "coordinates": [
- 2.3522,
- 48.8566
]
}
}, - "eventCount": 0,
- "eventTypesCount": {
- "contact-form": 3
}, - "eventTypeMeta": {
- "property1": {
- "count": 0,
- "firstDate": "2019-08-24T14:15:22Z",
- "lastDate": "2019-08-24T14:15:22Z"
}, - "property2": {
- "count": 0,
- "firstDate": "2019-08-24T14:15:22Z",
- "lastDate": "2019-08-24T14:15:22Z"
}
}, - "metrics": {
- "property1": {
- "type": "string",
- "sum": 0,
- "max": 0,
- "min": 0,
- "count": 0,
- "average": 0
}, - "property2": {
- "type": "string",
- "sum": 0,
- "max": 0,
- "min": 0,
- "count": 0,
- "average": 0
}
}, - "firstEventDate": "2019-08-24T14:15:22Z",
- "lastEventDate": "2019-08-24T14:15:22Z",
- "interactionCount": 0,
- "hitCount": 0,
- "averageHitCount": 0,
- "interactionDuration": 0,
- "averageInteractionDuration": 0,
- "firstInteractionDate": "2019-08-24T14:15:22Z",
- "lastInteractionDate": "2019-08-24T14:15:22Z",
- "firstInteractionNodeId": "string",
- "lastInteractionNodeId": "string",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Export users to a file
This endpoint exports the users of a project as a CSV or an XLSX file, and answers with the file itself rather than with JSON.
The selection works like the search endpoint, with two differences: the columns are named columns instead of fields, and an audience is designated by its id (or by a raw condition) through audience rather than audienceCondition.
transformerConfig shapes the columns of the file: flattening a currency or a location into plain columns, formatting a date, or reducing a multi-value field to one value. Each entry names the key it applies to and the level it applies at.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| filename required | string Name of the generated file, without its extension |
required | object What to export. |
required | object |
required | Array of objects (Column transformer) The transformations applied to the columns before writing the file. Pass an empty array to apply none. |
Responses
Request samples
- Payload
{- "filename": "users-2024-03",
- "exporterDataConfig": {
- "columns": [
- "fields.email",
- "eventCount",
- "metrics.revenue.sum"
], - "filters": {
- "type": "fields",
- "field": "email",
- "operatorType": "string",
- "operator": "contains",
- "value": "@example.com"
}, - "audience": "string"
}, - "outputFormatConfig": {
- "type": "csv"
}, - "transformerConfig": [
- {
- "type": "date",
- "key": "fields.email",
- "level": 0
}
]
}Response samples
- 400
- 401
- 403
- 429
{- "statusCode": 400,
- "message": "wmktId must be present in nodeData",
- "error": "Bad Request"
}Get the events of a user
This endpoint allows you to retrieve the events of one user, that is the events Webmarketer attached to that visitor. It is the timeline behind their customer journey.
The result is paginated, and the events are the computed ones, as
returned by /projects/{projectId}/events/{id}.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string^[a-f0-9]{24}$ Example: 6512ab34cd56ef7890123456 The user id, as returned in the |
query Parameters
| attributable | boolean Keep only the events that are attributable ( |
| since | string <date-time> Only the events whose |
| until | string <date-time> Only the events whose |
| sort | string Enum: "eventDate" "createdAt" "updatedAt" "_id" The column to sort on |
| order | string Enum: "ASC" "DESC" Sort direction |
| offset | integer Items to skip (pagination) |
| limit | integer Example: limit=50 Max returned items (pagination) |
Responses
Response samples
- 200
- 401
- 403
- 429
{- "count": 0,
- "total": 0,
- "offset": 0,
- "limit": 0,
- "data": [
- {
- "_id": "bbee1c25-8718-4c95-b720-b00567113233",
- "projectId": "string",
- "userId": "string",
- "eventDate": "2019-08-24T14:15:22Z",
- "eventType": "string",
- "attributable": true,
- "expirationPolicy": {
- "expiresAt": "2019-08-24T14:15:22Z",
- "retentionDurationInDays": 0,
- "piiFields": [ ],
- "anonimizedAt": "2019-08-24T14:15:22Z"
}, - "event": { },
- "user": { },
- "metrics": [
- {
- "_id": "bbee1c25-8718-4c95-b720-b00567113233",
- "projectId": "string",
- "eventId": "string",
- "key": "string",
- "type": "string",
- "data": {
- "type": "string",
- "date": "2019-08-24T14:15:22Z",
- "raw": { },
- "current": { },
- "anonymized": true,
- "invalid": true
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "deletedAt": "2019-08-24T14:15:22Z"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]
}Gets all metrics of a user
This endpoint allows you to retrieve all metric by their user id (Event ids are generated by Webmarketer and are globally unique)
The raw event is the event as it was sent to the Webmarketer API, without any transformation, this endpoint does not allow to get the data computed by Webmarketer. The event is the computed data created from the raw event sent to the Webmarrketer API (linked user, passed data parsed)
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| id required | string^[a-f0-9]{24}$ Example: 6512ab34cd56ef7890123456 The user id, as returned in the |
query Parameters
| type | string Enum: "state" "statistic" The type of metrics wanted (all if not set). |
| since | string <date-time> The minimum date for metric metricDate (data.date) (inclusive). |
| until | string <date-time> The maximum date for metric metricDate (data.date) (inclusive). |
| offset | number The number of skipped items from the original query. |
| limit | number The maximum number of item retrieved. |
| sort | string Enum: "createdAt" "updatedAt" "metricDate" The date by which will be sorted retrieved items. |
| order | string Enum: "ASC" "DESC" The order of the sorting. |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "projectId": "demo-ecommerce",
- "userId": "668fdaae3a8d910335ec56b1",
- "eventDate": "2024-04-16T20:37:02.000Z",
- "eventType": "order",
- "attributable": true,
- "expirationPolicy": null,
- "event": { },
- "user": {
- "firstname": {
- "raw": "Felicita",
- "current": "Felicita",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "lastname": {
- "raw": "Tillman",
- "current": "Tillman",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "email": {
- "raw": "lenora.greenfelder@stoltenberg.com",
- "current": "lenora.greenfelder@stoltenberg.com",
- "type": "email",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "phone": {
- "raw": "+13072805881",
- "current": "+1 307 280 5881",
- "type": "phone",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "address": {
- "raw": {
- "country": "France",
- "zipcode": "10928"
}, - "type": "location",
- "current": {
- "formattedAddress": "France",
- "location": {
- "type": "Point",
- "coordinates": [
- 2.213749,
- 46.227638
]
}, - "extra": {
- "googlePlaceId": "ChIJMVd4MymgVA0R99lHx5Y__Ws",
- "confidence": 0.5,
- "premise": null,
- "subpremise": null,
- "neighborhood": "France",
- "establishment": null
}, - "administrativeLevels": { },
- "city": null,
- "zipcode": null,
- "streetName": null,
- "streetNumber": null,
- "country": "France",
- "countryCode": "FR"
}, - "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "external-id": {
- "raw": "02c5fa45-be95-304b-90ed-2fb213594279",
- "current": "02c5fa45-be95-304b-90ed-2fb213594279",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}
}, - "metrics": [
- {
- "_id": "668fdff63a8d910335ec5ae1",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "turnover",
- "type": "statistic",
- "data": {
- "type": "currency",
- "date": "2024-04-16T20:37:02.000Z",
- "raw": {
- "amount": 70.23,
- "currency": "EUR"
}, - "current": {
- "currency": "EUR",
- "amount": 70.23
}, - "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae2",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "product-count",
- "type": "statistic",
- "data": {
- "raw": 3,
- "current": 3,
- "type": "number",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae3",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "paid",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-16T20:37:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.802Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae4",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "refund",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-19T20:50:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:44.487Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae5",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "event-count",
- "type": "statistic",
- "data": {
- "current": 1,
- "date": "2024-04-16T20:37:02.000Z",
- "raw": 1,
- "type": "number",
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae6",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-paid",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-16T20:37:17.000Z",
- "raw": 15,
- "current": 15,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:55.676Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae7",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-refund",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-19T20:50:17.000Z",
- "raw": 259995,
- "current": 259995,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:45.962Z",
- "deletedAt": null
}
], - "createdAt": "2024-07-11T13:36:53.922Z",
- "updatedAt": "2024-07-11T13:36:53.922Z"
}Everything about fields.
A field declares one piece of information a project collects, with its type and its handling rules. Fields are what event types assemble, what users are built from, and what the other endpoints refer to whenever they mention the project's schema.
There are three kinds, each with its own endpoints. A user field holds something about the visitor (their email, their phone number), and is what reconciliation and conversion exports work on. A state field holds a value attached to an event that changes over time, such as the status of a quote. A statistic field holds a measure attached to an event, such as an amount.
Fields are versioned, and never edited in place. Updating one archives the current version and creates a new one carrying the same key, type and entity. Archiving one, through DELETE, also rewrites every event type that used it. Both cascades are described on the operations below.
Get every field of a project
This endpoint returns all the fields of a project, of all three kinds, archived ones included.
It is the only endpoint that returns archived fields: the three listings by kind return the active ones only. An archived field carries a non-null archivedAt, and its key may be shared with the active version that replaced it, since updating a field archives the previous version under the same key.
Use it to read the history of the schema. To read its current state, the listing of each kind is more direct.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Responses
Response samples
- 200
- 401
- 403
- 429
[- {
- "_id": "652f1f3b8f1b2c0012a4d5e6",
- "projectId": "my-project",
- "entity": "user",
- "type": "email",
- "key": "email",
- "label": "Email address",
- "llmDescription": null,
- "metadata": { },
- "isPii": true,
- "semanticType": "email",
- "isReconciliationField": true,
- "createdAt": "2024-03-12T09:14:22.000Z",
- "updatedAt": "2024-03-12T09:14:22.000Z",
- "archivedAt": null
}, - {
- "_id": "652f1f3b8f1b2c0012a4d5e7",
- "projectId": "my-project",
- "entity": "statistic",
- "type": "currency",
- "key": "quote-amount",
- "label": "Quote amount",
- "llmDescription": "The amount of the quote sent to the prospect",
- "metadata": { },
- "isPii": false,
- "semanticType": null,
- "isReconciliationField": false,
- "createdAt": "2024-03-14T15:02:00.000Z",
- "updatedAt": "2024-03-14T15:02:00.000Z",
- "archivedAt": null
}
]Get the user fields
This endpoint returns the active user fields of a project, archived ones excluded.
User fields describe the visitor. Those flagged isReconciliationField are the ones reconciliation compares to decide that two visitors are the same person, and those carrying a semanticType are the ones conversion exports hash and send to the ad platforms.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Responses
Response samples
- 200
- 401
- 403
- 429
[- {
- "_id": "652f1f3b8f1b2c0012a4d5e6",
- "projectId": "my-project",
- "entity": "user",
- "type": "email",
- "key": "email",
- "label": "Email address",
- "llmDescription": null,
- "metadata": { },
- "isPii": true,
- "semanticType": "email",
- "isReconciliationField": true,
- "createdAt": "2024-03-12T09:14:22.000Z",
- "updatedAt": "2024-03-12T09:14:22.000Z",
- "archivedAt": null
}, - {
- "_id": "652f1f3b8f1b2c0012a4d5e7",
- "projectId": "my-project",
- "entity": "statistic",
- "type": "currency",
- "key": "quote-amount",
- "label": "Quote amount",
- "llmDescription": "The amount of the quote sent to the prospect",
- "metadata": { },
- "isPii": false,
- "semanticType": null,
- "isReconciliationField": false,
- "createdAt": "2024-03-14T15:02:00.000Z",
- "updatedAt": "2024-03-14T15:02:00.000Z",
- "archivedAt": null
}
]Create a user field
This endpoint declares a new user field on the project. The entity comes from the path, so it is not to be sent.
The key identifies the field for the whole project, across the three kinds, and cannot be changed afterwards. Neither can type. A key already in use is rejected with a 409.
Only one user field of type location may carry isMostProbableLocation; declaring a second one is rejected with a 409.
The response is the id of the created field, as plain text.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| key required | string Identifies the field for the whole project, across the three kinds. It cannot be changed afterwards, and a key already in use is rejected with a |
| label required | string |
| type required | string (Field type) Enum: "string" "email" "phone" "number" "boolean" "date" "currency" "location" "state" The type of the value the field holds. Fixed at creation. It decides how a submitted value is parsed, and how it is returned: |
| isReconciliationField required | boolean Whether the field identifies the visitor, and is therefore compared by reconciliation. Refused on the |
| isPii required | boolean Whether the field holds personal data |
| llmDescription | string or null Free-form description, up to 1000 characters |
| semanticType | string or null (Semantic type) Enum: "email" "phone" "firstName" "lastName" "location" null What the value means for identity purposes, independently of any ad platform. It is what conversion exports rely on to build the hashed user-data payloads the destinations expect, each mapping these to its own schema. Meaningful on user fields. Address components are not tagged one by one: a |
object | |
| isMostProbableLocation | boolean Only on a user field of type |
Responses
Request samples
- Payload
{- "key": "quote-amount",
- "label": "Quote amount",
- "type": "string",
- "isReconciliationField": false,
- "isPii": false,
- "llmDescription": "string",
- "semanticType": "email",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "isMostProbableLocation": true
}Response samples
- 201
- 400
- 401
- 403
- 409
- 429
652f1f3b8f1b2c0012a4d5e6Update a user field
This endpoint updates the handling rules of a user field. key, type and entity are fixed at creation and cannot be changed here.
The body replaces the field's settings, it is not a patch: label, isReconciliationField, isPii and metadata are required, and a value left out of metadata is dropped.
Two cascades to know about. Changing anything other than llmDescription or semanticType archives the current version of the field and creates a new one; the field's history therefore grows by one entry, visible through the endpoint that returns archived fields. And changing isReconciliationField, isPii or isMostProbableLocation also archives every event type using this field and recreates it with the new settings.
Changing only llmDescription or semanticType updates the field in place, without a new version and without touching the event types.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| key required | string Example: email The field |
Request Body schema: application/jsonrequired
| label required | string |
| isReconciliationField required | boolean Changing it archives the field and rewrites the event types using it. Refused on the |
| isPii required | boolean Changing it archives the field and rewrites the event types using it. |
required | object |
| llmDescription | string or null Changing it alone updates the field in place, without a new version. |
| semanticType | string or null (Semantic type) Enum: "email" "phone" "firstName" "lastName" "location" null What the value means for identity purposes, independently of any ad platform. It is what conversion exports rely on to build the hashed user-data payloads the destinations expect, each mapping these to its own schema. Meaningful on user fields. Address components are not tagged one by one: a |
| isMostProbableLocation | boolean Only on a user field of type |
Responses
Request samples
- Payload
{- "label": "Email address",
- "isReconciliationField": true,
- "isPii": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "llmDescription": "string",
- "semanticType": "email",
- "isMostProbableLocation": true
}Response samples
- 400
- 401
- 403
- 404
- 409
- 429
{- "statusCode": 400,
- "message": "wmktId must be present in nodeData",
- "error": "Bad Request"
}Archive a user field
This endpoint archives a user field. It does not delete anything. The field receives an archivedAt and stops being returned by the listings, but the values already collected under it are kept, and the field remains readable through the endpoint that returns archived fields.
It rewrites the event types too. Every event type using this field is archived and recreated in a new version without it. An integration that sends this field afterwards will see its value ignored by those event types.
Archiving an already archived field, or an unknown one, answers 404.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| key required | string Example: email The field |
Responses
Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}Get the state fields
This endpoint returns the active state fields of a project, archived ones excluded.
A state field holds a value attached to an event that changes over its life, such as the status of a quote. Its successive values are readable through the metrics of an event.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Responses
Response samples
- 200
- 401
- 403
- 429
[- {
- "_id": "652f1f3b8f1b2c0012a4d5e6",
- "projectId": "my-project",
- "entity": "user",
- "type": "email",
- "key": "email",
- "label": "Email address",
- "llmDescription": null,
- "metadata": { },
- "isPii": true,
- "semanticType": "email",
- "isReconciliationField": true,
- "createdAt": "2024-03-12T09:14:22.000Z",
- "updatedAt": "2024-03-12T09:14:22.000Z",
- "archivedAt": null
}, - {
- "_id": "652f1f3b8f1b2c0012a4d5e7",
- "projectId": "my-project",
- "entity": "statistic",
- "type": "currency",
- "key": "quote-amount",
- "label": "Quote amount",
- "llmDescription": "The amount of the quote sent to the prospect",
- "metadata": { },
- "isPii": false,
- "semanticType": null,
- "isReconciliationField": false,
- "createdAt": "2024-03-14T15:02:00.000Z",
- "updatedAt": "2024-03-14T15:02:00.000Z",
- "archivedAt": null
}
]Create a state field
This endpoint declares a new state field on the project. The entity comes from the path, so it is not to be sent.
The key identifies the field for the whole project, across the three kinds, and cannot be changed afterwards. Neither can type. A key already in use is rejected with a 409.
The response is the id of the created field, as plain text.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| key required | string Identifies the field for the whole project, across the three kinds. It cannot be changed afterwards, and a key already in use is rejected with a |
| label required | string |
| type required | string (Field type) Enum: "string" "email" "phone" "number" "boolean" "date" "currency" "location" "state" The type of the value the field holds. Fixed at creation. It decides how a submitted value is parsed, and how it is returned: |
| isReconciliationField required | boolean Whether the field identifies the visitor, and is therefore compared by reconciliation. Refused on the |
| isPii required | boolean Whether the field holds personal data |
| llmDescription | string or null Free-form description, up to 1000 characters |
| semanticType | string or null (Semantic type) Enum: "email" "phone" "firstName" "lastName" "location" null What the value means for identity purposes, independently of any ad platform. It is what conversion exports rely on to build the hashed user-data payloads the destinations expect, each mapping these to its own schema. Meaningful on user fields. Address components are not tagged one by one: a |
object | |
| isMostProbableLocation | boolean Only on a user field of type |
Responses
Request samples
- Payload
{- "key": "quote-amount",
- "label": "Quote amount",
- "type": "string",
- "isReconciliationField": false,
- "isPii": false,
- "llmDescription": "string",
- "semanticType": "email",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "isMostProbableLocation": true
}Response samples
- 201
- 400
- 401
- 403
- 409
- 429
652f1f3b8f1b2c0012a4d5e6Update a state field
This endpoint updates the handling rules of a state field. key, type and entity are fixed at creation and cannot be changed here.
The body replaces the field's settings, it is not a patch, and the same two cascades as on a user field apply: a new version of the field, and a rewrite of the event types when isReconciliationField or isPii changes.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| key required | string Example: email The field |
Request Body schema: application/jsonrequired
| label required | string |
| isReconciliationField required | boolean Changing it archives the field and rewrites the event types using it. Refused on the |
| isPii required | boolean Changing it archives the field and rewrites the event types using it. |
required | object |
| llmDescription | string or null Changing it alone updates the field in place, without a new version. |
| semanticType | string or null (Semantic type) Enum: "email" "phone" "firstName" "lastName" "location" null What the value means for identity purposes, independently of any ad platform. It is what conversion exports rely on to build the hashed user-data payloads the destinations expect, each mapping these to its own schema. Meaningful on user fields. Address components are not tagged one by one: a |
| isMostProbableLocation | boolean Only on a user field of type |
Responses
Request samples
- Payload
{- "label": "Email address",
- "isReconciliationField": true,
- "isPii": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "llmDescription": "string",
- "semanticType": "email",
- "isMostProbableLocation": true
}Response samples
- 400
- 401
- 403
- 404
- 429
{- "statusCode": 400,
- "message": "wmktId must be present in nodeData",
- "error": "Bad Request"
}Archive a state field
This endpoint archives a state field. It does not delete anything. The values already collected are kept, and the event types using the field are archived and recreated without it.
It also invalidates the custom columns built on this field. Any custom column whose formula uses it is marked invalid, and stops producing a result until it is fixed.
Archiving an already archived field, or an unknown one, answers 404.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| key required | string Example: email The field |
Responses
Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}Get the statistic fields
This endpoint returns the active statistic fields of a project, archived ones excluded.
A statistic field holds a measure attached to an event, such as an amount. It is what the aggregations of a user's metrics are computed from, and what a currency type makes billable.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Responses
Response samples
- 200
- 401
- 403
- 429
[- {
- "_id": "652f1f3b8f1b2c0012a4d5e6",
- "projectId": "my-project",
- "entity": "user",
- "type": "email",
- "key": "email",
- "label": "Email address",
- "llmDescription": null,
- "metadata": { },
- "isPii": true,
- "semanticType": "email",
- "isReconciliationField": true,
- "createdAt": "2024-03-12T09:14:22.000Z",
- "updatedAt": "2024-03-12T09:14:22.000Z",
- "archivedAt": null
}, - {
- "_id": "652f1f3b8f1b2c0012a4d5e7",
- "projectId": "my-project",
- "entity": "statistic",
- "type": "currency",
- "key": "quote-amount",
- "label": "Quote amount",
- "llmDescription": "The amount of the quote sent to the prospect",
- "metadata": { },
- "isPii": false,
- "semanticType": null,
- "isReconciliationField": false,
- "createdAt": "2024-03-14T15:02:00.000Z",
- "updatedAt": "2024-03-14T15:02:00.000Z",
- "archivedAt": null
}
]Create a statistic field
This endpoint declares a new statistic field on the project. The entity comes from the path, so it is not to be sent.
The key identifies the field for the whole project, across the three kinds, and cannot be changed afterwards. Neither can type. A key already in use is rejected with a 409.
The response is the id of the created field, as plain text.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
| key required | string Identifies the field for the whole project, across the three kinds. It cannot be changed afterwards, and a key already in use is rejected with a |
| label required | string |
| type required | string (Field type) Enum: "string" "email" "phone" "number" "boolean" "date" "currency" "location" "state" The type of the value the field holds. Fixed at creation. It decides how a submitted value is parsed, and how it is returned: |
| isReconciliationField required | boolean Whether the field identifies the visitor, and is therefore compared by reconciliation. Refused on the |
| isPii required | boolean Whether the field holds personal data |
| llmDescription | string or null Free-form description, up to 1000 characters |
| semanticType | string or null (Semantic type) Enum: "email" "phone" "firstName" "lastName" "location" null What the value means for identity purposes, independently of any ad platform. It is what conversion exports rely on to build the hashed user-data payloads the destinations expect, each mapping these to its own schema. Meaningful on user fields. Address components are not tagged one by one: a |
object | |
| isMostProbableLocation | boolean Only on a user field of type |
Responses
Request samples
- Payload
{- "key": "quote-amount",
- "label": "Quote amount",
- "type": "string",
- "isReconciliationField": false,
- "isPii": false,
- "llmDescription": "string",
- "semanticType": "email",
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "isMostProbableLocation": true
}Response samples
- 201
- 400
- 401
- 403
- 409
- 429
652f1f3b8f1b2c0012a4d5e6Update a statistic field
This endpoint updates the handling rules of a statistic field. key, type and entity are fixed at creation and cannot be changed here.
The body replaces the field's settings, it is not a patch, and the same two cascades as on a user field apply: a new version of the field, and a rewrite of the event types when isReconciliationField or isPii changes.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| key required | string Example: email The field |
Request Body schema: application/jsonrequired
| label required | string |
| isReconciliationField required | boolean Changing it archives the field and rewrites the event types using it. Refused on the |
| isPii required | boolean Changing it archives the field and rewrites the event types using it. |
required | object |
| llmDescription | string or null Changing it alone updates the field in place, without a new version. |
| semanticType | string or null (Semantic type) Enum: "email" "phone" "firstName" "lastName" "location" null What the value means for identity purposes, independently of any ad platform. It is what conversion exports rely on to build the hashed user-data payloads the destinations expect, each mapping these to its own schema. Meaningful on user fields. Address components are not tagged one by one: a |
| isMostProbableLocation | boolean Only on a user field of type |
Responses
Request samples
- Payload
{- "label": "Email address",
- "isReconciliationField": true,
- "isPii": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "llmDescription": "string",
- "semanticType": "email",
- "isMostProbableLocation": true
}Response samples
- 400
- 401
- 403
- 404
- 429
{- "statusCode": 400,
- "message": "wmktId must be present in nodeData",
- "error": "Bad Request"
}Archive a statistic field
This endpoint archives a statistic field. It does not delete anything. The values already collected are kept, and the event types using the field are archived and recreated without it.
It also invalidates the custom columns built on this field. Any custom column whose formula uses it is marked invalid, and stops producing a result until it is fixed.
Archiving an already archived field, or an unknown one, answers 404.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| key required | string Example: email The field |
Responses
Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}Everything about event types.
An event type declares what Webmarketer expects for one kind of event you send (a contact form, an order, a quote...): its fields, and whether its events are conversions reported in the attribution (attributable).
An event whose type is not declared is not processed: it is discarded with an unknown-event-type error. Declare the type before sending the events. A type only applies to the events received after its creation date.
An event type is versioned. Its reference is its stable identifier; changing its fields or its attributable flag archives the current version and creates a new one, which applies to the events received from then on.
Get event types
This endpoint allows you to list the event types of a project.
Only the latest version of each reference is returned. Archived event types are returned too, unless you filter them out with archived=false.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
query Parameters
| offset | integer >= 0 The number of event types to skip |
| limit | integer >= 0 Example: limit=20 The maximum number of event types to return. All of them are returned when omitted or |
| search | string Example: search=contact Case-insensitive search on the |
| archived | boolean
|
| storageKey | string Example: storageKey=email Only return the event types having a field with this |
| reference | string Example: reference=contact-form Only return the event type with this reference |
| sort | string Example: sort=name,-createdAt Sort the event types by the passed properties.
Ascending sort is done by passing the property name ( |
Responses
Response samples
- 200
- 400
- 401
- 403
- 429
{- "total": 2,
- "count": 2,
- "offset": 0,
- "limit": 20,
- "data": [
- {
- "_id": "64ea0e9471360401bc438ef6",
- "createdAt": "2023-07-21T10:57:00Z",
- "updatedAt": "2023-08-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "contact-form",
- "name": "Contact form",
- "llmDescription": null,
- "attributable": true,
- "fields": [
- {
- "entity": "user",
- "type": "email",
- "storageKey": "email",
- "ingestionKey": "email",
- "isPii": true,
- "isReconciliationField": true,
- "llmDescription": null
}, - {
- "entity": "event-type",
- "type": "string",
- "storageKey": "message",
- "ingestionKey": "message",
- "label": "Message",
- "isPii": false,
- "llmDescription": null,
- "metadata": { }
}
], - "metadata": { },
- "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}, - {
- "_id": "64ea0e9db67c7a3a8310c633",
- "createdAt": "2023-06-21T10:57:00Z",
- "updatedAt": "2023-06-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "newsletter",
- "name": "Newsletter registration",
- "llmDescription": null,
- "attributable": true,
- "fields": [
- {
- "entity": "user",
- "type": "email",
- "storageKey": "email",
- "ingestionKey": "email",
- "isPii": true,
- "isReconciliationField": true,
- "llmDescription": null
}
], - "metadata": { },
- "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}
]
}Create an event type
This endpoint allows you to create a new event type.
The creation date is set by Webmarketer and cannot be passed: the type only applies to the events received from now on. The phone parsing configuration is copied from the project.
The reference must be unique in the project, archived event types included: an archived reference cannot be reused for a new type.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
The event type to create
| reference required | string The technical reference of the event type, sent as the event type of your events. Unique in the project, archived types included. |
| name required | string The name of the event type, displayed in Webmarketer |
| attributable required | boolean Whether the events are conversions, reported in the attribution. A non-attributable type only enriches and reconciles users, and must have at least one field. |
required | object Free metadata (can be empty) |
| llmDescription | string or null <= 1000 characters What the event type means, in your own words, so that AI assistants understand it. Not used by the processing. |
required | Array of objects (event-types-event-type-field-input) The fields, states and statistics of the event type |
Responses
Request samples
- Payload
{- "reference": "contact-form",
- "name": "Contact form",
- "attributable": true,
- "metadata": { },
- "fields": [
- {
- "entity": "user",
- "type": "email",
- "storageKey": "email",
- "ingestionKey": "email",
- "isPii": true,
- "isReconciliationField": true
}, - {
- "entity": "event-type",
- "type": "string",
- "storageKey": "message",
- "ingestionKey": "message",
- "label": "Message",
- "isPii": false,
- "metadata": { }
}
]
}Response samples
- 201
- 400
- 401
- 403
- 404
- 429
{- "_id": "64ea0e9471360401bc438ef6",
- "createdAt": "2023-07-21T10:57:00Z",
- "updatedAt": "2023-08-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "contact-form",
- "name": "Contact form",
- "llmDescription": null,
- "attributable": true,
- "fields": [
- {
- "entity": "user",
- "type": "email",
- "storageKey": "email",
- "ingestionKey": "email",
- "isPii": true,
- "isReconciliationField": true,
- "llmDescription": null
}, - {
- "entity": "event-type",
- "type": "string",
- "storageKey": "message",
- "ingestionKey": "message",
- "label": "Message",
- "isPii": false,
- "llmDescription": null,
- "metadata": { }
}
], - "metadata": { },
- "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}Get an event type
This endpoint allows you to retrieve the active version of an event type.
An archived event type is not returned here: list the event types with archived=true to find it.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| reference required | string Example: contact-form The event type reference (its |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "64ea0e9471360401bc438ef6",
- "createdAt": "2023-07-21T10:57:00Z",
- "updatedAt": "2023-08-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "contact-form",
- "name": "Contact form",
- "llmDescription": null,
- "attributable": true,
- "fields": [
- {
- "entity": "user",
- "type": "email",
- "storageKey": "email",
- "ingestionKey": "email",
- "isPii": true,
- "isReconciliationField": true,
- "llmDescription": null
}, - {
- "entity": "event-type",
- "type": "string",
- "storageKey": "message",
- "ingestionKey": "message",
- "label": "Message",
- "isPii": false,
- "llmDescription": null,
- "metadata": { }
}
], - "metadata": { },
- "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}Update an event type
This endpoint allows you to update an event type.
Every property is optional; the ones you omit are kept. fields, when passed, replaces the whole list: a field left out is removed from the type.
Changing the fields (added, removed, or any property other than
label,llmDescriptionandmetadata) orattributablecreates a new version: the current one is archived and the new one applies to the events received from now on. Events already processed are not processed again.Changing only
name,llmDescription,metadataor thelabel,llmDescriptionandmetadataof fields updates the current version in place.
The response has no body.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| reference required | string Example: contact-form The event type reference (its |
Request Body schema: application/jsonrequired
The properties to update
| name | string The name of the event type, displayed in Webmarketer |
| llmDescription | string or null <= 1000 characters What the event type means, for AI assistants |
| attributable | boolean Whether the events are conversions, reported in the attribution |
object Free metadata | |
Array of objects (event-types-event-type-field-input) non-empty The new list of fields, replacing the current one. It cannot be empty. |
Responses
Request samples
- Payload
{- "name": "Contact form (website)"
}Response samples
- 400
- 401
- 403
- 404
- 429
{- "statusCode": 400,
- "message": [
- "fields.0.isReconciliationField must be a boolean value"
], - "error": "Bad Request"
}Archive an event type
This endpoint allows you to archive an event type.
Nothing is deleted: the type gets an archivedAt date, the events already processed are kept, and the events received from then on are discarded as of an unknown type. The reference cannot be reused for a new type.
The response has no body.
Authorizations:
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| reference required | string Example: contact-form The event type reference (its |
Responses
Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}Get custom campaigns
This endpoint allows you to retrieve a paginated list of custom campaigns for a Custom Ads integration.
You can filter the campaigns by active status, campaign ID, campaign slug, name, and explicit status.
Please note that campaign ID is different from the campaign slug. The campaign ID can be retrieved through the GET campaigns endpoint. The campaign slug is a user-defined identifier for the campaign to be used in the URL.
Explicit campaigns are campaigns that were explicitly created by the user. Implicit campaigns are campaigns
that were created by the system when traffic is detected with the integration wmktid but no explicit campaign
slug is provided.
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
query Parameters
| active | boolean Filter by active status (optional) |
| campaignId | string Filter by campaign ID (optional) |
| campaignSlug | string Filter by campaign slug (optional) |
| nameLike | string Only include campaigns where the name match the given string, matching is case insensitive (optional) |
| explicit | boolean Display campaigns which were explicitly / implicitly created (optional) |
| sort | string (custom-ads-campaigns-campaign-filter-sort-type) Enum: "name" "campaignId" "active" Sort by field (optional) |
| order | string (custom-ads-campaigns-order-type) Enum: "ASC" "DESC" Sort order (optional) |
| offset | integer Example: offset=50 Campaigns to skip (pagination) |
| limit | integer Example: limit=10 Max returned campaigns (pagination) |
Responses
Response samples
- 200
- 400
- 401
- 403
{- "data": [
- {
- "id": "string",
- "integrationId": "string",
- "projectId": "string",
- "name": "string",
- "campaignSlug": "string",
- "active": true,
- "explicit": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "count": 0,
- "total": 0,
- "offset": 0,
- "limit": 0
}Create custom campaign
This endpoint allows you to create a custom campaign for a Custom Ads integration.
Please note that :
- the campaign slug must be unique within the integration,
- the campaign will be declared as explicit (as it was created by a user).
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
Request Body schema: application/jsonrequired
| campaignSlug required | string Campaign slug of your choice, the campaign slug will be used by Webmarketer to identify the campaign from the landing page URL. The campaign slug must be unique within the integration. |
| name required | string The name of the Campaign, used in the Webmarketer interface |
| active | boolean Default: true Campaign status (optional) |
Responses
Request samples
- Payload
{- "campaignSlug": "string",
- "name": "string",
- "active": true
}Response samples
- 200
- 400
- 401
- 403
- 409
{- "id": "string"
}Get a custom campaign
This endpoint allows you to retrieve a Custom Ads campaign for a given integration.
Note that the campaignId is not the same as the campaign slug, this id is generated by Webmarketer on campaign creation and can be retrieved through the GET campaigns endpoint.
Note that the returned campaign could be an implicit campaign, automatically created by the system when traffic is detected without any associated explicit campaign.
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
| id required | string The campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
{- "id": "string",
- "integrationId": "string",
- "projectId": "string",
- "name": "string",
- "campaignSlug": "string",
- "active": true,
- "explicit": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a custom campaign
This endpoint allows you to update a custom campaign for a Custom Ads integration.
You can update the campaign name and its active status.
path Parameters
| id required | string The campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
Request Body schema: application/json
| name | string Campaign name (optional) |
| active | boolean Campaign status (optional) |
Responses
Request samples
- Payload
{- "name": "string",
- "active": true
}Response samples
- 200
- 400
- 401
- 403
{- "modifiedCount": 0
}Get a custom campaign outlays
This endpoint allows you to retrieve a paginated list of outlays for a given Custom Ads campaign.
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
| parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
query Parameters
| sort | string (custom-ads-campaigns-outlay-filter-sort-type) Enum: "campaignId" "startDate" "endDate" "amount" "country" "region" Sort by field |
| order | string (custom-ads-campaigns-order-type) Enum: "ASC" "DESC" Order by field |
| since | string <date-time> Get outlays since this date |
| until | string <date-time> Get outlays until this date |
| offset | integer Example: offset=50 Outlays to skip (pagination) |
| limit | integer Example: limit=10 Max returned outlays (pagination) |
Responses
Response samples
- 200
- 400
- 401
- 403
{- "data": [
- {
- "_id": "string",
- "projectId": "string",
- "integrationId": "string",
- "campaignId": "string",
- "amount": {
- "amount": 0,
- "currency": "string"
}, - "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "country": "string",
- "region": "string",
- "deletedAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "count": 0,
- "total": 0,
- "offset": 0,
- "limit": 0
}Create a custom campaign outlay
This endpoint allows you to create an outlay for a given Custom Ads campaign.
Region and country are optional fields and can be used to pass additional information about the outlay (for future reports in Webmarketer).
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
| parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
Request Body schema: application/jsonrequired
| amount required | number The amount of the outlay, in the currency of the integration |
| startDate required | string <date-time> The start date of the outlay, must be less than the end date |
| endDate required | string <date-time> The end date of the outlay, must be greater than the start date |
| country | string The country where the outlay was made, optional, not used yet |
| region | string The region where the outlay was made, optional, not used yet |
Responses
Request samples
- Payload
{- "amount": 0,
- "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "country": "string",
- "region": "string"
}Response samples
- 200
- 400
- 401
- 403
{- "id": "string"
}Get a custom campaign outlay
This endpoint allows you to retrieve an outlay for a given Custom Ads campaign.
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
| parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
| outlayId required | string The outlay Id |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
{- "_id": "string",
- "projectId": "string",
- "integrationId": "string",
- "campaignId": "string",
- "amount": {
- "amount": 0,
- "currency": "string"
}, - "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "country": "string",
- "region": "string",
- "deletedAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}Update a custom campaign outlay
This endpoint allows you to update an outlay for a given Custom Ads campaign.
Region and country are optional fields and can be used to pass additional information about the outlay (for future reports in Webmarketer).
path Parameters
| projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
| wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
| parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
| outlayId required | string The outlay ID |
Request Body schema: application/jsonrequired
| amount | number |
| startDate | string <date-time> |
| endDate | string <date-time> |
| campaignId | object The campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
| country | string |
| region | string |
Responses
Request samples
- Payload
{- "amount": 0,
- "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "campaignId": { },
- "country": "string",
- "region": "string"
}Response samples
- 200
- 400
- 401
- 403
- 404
{- "modifiedCount": 0
}