Download OpenAPI specification:
The API enforces a rate limit of 1000 requests per minute. Excess requests will result in a 429 error.
string Email to filter by | |
| offset | integer <int32> Start offset for query |
| includeAll | boolean Include also contacts marked as deleted. |
[- {
- "id": "Ujdno_k8k",
- "email": "frank@example.com",
- "name": "Frank Mushroom",
- "firstname": "Frank",
- "lastname": "Mushroom",
- "eid": "Thow9nJ23",
- "phone": "+358100100",
- "company": "Company Inc",
- "created_at": "2021-09-29T14:14:46.651Z",
- "updated_at": "2021-09-29T14:14:46.651Z",
- "last_action": "2021-09-29T14:14:46.762Z",
- "deleted_at": null,
- "status": "active",
- "type": "customer",
- "nps_status": "promoter",
- "original_nps_status": "passive",
- "recommend_status": "recommend",
- "nps_change": "up"
}
]Upserts a contact in Trustmary. If a contact exists with the same email address it will be updated. If no existing contact is found a new contact will be created.
If the addToLists property is in the request, the contact will also be added in the list. If the list has an automation connected to it, adding a contact with this endpoint also sends the survey invite to the contact. Adding a contact to a list has the same meaning as triggering an invite for the contact to the survey that is connected to the list.
The segment value is only used for the single survey invite a request to this endpoint results in (if addToLists is specified). The value is never saved in the contact data.
Contact data
| email required | string |
| name | string This field can be used to populate the firstname and lastname fields if processName is set to true. |
| firstname | string |
| lastname | string |
| eid | string |
| phone | string |
| company | string |
| type | string Enum: "customer" "employee" |
Array of strings or objects (AddToContactListItem) Array of contact list ID's or list ID/segment tuples. If the optional segment parameter is included in addToLists then a connected automation will be triggered with the segment value included. | |
| removeFromLists | Array of strings Array of contact list ID's |
| addToCampaignIds | Array of strings Array of campaign ID's. For each campaign, its automation pipeline is triggered for the upserted contact. Requires Automation V2 to be active for the organization — otherwise the campaign has no automation pipeline and the request fails with campaign_not_found. The pipeline must also not be stopped, otherwise the request fails with pipeline_stopped. |
| processName | boolean If set to true, firstname and lastname will be extracted and populated from name. |
| field_* | string Set custom field value |
{- "email": "string",
- "name": "string",
- "firstname": "string",
- "lastname": "string",
- "eid": "string",
- "phone": "string",
- "company": "string",
- "type": "customer",
- "addToLists": [
- "string"
], - "removeFromLists": [
- "string"
], - "addToCampaignIds": [
- "string"
], - "processName": true,
- "field_*": "string"
}{- "contact": {
- "id": "85jtL8fjw",
- "email": "frank@example.com",
- "created_at": "2021-09-29T14:14:46.651Z",
- "updated_at": "2021-09-29T14:14:46.651Z",
- "status": "active",
- "type": "customer",
- "name": "Frank Mushroom",
- "phone": "+358100100",
- "eid": "jJkirjK9",
- "company": "Company Inc"
}, - "action": "IMPORT_CREATE",
- "listsUpdated": 1
}string |
{- "email": "string"
}{- "contact": {
- "email": "e@example.com",
- "id": "qaPTkgycqd",
- "created_at": "2021-09-30T09:19:28.385Z",
- "updated_at": "2021-09-30T09:19:28.385Z",
- "deleted_at": "2021-10-11T10:35:01.567Z",
- "last_action": "2021-09-30T09:19:34.691Z",
- "status": "active",
- "type": "customer",
- "name": "Sarah Oak",
- "lastname": "Oak",
- "firstname": "Sarah"
}
}[- {
- "id": "W0yDxNPeK",
- "type": "employee",
- "count": 5,
- "name": "Customer list",
- "source": "list",
- "created_at": "2021-09-29T14:13:53.784Z",
- "updated_at": "2021-09-29T14:13:53.784Z",
- "deleted_at": null
}
]| type | string Enum: "customer" "employee" Survey type to filter by |
| offset | integer <int32> Start offset for query |
[- {
- "id": "5iEwG88ib",
- "type": "customer",
- "count": 2,
- "name": "NPS survey",
- "created_at": "2021-09-29T14:06:13.963Z",
- "updated_at": "2021-09-29T14:06:13.963Z",
- "deleted_at": null
}, - {
- "id": "c8U5ckfks",
- "type": "customer",
- "count": 15,
- "name": "Video review",
- "created_at": "2021-03-23T13:01:10.903Z",
- "updated_at": "2021-03-23T13:01:10.903Z",
- "deleted_at": null
}
]| survey_id required | string String ID of the survey |
| offset | integer <int32> Start offset for pagination |
| limit | integer <int32> [ 1 .. 100 ] Number of responses to return (1–100, default 100) |
| sort | string Enum: "asc" "desc" Sort order by created_at date |
{- "questions": [
- {
- "id": "nps",
- "type": "nps",
- "label": "How likely are you to recommend us?"
}, - {
- "id": "feedback",
- "type": "comment",
- "label": "What is the primary reason for your score?"
}, - {
- "id": "question_b946gsF57n",
- "type": "text",
- "label": "Name"
}
], - "responses": [
- {
- "id": "3ItabcuL5",
- "created_at": "2021-09-29T14:14:46.651Z",
- "completed_at": "2021-09-29T14:14:46.651Z",
- "contact": {
- "id": "Ujdno_k8k",
- "email": "frank@example.com",
- "name": "Frank Mushroom",
- "firstname": "Frank",
- "lastname": "Mushroom",
- "phone": "+358100100",
- "company": "Company Inc"
}, - "answers": {
- "nps": 9,
- "feedback": "Great product!",
- "question_b946gsF57n": "Frank Mushroom"
}, - "customParams": {
- "utm_source": "google",
- "campaign": "spring"
}
}
]
}| surveyId required | string String ID of the survey to get |
{- "id": "TN6I4tvo_",
- "name": "NPS survey",
- "organization_id": "testorg",
- "type": "customer",
- "status": "open",
- "fields": [
- {
- "name": "nps",
- "type": "nps",
- "label": "How likely are you to recommend our\n product to a friend or colleague?"
}, - {
- "name": "feedback",
- "type": "comment",
- "label": "What is the primary reason for your score?"
}, - {
- "name": "comment",
- "type": "comment",
- "label": "Can we publish your feedback on our website and social media?",
- "description": "You can edit your public comment here."
}, - {
- "name": "noPublicConsent",
- "type": "checkbox",
- "label": "I don't want to publish my feedback"
}, - {
- "name": "comment_video",
- "type": "video"
}, - {
- "name": "noVideoRecord",
- "type": "checkbox",
- "label": "I don’t want to record a video comment"
}
]
}| offset | integer <int32> Start offset for query |
[- {
- "id": "Krxo5Mgn9",
- "name": "Popup widget",
- "active": true,
- "template_type": "popup"
}, - {
- "id": "7nmdQtD8R",
- "name": "Inpage Chatbot",
- "active": false,
- "template_type": "inpage"
}
]| offset | integer <int32> Start offset for query |
[- {
- "id": "experiment-1",
- "name": "Which one is better",
- "variants": [
- {
- "id": "7nmdQtD8R",
- "name": "Popup Notification"
}, - {
- "id": "ALF8_O09Ma",
- "name": "Inpage Chatbot"
}
]
}
]{- "webhooks": [
- {
- "id": "webhook_123",
- "name": "My Webhook",
- "events": [
- "surveyAnswerComplete",
- "newReview"
], - "created_at": "2021-09-29T14:14:46.651Z",
- "disabled": false
}
]
}| name | string Webhook name |
| hookUrl required | string Webhook URL to receive events |
| events required | Array of strings Items Enum: "surveyAnswerComplete" "newSurveyAnswer" "newReview" List of events to subscribe to |
{- "name": "My Webhook",
- "events": [
- "surveyAnswerComplete",
- "newReview"
]
}{- "webhook": {
- "id": "webhook_123",
- "name": "My Webhook",
- "events": [
- "surveyAnswerComplete",
- "newReview"
], - "created_at": "2021-09-29T14:14:46.651Z",
- "disabled": false
}
}Returns example webhook payload data for testing and integration purposes
{- "payload": [
- {
- "survey_id": "qmckabcGa",
- "survey_name": "Example survey",
- "answer_id": "3ItabcuL5",
- "answer_values": {
- "nps": 10,
- "name": "Person Name",
- "email": "person.name@domain.com",
- "comment": "The product was awesome!",
- "location": "Helsinki",
- "organization": "Company Inc.",
- "publicConsent": "true",
- "noPublicConsent": "false"
}, - "created_at": "2020-11-19T14:22:43.618Z",
- "organization_id": "5SabcACyt",
- "contact": {
- "review_id": "5j123ddc",
- "source": "trustmary",
- "published": false,
- "eid": "nx123dlTO",
- "created_at": "2020-12-03T13:32:29.370Z",
- "reviewNps": 10,
- "personName": "Person Name",
- "commentText": "The product was awesome!",
- "email": "person.name@domain.com"
}, - "review": {
- "name": "Person Name",
- "phone": "+358501231234",
- "email": "person.name@domain.com",
- "id": "IW5JasdMV",
- "created_at": "2020-11-17T15:18:06.898Z",
- "status": "active",
- "type": "customer"
}, - "automation": {
- "created_at": "2021-02-08T13:58:28.497Z",
- "completed_at": "2021-02-08T13:58:30.357Z"
}
}
]
}| idOrSlug required | string The ID as returned by the review connection list operation or user-specified name (slug) |
{- "id": "12345",
- "slug": "my-hotel-1",
- "title": "My title for my hotel",
- "source": "googlemaps",
- "lang": "en",
- "targetId": "hotel-0001",
}| idOrSlug required | string The ID as returned by the review connection list operation or user-specified name (slug) |
| slug | string or null User-specified name for the connection (unique), or null to unset |
| title | string or null User-specified title for the connection (unique), or null to unset |
{- "slug": "my-hotel",
- "title": "My hotel in Helsinki"
}| slug | string Optional user-specified name for the review connection |
| title | string Optional title for the review connection |
| targetUrl | string The URL for the review service page. Connection parameters will be automatically parsed. |
{- "slug": "my-hotel",
}{- "id": "string",
- "targetId": "string",
- "targetTitle": "string"
}{- "reviewConnections": [
- {
- "id": "12345",
- "slug": "my-hotel-1",
- "title": "My title for my hotel",
- "source": "googlemaps",
- "lang": "en",
- "targetId": "hotel-0001",
}
]
}| entity | string Filter fields by entity type |
{- "fields": [
- {
- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}
]
}| type required | string Field type identifier |
| code required | string Unique field code within the organization |
| label required | string Display name for the field |
| options | Array of any Field options for select-type fields |
| entities | Array of strings Entity types the field is attached to |
{- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
]
}{- "field": {
- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}| id required | string Unique field identifier |
| type required | string Field type identifier |
| code required | string Unique field code within the organization |
| label required | string Display name for the field |
| options required | Array of any Field options for select-type fields |
| entities required | Array of strings Entity types the field is attached to |
| created_at required | string <date-time> |
| updated_at required | string <date-time> |
| deleted_at | string or null <date-time> |
{- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}{- "field": {
- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}| code required | string Field code to delete |
{- "code": "string"
}{- "field": {
- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}| field_id required | string Identifier of the field to retrieve |
{- "field": {
- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}| field_id required | string Identifier of the field to update |
| id required | string Unique field identifier |
| type required | string Field type identifier |
| code required | string Unique field code within the organization |
| label required | string Display name for the field |
| options required | Array of any Field options for select-type fields |
| entities required | Array of strings Entity types the field is attached to |
| created_at required | string <date-time> |
| updated_at required | string <date-time> |
| deleted_at | string or null <date-time> |
{- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}{- "field": {
- "id": "string",
- "type": "string",
- "code": "string",
- "label": "string",
- "options": [
- null
], - "entities": [
- "string"
], - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "deleted_at": "2019-08-24T14:15:22Z"
}
}