Download OpenAPI specification:Download
The Rival API is organized around REST. APIs accept JSON-encoded request bodies and return JSON-encoded responses. Standard response codes and verbs are used wherever applicable.
To gain access to the Rival API, a developer must register an Application with Rival and obtain an Application Key. To register an Application and get your initial API key and Application Id, contact your Rival support representative.
APIs are provided for administrative tasks as well as operational tasks. Adminstrative tasks focus on provisioning new Organizations and managing Applications. Operational tasks focus on managing chats, reports, distributions, etc within a Research Domain.
Authentication to API endpoints is performed by providing your API key and Application Id in the respective x-api-key
and x-application
headers. Most requests, such as managing Projects or pulling data, are scoped to a single Reseach Domain. In order to perform these tasks, a connection must be established between the Research Domain and the Application that issued the request. Once this connection is established the application can set the x-research-domain
header to the id of the targeted Research Domain. When an Application is used to create a Research Domain a connection is automatically established between the Application and the Research Domain.
If credentials are missing from the x-api-key
, x-application
, or x-research-domain
headers, or if those credentials are not valid, a 401 Unauthorized response will be returned. If the application has not been authorized to perform an action for the targetted Research Domain, the API will return a 403 forbidden response and the request will be rejected.
Top-level API resources have support for fetching collections of resources. These collections can be paginated using a cursor-based pagination technique that relies on offset/limit pairs using the first, last, after, and before query string parameters. Additional filtering may be available on some collection APIs by specifying filters in the form of <field name>=<value>
(eg. type=chat
).
Limits the response to accept the first n resources in the collection, starting from the cursor position specified by 'after'. When 'after' is not specified, the first resources in the collection are returned. Default value: 20
Limits the response to accept the previous n resources in the collection, before the cursor specified by 'before'. When 'before' is not specified, the last resources in the collection are returned. Default value: 20
An opaque cursor that marks the pagination position of the last item in the previous response. Used in conjunction with 'first'.
An opaque cursor that marks the pagination position of the first item in the previous response. Used in conjunction with 'last'.
First 10 items of a collection
GET /v1/research-domains?first=10
Next page of 10 items after provided cursor
GET /v1/research-domains?first=10&after=ZmEzNzQzMzItOTAzNC00MzgzLWEyZTUtZTIyYTczMTFkOTAy
Previous page of 15 items before provided cursor
GET /v1/research-domains?last=15&before=ZmEzNzQzMzItOTAzNC00MzgzLWEyZTUtZTIyYTczMTFkOTAy
Collection responses return pagination metadata in the pageInfo field and an array of resources in the data field.
An opaque cursor that points to the first item in the response. Can be used as the before value on subsequent requests.
An opaque cursor that points to the last item in the response. Can be used as the after value on subsequent requests.
Returns true if more data exists after the position of endCursor
Returns true if more data exists prior to the position of startCursor
{
"pageInfo": {
"startCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
"endCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
"hasNextPage": true,
"hasPreviousPage": false
},
"data": [
...
]
}
Endpoints and webhooks that return Participant data use a dynamically generated schema. The Participant data object is always represented as a Map<string, AttributeValue> where each item in the map represents an Attribute. The key field of the map is represented as a human-readable alphanumeric label no longer than 55 characters in length. The value of the map will be represented in a format that is dependent on the data type of the Attribute that is being represented. If no value is captured for a Participant for a particular Attribute the value will be null
.
Strings represent textual data. Typically, a string value is captured from an Open-Ended Text Question.
Examples
{
"Name": "John D. Rockefeller",
"Biography": " An American business magnate and philanthropist. He is widely considered the wealthiest American of all time and the richest person in modern history."
}
Enumeration values represent a single member from a closed set of elements. Typically, an enumerated value is captured from a Single Choice Question. Values are represented as positive integers where each unique integer maps to exactly one member in the enumerated set.
Example
Given a Single Choice Question "Profession", with the allowable choices
A value of "Self Employed" would be represented as
{
"Profession": 3
}
Enumeration Set values represent an unordered subset of members from a closed set of elements. Typically, an enumerated set value is captured from a Multiple Choice Question. Values are represented as arrays of positive integers where each unique integer maps to exactly one member in the enumerated set.
Example
Given a Multiple Choice Question "Bank_Account_Types", with the allowable choices
A value containing "Savings" and "Chequeing" would be represented as
{
"Bank_Account_Types": [1, 2]
}
Media responses are currently not available in the Rival API.
Rival uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx
range indicate success. Codes in the 4xx
range indicate an error that failed given the information provided. Codes in the 5xx
range indicate an internal error in the Rival platform.
Response body's are returned as JSON-encoded payloads. Each error response includes a standard set of properties
The error code represents a classification for the error. Application logic may use error codes to set up specific handlers for different types of errors.
A human-readable message providing more details about the error. Error messages are always returned in English and are intended for development use only. Application developers should provide more friendly and context aware error messages to display to end users.
A unique identifier that can be provided back to Rival to facilitate support requests.
Additional data may be provided for specific error codes. Not all errors are guaranteed to return additional data.
No API key or bearer token was provided on the API request, or the provided credentials were not valid.
The request was not allowed
Resource to be created may already exist, where uniqueness is enforced.
Account Provisioning API endpoints manage provisioning of Organizations and Research Domains. Requests to Admin APIs require the calling Application to have an elevated permission level.
An Organization represents the account of a business entity that will directly interact with the Rival platform or indirectly benefit from the use of the Rival platform. Organizations are the top level resource that all other resources are created under.
A Research Domain is a market research point of control. A Research Domain organizes the market research artifacts and data that pertains to that Research Domain. Market research artifacts and data are segregated from other Research Domains.
Each Research domain is associated with an Organization that is the ownerOrganization and another Organization that is the managementOrganization. An Organization that manages a Research Domain is not always the Organization that owns the Research Domain. When a Research Domain is created via the create research domain API, an owner Organization is explicitly specified and the calling Application's Organization is implicitly set as the management Organization.
Gets an ResearchDomain.
researchDomainId required | string <uuid> |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
{- "id": "2cf52eee-123c-4af9-84d2-966b7ec57722",
- "name": "Starburger Insiders",
- "ownerOrganization": "3489009a-0dc6-488d-b0f2-139a44141e71",
- "managementOrganization": "3489009a-0dc6-488d-b0f2-139a44141e71",
- "region": "us",
- "state": "Active",
- "brand": {
- "name": "Starburger",
}, - "createdAt": "2021-06-07T17:36:58.663Z",
- "updatedAt": "2021-06-07T17:36:58.663Z"
}
Gets a collection of ResearchDomains.
first | string Limits the response to accept the first n resources that appear after the cursor specified by after. When after is not specified, the first resources in the collection are returned. Default 20 |
last | string Limits the response to accept the last n resources that appear before the cursor specified by before. When before is not specified, the last resources in the collection are returned. Default 20 |
after | string An opaque cursor that marks the pagination position of the last item in the previous response. Used in conjunction with first. When null, paginated starts from the beginning of the collection. |
before | string An opaque cursor that marks the pagination position of the first item in the previous response. Used in conjunction with last. When null, paginated starts from the end of the collection. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
{- "pageInfo": {
- "startCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
- "endCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
- "hasNextPage": true,
- "hasPreviousPage": false
}, - "data": [
- {
- "id": "2cf52eee-123c-4af9-84d2-966b7ec57722",
- "name": "Starburger Insiders",
- "ownerOrganization": "3489009a-0dc6-488d-b0f2-139a44141e71",
- "managementOrganization": "3489009a-0dc6-488d-b0f2-139a44141e71",
- "region": "us",
- "state": "Active",
- "brand": {
- "name": "Starburger",
}, - "createdAt": "2021-06-07T17:36:58.663Z",
- "updatedAt": "2021-06-07T17:36:58.663Z"
}
]
}
Participant Management API enpoints enable Participants in a Rearsearch Domain to be synchronized with an external system of record.
A Participant is an account of a person that provides insights into a Research Domain by engaging in a dialogue with an agent through a chat.
Gets a Participant by Issued Identifier or by Participant Id or by Phone Number or by Email Address.
identifier required | string One of the following identifiers:
|
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "id": "5af1c98e-8943-4a7c-ad52-b8341d268824",
- "registeredIdentifiers": {
- "StarFinancial": "A1103451252",
- "Rival": "MDfp8Q0i"
}, - "phoneNumber": "+13065551982",
- "subscriptionStatus": "Subscribed",
- "attributes": {
- "fullName": "John Doe",
- "educationLevel": 4,
- "petTypesOwned": [
- 1,
- 2
]
}, - "createdAt": "2022-01-23T21:07:58.663Z",
- "updatedAt": "2022-01-23T21:07:58.663Z"
}
Prior to invoking this endpoint, ensure the research domain is opted in to the SMS Opt-In Plugin. This is a one time opt-in for every research domain.
When no existing Participant is found with a matching issued identifier, a new Participant record is created. Otherwise an existing Participant will be updated.
A Participant's subscription status is managed by a combination of the subscribe field and the phoneNumber or email field.
When subscribe is set to true with a phone number, the Participant is considered to be opting in to receive an SMS requesting their consent to receive messages for future surveys. If they respond affirmatively to the opt-in request, their subscription status will be updated to Subscribed. If they decline or do not respond, the Participant will remain in the OneTime status.
When subscribe is set to true with an email, it is assumed that prior consent has already been obtained and the Participant will be subscribed immediately without a verification step.
When subscribe is set to false, a Participant record will still be created or updated but the Participant will neither be subscribed nor unsubscribed. Instead, their subscription status will remain as OneTime.
Custom profile attribute values can optionally be assigned when creating or updating the participant. The attribute key is the name of a defined attribute on the current research domain, and the value must match the defined type.
Attribute type | Expected value | Example |
---|---|---|
Text | String | "Some value" |
Number | Number | 123 |
Single-choice | Number | 1 |
Multiple-choice | Array of numbers | [1, 2] |
Single and multiple-choice attributes use choice codes as their values. This is true for both requests and responses. See Participant Data Objects for more info.
Notes:
identifier required | string A unique identifier for the Participant. Issued Identifiers consist of an Issuer and an Id. The issuer is the name of the system is deemed to be authoritative over the Id. Together, the Id and the Issuer must be unique within the scope of the Research Domain a Participant is associated with. This parameter must be formatted as |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
phoneNumber | string An e.164 formatted phone number. If a phone number is provided and unsubscribed is not set, the phone number will be verified by Rival. Chat invitations may be sent to verified phone numbers via SMS. |
emailAddress | string If an email address is provided, it is assumed there has been consent from the user prior to request and will be subscribed automatically. The participant will be contacted for future surveys. |
subscribe required | boolean A flag to indicate whether or not Rival should send chat invitations to this Participant. To update the phone number or email, the flag must be set to true; doing so will also trigger the verification process when a phone number is set or updated. |
attributes | object An object containing key-value pairs of attribute names and values to assign to the participant. |
{- "phoneNumber": "+13065557104",
- "subscribe": true
}
{- "id": "5af1c98e-8943-4a7c-ad52-b8341d268824",
- "registeredIdentifiers": {
- "StarFinancial": "A1103451252",
- "Rival": "MDfp8Q0i"
}, - "phoneNumber": "+13065551982",
- "subscriptionStatus": "OneTime",
- "attributes": {
- "fullName": "John Doe",
- "educationLevel": 4,
- "petTypesOwned": [
- 1,
- 2
]
}, - "createdAt": "2022-01-23T21:07:58.663Z",
- "updatedAt": "2022-01-23T21:07:58.663Z"
}
Get a single attribute value for a participant.
See Participant Data Objects for more info on the data types supported in the response.
identifier required | string One of the following identifiers:
|
attributeLabel required | string Label for attribute. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "label": "fullName",
- "value": "John Doe",
- "lastUpdated": "2022-01-23T21:07:58.663Z",
- "isSystem": false,
- "type": "Text"
}
Set an existing single attribute value for a participant.
See Participant Data Objects for more info on the data types supported in the request and the response.
identifier required | string One of the following identifiers:
|
attributeLabel required | string Label for attribute. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
value | string | number | array<number> The value to set the attribute to for the participant. The type provided here must match the expected type for the attribute definition. Expected types
Notes:
|
{- "value": "John Doe"
}
{- "label": "fullName",
- "value": "John Doe",
- "lastUpdated": "2022-01-23T21:07:58.663Z",
- "isSystem": false,
- "type": "Text"
}
Get a collection of all the attributes associated to a participant.
There are two types of attributes returned; system attributes and custom attributes.
The two can be distinguished in the response body using the isSystem
field.
See Participant Data Objects for more info on the data types supported in the response.
identifier required | string One of the following identifiers:
|
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "data": [
- {
- "label": "SubscriptionStatus",
- "value": "Subscribed",
- "lastUpdated": "2022-01-20T12:00:31.220Z",
- "isSystem": true,
- "type": "SingleChoice"
}, - {
- "label": "FavColor",
- "value": "magenta",
- "lastUpdated": "2022-01-23T21:07:58.663Z",
- "isSystem": false,
- "type": "Text"
}
], - "pageInfo": {
- "startCursor": "YjBhN2JmNTYtOTE2Ny00YWY4LTlhZTAtMGIwYjRmNDZjYmYw",
- "endCursor": "YjBhN2JmNTYtOTE2Ny00YWY4LTlhZTAtMGIwYjRmNDZjYmYw",
- "hasNextPage": false,
- "hasPreviousPage": false
}
}
Update an existing registered identifier value for a participant.
Identifiers must be unique within the scope of the research domain.
When a participant is not found, a 404 - Not Found
error is returned.
identifier required | string One of the following identifiers:
|
issuer required | string The issuer of the identifier to be set. Only custom identifiers can be updated. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
value | string The new identifier value for participant.
|
{- "value": "string"
}
{- "id": "5af1c98e-8943-4a7c-ad52-b8341d268824",
- "registeredIdentifiers": {
- "userId": 1
}
}
Removes a registered identifier assigned to a participant.
When a participant is not found, a 404 - Not Found
error is returned.
identifier required | string One of the following identifiers:
|
issuer required | any The issuer of the identifier to be removed. Only custom identifiers can be removed. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "message": "Unauthorized",
- "code": "Unauthorized",
- "errorId": "RPLKDEF"
}
Rival supports webhooks to notify your application when an event happens. Rival generates JSON-encoded POST requests over HTTPS to send notifications to your application. These notifications can be used to execute actions in your backend system.
You can use webhook event notifications to alert your application when:
A participant has subscribed to the Rival platform, so that a record can be inserted into your customer relationship management database.
A value has been captured for a specific attribute of a participant, so that information can be synchronized in your customer relationship management database.
A paticipant has completed a chat.
The following steps can be taken to start receiving webhook notifcations in your application:
Identify the events you want to monitor.
Build a publicly accessible HTTPS endpoint.
Register the publicly accessible HTTPS url in the Rival platform via the create event subscription endpoint.
Your endpoint must be configured to read event payloads for the type of event notification that the endpoint is subscribed to. Rival sends notifications you your endpoint as a POST request with a JSON payload.
Each event is structured as an object with a type
, id
, occuredAt
, and a data
field. See get event for a detailed view of the event payload.
{
"type": "ParticipantSubscribed",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": { ... }
}
Your endpoint must quickly return a successful status code (2xx
) prior to any complex or time consuming operations that may cause a timeout. In scenarios where operations may take longer than a few hundred milliseconds, it is a recommended practice to write the event to a queue and return a success response immediately after the write is complete.
In the event that your endpoint returns an http code in the 3xx
, 4xx
, or 5xx
category, or if a requests times out, Rival will automatically attempt to retry sending the event payload.
Rival signs all webhook events it sends to your endpoints by including a cryptographic signature in the x-signature
request header. This allows applications to verify that requests were sent from Rival, not by a third party. In order to verify the signature you need to have access to the API Key that was provided when your application was registered with the Rival platform (or subsequently generated during key rotation).
The x-signature
header contains a timestamp and a signature for each active API key for your application. Typically an application will only have a single active API key unless key rotation is currently in progress and a grace period has been provided for decomissioning the previous key. The signature will take the following form:
t=1638904318,
s=f94debcb07dfc2fc6d4a4ac0ef489f604c8a6ee8f12470e6e31f482a47d0d015,
s=db5e6477ce19b5ebaa2cefd534b4e0fc507809396b73347a1d171e1082fd2095
Rival generates signatures using a hash-based message authentication code (HMAC) with SHA-256. The following steps can be used to verify the signature
Split the header on the ,
character. Next, split the resultant string array on the =
character to generate an array of key-value pairs.
Obtain the timestamp by finding the key-value pair where the key is t
. The timestamp is recorded in Unix time with no milliseconds. In order to defend against replay attacks it is recommended to verify that the timestamp falls within some reasonable tolerance from the current time (eg. within the last 5 minutes). When the Rival platform generates retry requests a new timestamp and signature is created for each delivery attempt.
Generate the signed payload. This payload is formed by concatenating the string value of the timestamp from step 2; the .
character; and the JSON payload (ie. the request body). Ensure that the raw payload is used in this step. Many web server frameworks will try to parse and format the JSON payload which may lead to re-ordering of fields or inserting additional whitespace.
Compute the HMAC authentication code. Using SHA-256 hash function and your API key as the HMAC key, compute the expected signature for the payload generated in step 3.
Compare the expected signature computed in step 4 with the provided signature(s) from step 1's key-value pair array where the key is s
. There should be an exact string match for one of the provided signatures. It is recommended to use a constant-time string comparison algorithm when comparing the provided and expected signatures to protect against timing attacks.
const {createHmac, timingSafeEqual} = require('crypto')
const express = require('express')
const verifySignature = (sigHeader, body, key) => {
if (!sigHeader || !body) {
return false
}
let signatures = []
try {
const pairs = sigHeader.split(',')
let timestamp = 0
for (let pair of pairs) {
const [key, value] = pair.split('=')
if (key === 't') {
timestamp = Number.parseInt(value)
} else if (key === 's') {
signatures.push(value)
} else {
return false
}
}
// Ensure that a signature exists.
if (signatures.length < 1) {
return false
}
if (timestamp === 0) {
return false
}
// Limit the number of signatures that will be verified.
if (signatures.length > 5) {
return false
}
// Prevent replay attacks https://en.wikipedia.org/wiki/Replay_attack
const maximumTimeDeltaInSeconds = process.env.MAX_SIGNATURE_AGE_IN_SECONDS ? Number(process.env.MAX_SIGNATURE_AGE_IN_SECONDS) : 60
const currentTime = Math.floor(Date.now() / 1000)
if (Math.abs(currentTime - timestamp) > maximumTimeDeltaInSeconds) {
return false
}
// Compute the exptected signature.
const stringToBeSigned = `${timestamp}.${body}`
const hmac = createHmac('sha256', key)
const expectedSignature = hmac.update(stringToBeSigned).digest('hex')
for (let signature of signatures) {
// Prevent timing attacks https://en.wikipedia.org/wiki/Timing_attack
if (timingSafeEqual(Buffer.from(signature), Buffer.from(expectedSignature))) {
return true
}
}
return false
} catch (ex) {
console.log(ex)
return false
}
}
const app = express()
// Configure express to include the raw request body prior to JSON parsing on the request object.
app.use(express.json({
limit: '5mb',
verify: (req, res, buf) => {
req.rawBody = buf.toString()
},
}))
app.post('/rival-webhooks', (req, res) => {
if (!verifySignature(
req.headers['x-signature'],
req.rawBody, // The original 'raw' request body payload before json parsing/formatting.
process.env.API_KEY
)) {
// Send a non 2xx http status code if signature verification fails.
res.sendStatus(401)
return
}
// TODO: Perform action.
// Return a 2xx status code after successful processing.
res.sendStatus(200)
})
The Rival platform allows application to subscribe for notifications on various event types. As the platform evolves new event types may be added to this list. Any application code that is reading an event list should be able to handle the presence of additional event types.
Occurs when the participation status of a Chat Engagement transitions to Completed.
chat string
participant object A descriptor of the Participant that completed the Chat.
id string
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
chat object A descriptor of the Chat that was completed.
id string
name string The name of the Chat as it appeared at time of completion.
engagement object A descriptor of the Engagement
id string
durationInSeconds number
startedAt datetime The UTC date and time when the Engagement began.
endedAt datetime The UTC date and time when the participation status of the Engagement transitioned to Completed.
status string The participation status of the Engagement at the time of completion. This value will always be "Completed" for the Chat Participation Completed event.
values Map<string, object> The response data that was collected in the Chat Engagement. See Participant data objects for details about the payload structure.
Example
{
"type": "ChatParticipationCompleted",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": {
"id": "151bd259-18b7-48f6-a655-713bf0192bec",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
}
},
"chat": {
"id": "9ef59d1c-5c7f-4c73-a1e1-3fedce9173e2",
"name": "Profiling Questionnaire (Jan. 2022)"
},
"engagement": {
"id": "7a7d6b80-149e-4675-92a9-c00a9433b644",
"durationInSeconds": 372,
"startedAt": "2022-03-09T11:30:00.323Z",
"endedAt": "2022-03-09T11:36:12.323Z",
"status": "Completed"
},
"values": {
"Name": "John D. Rockefeller",
"Biography": " An American business magnate and philanthropist. He is widely considered the wealthiest American of all time and the richest person in modern history.",
"Profession": 3,
"Bank_Account_Types": [1, 2],
"Twitter_Account": null
}
}
}
Occurs when the participation status of a Chat Engagement transitions to Disqualified.
chat string
participant object A descriptor of the Participant that got disqualified during the Chat.
id string
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
chat object A descriptor of the Chat in which the participant got disqualified.
id string
name string The name of the Chat as it appeared at time of disqualification.
engagement object A descriptor of the Engagement
id string
durationInSeconds number
startedAt datetime The UTC date and time when the Engagement began.
endedAt datetime The UTC date and time when the participation status of the Engagement transitioned to Disqualified.
status string The participation status of the Engagement at the time of disqualification. This value will always be "Disqualified" for the Chat Participation Disqualified event.
values Map<string, object> The response data that was collected in the Chat Engagement. See Participant data objects for details about the payload structure.
Example
{
"type": "ChatParticipationDisqualified",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": {
"id": "151bd259-18b7-48f6-a655-713bf0192bec",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
}
},
"chat": {
"id": "9ef59d1c-5c7f-4c73-a1e1-3fedce9173e2",
"name": "Profiling Questionnaire (Jan. 2022)"
},
"engagement": {
"id": "7a7d6b80-149e-4675-92a9-c00a9433b644",
"durationInSeconds": 372,
"startedAt": "2022-03-09T11:30:00.323Z",
"endedAt": "2022-03-09T11:36:12.323Z",
"status": "Disqualified"
},
"values": {
"Name": "John D. Rockefeller",
"Biography": " An American business magnate and philanthropist. He is widely considered the wealthiest American of all time and the richest person in modern history.",
"Profession": 3,
"Bank_Account_Types": [1, 2],
"Twitter_Account": null
}
}
}
Occurs when a participant responds to a Question as part of a Chat Engagement.
chat string
question string
participant object A descriptor of the Participant that responded to the Question.
id string
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
chat object A descriptor of the Chat as part of which Question is being responded.
id string
name string The name of the Chat as it appeared at time of responding to the Question.
engagement object A descriptor of the Engagement
question object A descriptor of the Question that is being responded
id string
label string A label that is defined for the Question
type string Type of the Question
value: string/number/array Response value/s as associated number/s or a string depending on the Question Type. See Participant data objects for details about the value based on the Question Type.
Example
{
"type": "ChatResponseProvided",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": {
"id": "151bd259-18b7-48f6-a655-713bf0192bec",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
}
},
"chat": {
"id": "9ef59d1c-5c7f-4c73-a1e1-3fedce9173e2",
"name": "Profiling Questionnaire (Jan. 2022)"
},
"engagement": {
"id": "7a7d6b80-149e-4675-92a9-c00a9433b644",
},
"question": {
"id": "f89e8b41-b834-4a6c-95b9-176186f047c3",
"label": "Profession",
"type": "SingleChoice"
},
"value": 3
}
}
Occurs when the chat reaches a terminal state. This may be due to a Participant completing interaction with the final card in the Chat, or it may be due to a card type that terminates the chat (e.g. jump ahead card or redirect card).
chat string
participant object A descriptor of the Participant that completed interaction with final card in the Chat.
id string
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
chat object A descriptor of the Chat that was ended.
id string
name string The name of the Chat as it appeared at time of script end.
engagement object A descriptor of the Engagement.
id string
durationInSeconds number
startedAt datetime The UTC date and time when the Engagement began.
endedAt datetime The UTC date and time when the participation status of the Engagement transitioned to Completed.
status string The participation status of the Engagement at the time of completion. This value will always be "Completed" for the Chat Script Ended event.
values Map<string, object> The response data that was collected in the Chat Engagement. See Participant data objects for details about the payload structure.
Example
{
"type": "ChatEnded",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": {
"id": "151bd259-18b7-48f6-a655-713bf0192bec",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
}
},
"chat": {
"id": "9ef59d1c-5c7f-4c73-a1e1-3fedce9173e2",
"name": "Profiling Questionnaire (Jan. 2022)"
},
"engagement": {
"id": "7a7d6b80-149e-4675-92a9-c00a9433b644",
"durationInSeconds": 372,
"startedAt": "2022-03-09T11:30:00.323Z",
"endedAt": "2022-03-09T11:36:12.323Z",
"status": "Completed"
},
"values": {
"Name": "John D. Rockefeller",
"Biography": " An American business magnate and philanthropist. He is widely considered the wealthiest American of all time and the richest person in modern history.",
"Profession": 3,
"Bank_Account_Types": [1, 2],
"Twitter_Account": null
}
}
}
Occurs when a participant subscribes for recontact in the Rival platform. This event happens after a participant provides and confirms their SMS number.
None
participant string A unique identifier for the participant.
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
subscriptionStatus string The subscription status of the Participant
subscriptionContext Map<string, string> A collection of key value pairs that return external values that were passed to the rival platform when the subscription occurred. These values may originate from query string parameters on a web chat or from context parameters passed into the subscription api.
Example
{
"type": "ParticipantSubscribed",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": "cac212ac-f99c-4f2b-9e14-b7f39266f93c",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
},
"subscriptionStatus": "Subscribed",
"subscriptionContext": {
"ttclid": "CERC3243CEWR"
}
}
}
Occurs when a participant is unsubscribed from the Rival platform.
None
participant string A unique identifier for the participant.
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
subscriptionStatus string The subscription status of the Participant
Example
{
"type": "ParticipantUnsubscribed",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": "cac212ac-f99c-4f2b-9e14-b7f39266f93c",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
},
"subscriptionStatus": "Unubscribed"
}
}
Occurs when a Participant declines an invitation to subscribe to a Rival Community.
None
participant string A unique identifier for the participant.
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
subscriptionStatus string The subscription status of the Participant
Example
{
"type": "RecontactDeclined",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": "cac212ac-f99c-4f2b-9e14-b7f39266f93c",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
},
"subscriptionStatus": "Subscribed"
}
}
Occurs when a participant responds to a Profile Attribute as part of a Chat Engagement or updated via a CSV import.
attribute string
participant object A descriptor of the Participant that responded to the Question.
id string
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
attribute object A descriptor of the Profile Attribute that was updated.
id string
type string The type of Profile Attribute - String, Decimal, DateTime, Boolean, EmailAddress, E164PhoneNumber, SingleChoice, MultipleChoice
label string The name of the Profile Attribute, as defined in the Participant Directory.
value: string/number/array Response value/s as associated number/s or a string depending on the Attribute Type. See Participant data objects for details about the value based on the Attribute Type.
friendlyValue: string/array Response value/s for Single/Multiple Choice attribute as associated label string/s.
previousValue: string/number/array Previous response value/s as associated number/s or a string depending on the Attribute Type. This value will be null if this is the initial value for the Attribute. See Participant data objects for details about the value based on the Attribute Type.
previousFriendlyValue: string/array Previous response value/s for Single/Multiple Choice attribute as associated label string/s.
previousSetDate: string The UTC date and time when the Attribute was last updated.
Example
{
"type": "ParticipantProfileAttributeChanged",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": {
"id": "151bd259-18b7-48f6-a655-713bf0192bec",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
}
},
"attribute": {
"id": "f89e8b41-b834-4a6c-95b9-176186f047c3",
"type": "EmailAddress",
"label": "Email",
},
"value": "d4@rivaltech.com",
"previousValue": "d1@rivaltech.com",
"previousSetDate": "1999-10-07T19:46:57Z",
}
}
Occurs when a participant responds to any Profile Attribute as part of a Chat Engagement or updated via a CSV import.
None
participant object A descriptor of the Participant that the Profile was updated for
id string
registeredIdentifiers Map<string, string> A collection of third party identifiers that are associated with the participant. The key field in the map represents the name of the third party who issued the identifier. The value field represents the identifier value itself.
attribute object A descriptor of the Profile Attribute that was updated.
id string
type string The type of Profile Attribute - String, Decimal, DateTime, Boolean, EmailAddress, E164PhoneNumber, SingleChoice, MultipleChoice
label string The name of the Profile Attribute, as defined in the Participant Directory.
value: string/number/array Response value/s as associated number/s or a string depending on the Attribute Type. See Participant data objects for details about the value based on the Attribute Type.
friendlyValue: string/array Response value/s for Single/Multiple Choice attribute as associated label string/s.
previousValue: string/number/array Previous response value/s as associated number/s or a string depending on the Attribute Type. This value will be null if this is the initial value for the Attribute. See Participant data objects for details about the value based on the Attribute Type.
previousFriendlyValue: string/array Previous response value/s for Single/Multiple Choice attribute as associated label string/s.
previousSetDate: string The UTC date and time when the Attribute was last updated.
Example
{
"type": "ParticipantProfileChanged",
"id": "8039b896-dbec-452d-9072-0d0774001db6",
"researchDomain": "10dda721-b6a6-4f5a-8e42-e022f3194003",
"occuredAt": "2021-12-07T19:46:57Z",
"data": {
"participant": {
"id": "151bd259-18b7-48f6-a655-713bf0192bec",
"registeredIdentifiers": {
"StarFinancial": "A1103451252",
"Rival": "MDfp8Q0i"
}
},
"attribute": {
"id": "f89e8b41-b834-4a6c-95b9-176186f047c3",
"type": "EmailAddress",
"label": "Email",
},
"value": "d4@rivaltech.com",
"previousValue": "d1@rivaltech.com",
"previousSetDate": "1999-10-07T19:46:57Z",
}
}
Occurs when a distribution message is queued to be sent to a participant.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distribution string A descriptor of the distribution for which the distribution message is associated.
type string "Invitation" or "Reminder"
id string
distributionMessage object A descriptor of the distribution message sent to the participant.
chatUrl string The personalized chat link for the participant.
deliveryTime string Timestamp of the programmed delivery time for the distribution.
engagementPlatform string The platform through which the chat is conducted for this participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
Example
{
"eventType": "DistributionMessageQueued",
"id": "392c94c2-9416-4536-82dd-741b4a309c60",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:15:44.568Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distribution": { "type": "Invitation", "id": "c5ef7931-eaf8-403b-80c5-796e110f5775" },
"distributionMessage": {
"chatUrl": "chatUrl.rival.com",
"deliveryTime": "2025-03-21T20:15:29.537Z",
"engagementPlatform": "WebChat",
"id": "a36f40b5-9d38-585b-954f-3d815a30b28c",
"type": "Invitation"
},
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
}
}
}
Occurs when a distribution message is sent to a participant.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chatId object A descriptor of the Chat that was distributed.
distribution string A descriptor of the distribution for which the distribution message is associated.
type string "Invitation" or "Reminder"
id string
distributionMessage object A descriptor of the distribution message sent to the participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
Example
{
"eventType": "DistributionMessageSent",
"id": "a5fe6afa-1968-4ae3-926f-5d8c262099f7",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:48.726Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distribution": { "type": "Invitation", "id": "c5ef7931-eaf8-403b-80c5-796e110f5775" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"trackingId": "a36f40b5-9d38-585b-954f-3d815a30b28c"
}
}
Occurs when a distribution message is delivered to a participant.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distribution string A descriptor of the distribution for which the distribution message is associated.
type string "Invitation" or "Reminder"
id string
distributionMessage object A descriptor of the distribution message sent to the participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
deliveredAt string Timestamp for delivery to participant.
Example
{
"eventType": "DistributionMessageDelivered",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distribution": { "type": "Invitation", "id": "c5ef7931-eaf8-403b-80c5-796e110f5775" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"deliveredAt": "2025-03-21T20:16:50.805Z",
}
}
Occurs when a distribution message begins delivery by the third party platform.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distribution string A descriptor of the distribution for which the distribution message is associated.
type string "Invitation" or "Reminder"
id string
message object A descriptor of the distribution message sent to the participant.
dateSent string Timestamp for send time of message.
parts array All parts of the message being sent to the participant.
toAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "DeliverDistributionMessageStarted",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distribution": { "type": "Invitation", "id": "c5ef7931-eaf8-403b-80c5-796e110f5775" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"message": {
"dateSent": "2025-03-06T19:23:38.111Z",
"parts": [
{
"content": "You’ve been invited to a chat with {{ResearchDomain.Brand.Name}}. Click to start the engagement in your web browser. {{Chat URL}}",
"type": "Text"
}
],
"toAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"deliveredAt": "2025-03-21T20:16:50.805Z",
}
}
Occurs when a distribution message delivery by the third party platform fails.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distributionMessage object A descriptor of the distribution message sent to the participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "DeliverDistributionMessageFailed",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
}
}
Occurs when a distribution message delivery is canceled.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distributionMessage object A descriptor of the distribution message sent to the participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "DeliverDistributionMessageCanceled",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
}
}
Occurs when a distribution message delivery by the third party platform is unconfirmed.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distributionMessage object A descriptor of the distribution message sent to the participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "DeliverDistributionMessageUnconfirmed",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
}
}
Occurs when a distribution message fails to be queued for sending.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
distributionMessage object A descriptor of the distribution message sent to the participant.
id string
type string "Invitation" or "Reminder"
participant object A descriptor of the Participant that was the target of the distribution message.
id string
messageAddress object A descriptor of the protocol, platform and address through which the distribution message is being sent to the participant.
messagePlatform string Platform through which the message is distributed.
messageProtocol string Protocol through which the message is distributed.
value string Message address value.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "FailedDistributionMessageQueued",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"distributionMessage": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"participant": {
"id": "39b89ae5-b434-499c-94cc-2bc9f9867a16",
"messageAddress": {
"messagePlatform": "Twilio",
"messageProtocol": "SMS",
"value": "+11111111111"
}
},
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
}
}
Occurs when a distribution delivery plan job begins (either manually or scheduled).
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
statistics object A collection of statistics related to the messages being queued as part of the delivery plan.
numberMessagesQueued number
numberTimesStarted number
Example
{
"eventType": "JobDeliveryPlanStarted",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"statistics": {
"numberMessagesQueued": 4,
"numberTimesStarted": 1
},
}
}
Occurs when a distribution delivery plan job completes.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
statistics object A collection of statistics related to the messages being queued as part of the delivery plan.
numberMessagesCanceled number
numberMessagesDelivered number
numberMessagesSendingFailed number
numberMessagesDeliveringFailed number
Example
{
"eventType": "JobDeliveryPlanFinished",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"statistics": {
"numberMessagesCanceled": 2,
"numberMessagesDelivered": 8,
"numberMessagesSendingFailed": 1,
"numberMessagesDeliveringFailed": 1
},
}
}
Occurs when a distribution delivery plan job completes.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
statistics object A collection of statistics related to the messages being queued as part of the delivery plan.
numberMessagesQueued number
numberMessagesCanceled number
numberMessagesSending number
numberMessagesDelivering number
numberMessagesDelivered number
numberMessagesDeliveryUnconfirmed number
numberMessagesSendingFailed number
numberMessagesDeliveringFailed number
Example
{
"eventType": "JobDeliveryPlanCanceled",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" },
"statistics": {
"numberMessagesQueued": 2,
"numberMessagesCanceled": 8,
"numberMessagesSending": 1,
"numberMessagesDelivering": 1,
"numberMessagesDelivered": 2,
"numberMessagesDeliveryUnconfirmed": 1,
"numberMessagesSendingFailed": 1,
"numberMessagesDeliveringFailed": 1
},
}
}
Occurs when a distribution delivery plan job completes.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "EventDeliveryPlanEnabled",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" }
}
}
Occurs when a distribution delivery plan job completes.
chat string
distributionType string The type of distribution for which webhook requests will be sent ("Invitation" or "Reminder").
distribution string
chat object A descriptor of the Chat that was distributed.
targetedDistribution string Timestamp for delivery to participant.
type string "Invitation" or "Reminder"
id string
Example
{
"eventType": "EventDeliveryPlanDisabled",
"id": "13982e16-27e7-4955-b2be-25403b7d2c74",
"researchDomain": "2fbeb79b-ee5d-4bf9-99f0-56c37d166c8a",
"occuredAt": "2025-03-21T20:16:52.073Z",
"data": {
"chat": { "id": "06eec327-157b-4986-ae46-4ed459e6c145" },
"targetedDistribution": { "id": "a36f40b5-9d38-585b-954f-3d815a30b28c", "type": "Invitation" }
}
}
Returns the most recent Event based on the Event Criteria passed as query params. The query params for Event Criteria can be different based on Event type.
type required | string Enum: "ParticipantSubscribed" "ParticipantUnsubscribed" "ChatParticipationCompleted" "ChatParticipationDisqualified" "ChatParticipationOverQuota" "ChatResponseProvided" "RecontactDeclined" "ChatEnded" "ParticipantProfileAttributeChanged" "ParticipantProfileChanged" "DistributionMessageQueued" "DistributionMessageSent" "DistributionMessageDelivered" "DeliverDistributionMessageStarted" "DeliverDistributionMessageFailed" "DeliverDistributionMessageCanceled" "DistributionMessageDeliveryUnconfirmed" "FailedDistributionMessageQueued" "JobDeliveryPlanStarted" "JobDeliveryPlanFinished" "JobDeliveryPlanCanceled" "EventDeliveryPlanEnabled" "EventDeliveryPlanDisabled" |
chatid | string <uuid> Required for ChatParticipationCompleted, RecontactDeclined, |
questionId | string <uuid> required for ChatResponseProvided |
distributionType | string Enum: "Invitation" "Reminder" required for distribution-related events |
distributionId | string <uuid> required for distribution-related events |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "id": "942dc547-ec77-412f-aaff-0b2a35e37832",
- "type": "ParticipantSubscribed",
- "researchDomain": "21f09302-c87c-4d2c-9c2b-4c0916fe0930",
- "occuredAt": "2021-12-07T19:46:57Z",
- "data": {
- "participant": "c2578f51-ce7a-40ef-a39a-acf2942ea14e",
- "registeredIdentifiers": {
- "Rival": "yvncyunk42h4",
- "StarFinancial": "4598015876572456"
}, - "subscriptionStatus": "Subscribed"
}
}
Returns a list of Event Subscriptions for a research domain
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "data": [
- {
- "id": "r7ff877c-6702-411b-b002-1234ye4b19a3",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "ParticipantSubscribed",
- "eventCriteria": { },
- "state": "Enabled",
- "createdAt": "2021-06-07T17:02:12.938Z",
- "updatedAt": "2021-06-07T17:02:16.371Z"
}, - {
- "id": "9d621e7a-6702-411b-b002-67021e4b19a3",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "ParticipantUnsubscribed",
- "eventCriteria": { },
- "state": "Disabled",
- "createdAt": "2021-06-07T17:02:11.938Z",
- "updatedAt": "2021-06-07T17:02:15.371Z"
}, - {
- "id": "1cff877c-411b-b002-6702-9d621e4b19a1",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "ChatParticipationCompleted",
- "eventCriteria": {
- "chat": "debb37b3-a2bd-4d92-8f72-c90ab33f47c6"
}, - "state": "Enabled",
- "createdAt": "2021-06-07T17:02:12.938Z",
- "updatedAt": "2021-06-07T17:02:16.371Z"
}, - {
- "id": "b24af173-827a-4ac1-ab7a-03839a654f29",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "RecontactDeclined",
- "eventCriteria": {
- "chat": "debb37b3-a2bd-4d92-8f72-c90ab33f47c6"
}, - "state": "Enabled",
- "createdAt": "2021-06-07T17:02:12.938Z",
- "updatedAt": "2021-06-07T17:02:16.371Z"
}
]
}
Configures event notifications to be sent over HTTPS to a subscribed endpoint. Up to 50 Event Subscriptions can be created per research domain.
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
name | string The name of the event subscription |
description | string The description of the event subscription |
endpoint required | string <url> An HTTPS url that webhook requests will be sent to. |
eventType required | string Enum: "ParticipantSubscribed" "ParticipantUnsubscribed" "ChatParticipationCompleted" "ChatParticipationDisqualified" "ChatParticipationOverQuota" "ChatResponseProvided" "RecontactDeclined" "ChatEnded" "ParticipantProfileAttributeChanged" "ParticipantProfileChanged" "DistributionMessageQueued" "DistributionMessageSent" "DistributionMessageDelivered" "DeliverDistributionMessageStarted" "DeliverDistributionMessageFailed" "DeliverDistributionMessageCanceled" "DistributionMessageDeliveryUnconfirmed" "FailedDistributionMessageQueued" "JobDeliveryPlanStarted" "JobDeliveryPlanFinished" "JobDeliveryPlanCanceled" "EventDeliveryPlanEnabled" "EventDeliveryPlanDisabled" The type of the event. |
eventCriteria required | object Criteria that is used to filter which events will be sent to a webhook endpoint. Fields vary by event type. See events for details on what criteria can be used for a given event type. |
state required | string Enum: "Enabled" "Disabled" Determines if the subscription is actively listening for events. |
{- "eventType": "ChatParticipationCompleted",
- "eventCriteria": {
- "chat": "debb37b3-a2bd-4d92-8f72-c90ab33f47c6"
}, - "state": "Enabled"
}
{- "id": "1cff877c-6702-411b-b002-9d621e4b19a3",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "ChatParticipationCompleted",
- "eventCriteria": {
- "chat": "debb37b3-a2bd-4d92-8f72-c90ab33f47c6"
}, - "state": "Enabled",
- "createdAt": "2021-06-07T17:02:12.938Z",
- "updatedAt": "2021-06-07T17:02:16.371Z"
}
Gets the details of an Event Subscription.
eventSubscriptionId required | string <uuid> |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "id": "1cff877c-6702-411b-b002-9d621e4b19a3",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "ChatParticipationCompleted",
- "eventCriteria": {
- "chat": "debb37b3-a2bd-4d92-8f72-c90ab33f47c6"
}, - "state": "Enabled",
- "createdAt": "2021-06-07T17:02:12.938Z",
- "updatedAt": "2021-06-07T17:02:16.371Z"
}
Updates an Event Subscription.
eventSubscriptionId required | string <uuid> |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
endpoint required | string <url> An HTTPS url that webhook requests will be sent to. |
state required | string Enum: "Enabled" "Disabled" Determines if the subscription is actively listening for events. |
name | string The name of the event subscription |
description | string The description of the event subscription |
{- "state": "Enabled"
}
{- "id": "1cff877c-6702-411b-b002-9d621e4b19a3",
- "name": "Event Subscription Name",
- "description": "Event Subscription Description",
- "eventType": "ChatParticipationCompleted",
- "eventCriteria": {
- "chat": "debb37b3-a2bd-4d92-8f72-c90ab33f47c6"
}, - "state": "Enabled",
- "createdAt": "2021-06-07T17:02:12.938Z",
- "updatedAt": "2021-06-07T17:02:16.371Z"
}
Delete an Event Subscription.
eventSubscriptionId required | string <uuid> |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "message": "Unauthorized",
- "code": "Unauthorized",
- "errorId": "RPLKDEF"
}
Creates an entrypoint and a system chat from a pre-defined template to opt in participants via SMS. This system chat, which does not exist as a normal chat entity, handles the subscription process triggered by the Create or Update Participant. Returns a list of created entities and parameter values used in the operation.
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
required | object Parameter values to create an opt-in chat. |
{- "config": {
- "locale": "en-CA",
- "chatName": "string"
}
}
{- "id": "9d2417e6-a0da-5412-a4ef-dce58787bc0a",
- "name": "sms-opt-in",
- "status": "finished",
- "parameterValues": [
- {
- "name": "locale",
- "value": "en-CA"
}, - {
- "name": "chatName",
- "value": "Star Financial"
}, - {
- "name": "researchDomain",
- "value": "15feeff6-7c68-4315-98ab-82ed03d33bed"
}
], - "createdAt": "2024-09-13T17:50:38.428Z",
- "updatedAt": "2024-09-13T20:35:04.338Z"
}
Streams a Chat's responses in newline delimited JSON format.
chatId required | string <uuid> |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
questions | Array of strings <uuid> An array of question ids |
object Filter on chat completion status |
{- "questions": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "filterSettings": {
- "includeComplete": true,
- "includeDisqualified": true,
- "includeIncomplete": true,
- "includeOverQuota": true
}
}
{- "participant_id": "78084e63-1c1c-45af-adf1-2af96784867b",
- "engagement_id": "9ce03279-5d67-43fb-baa0-1f436a1eafc1",
- "distribution_type": "Link",
- "distribution_name": "Link for April 2nd",
- "engagement_participation_status": "string",
- "Question_Open_Ended_Video_transcription": "Food is delicious",
- "Question_Open_Ended_Video_sentiment": "NEUTRAL",
- "Question_Open_Ended_Video_sentiment_percentage": 0.5,
- "Question_Open_Ended_Text_Name": "John Doe",
- "Question_Open_Ended_Text_sentiment": "POSITIVE",
- "Question_Open_Ended_Text_sentiment_percentage": 0.8,
- "Question_Open_Ended_Number_Age": 25,
- "Question_Single_Choice_Color": "Red",
- "Question_Multiple_Choice_Drinks": [
- "Coffee"
], - "Question_Open_Ended_Image_has_image": true
}
Get a collection of Chats for a given research domain
first | string Limits the response to accept the first n resources that appear after the cursor specified by after. When after is not specified, the first resources in the collection are returned. Default 20 |
last | string Limits the response to accept the last n resources that appear before the cursor specified by before. When before is not specified, the last resources in the collection are returned. Default 20 |
after | string An opaque cursor that marks the pagination position of the last item in the previous response. Used in conjunction with first. When null, paginated starts from the beginning of the collection. |
before | string An opaque cursor that marks the pagination position of the first item in the previous response. Used in conjunction with last. When null, paginated starts from the end of the collection. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "pageInfo": {
- "startCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
- "endCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
- "hasNextPage": true,
- "hasPreviousPage": false
}, - "data": [
- {
- "id": "2cf52eee-123c-4af9-84d2-966b7ec57722",
- "name": "New Vegan Burger @Starburgers",
- "state": "Published",
- "locale": "en-US",
- "researchDomain": "5uf52eee-123c-4af9-84d2-966b7ec57722",
- "organization": "3489009a-0dc6-488d-b0f2-139a44141e71",
- "createdAt": "2021-06-07T16:36:58.663Z",
- "updatedAt": "2021-06-07T16:36:58.663Z",
- "publishedAt": "2021-06-07T18:36:58.663Z"
}
]
}
Get a collection of Questions for a given published chat. Please make sure to publish a chat if you want to get a collection of questions for a chat. In case of a draft/unpublished chat, it will return an empty collection.
first | string Limits the response to accept the first n resources that appear after the cursor specified by after. When after is not specified, the first resources in the collection are returned. Default 20 |
last | string Limits the response to accept the last n resources that appear before the cursor specified by before. When before is not specified, the last resources in the collection are returned. Default 20 |
after | string An opaque cursor that marks the pagination position of the last item in the previous response. Used in conjunction with first. When null, paginated starts from the beginning of the collection. |
before | string An opaque cursor that marks the pagination position of the first item in the previous response. Used in conjunction with last. When null, paginated starts from the end of the collection. |
x-application required | string <uuid> The public identifier of the Application that issued the request. |
x-api-key required | string The secret API for of the Application that issued the request. |
x-research-domain required | string <uuid> The id of the Research Domain to perform an action on. |
{- "pageInfo": {
- "startCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
- "endCursor": "NDk3ZjZlY2EtNjI3Ni00OTkzLWJmZWItNTNjYmJiYmE2ZjA4",
- "hasNextPage": true,
- "hasPreviousPage": false
}, - "data": [
- {
- "id": "fcce49fa-8762-4858-8e8b-0ac071edb6aa",
- "label": "Name_Alias",
- "type": "OpenEndedText",
- "chat": "ofge49fa-8762-4858-8e8b-0ac071edb6aa",
- "chatText": "Your name or what would you like to be called?"
}, - {
- "id": "b6546ce8-73cc-418d-805e-dac1bbf38f42",
- "label": "Favorite Sauce",
- "type": "MultipleChoice",
- "chat": "ofge49fa-8762-4858-8e8b-0ac071edb6aa",
- "chatText": "Pick all of your favorite sauces"
}
]
}