Go To Top

Invitation API

This API endpoint triggers email invitation(s). You can create both service review invitations and product review invitations using this endpoint. If you only want to create a service review invitation, you can omit the productReviewInvitation section. When you specify the productReviewInvitation you must include either the products or the productSkus field - but not both. If you include the productSkus field, you must upload your product catalog before you schedule invitations. The preferredSendTime must be in UTC if specified. If preferredSendTime is specified for both the serviceReviewInvitation and productReviewInvitation, then the serviceReviewInvitation must precede the productReviewInvitation.

POST
https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/email-invitations
Parameters
businessUnitId, Required String
The ID of the business unit.
Example: …/v1/private/business-units/{businessUnitId}/email-invitations

x-business-user-id, Optional String
The ID of the business user on behalf of who to create invitation. Should be provided when access token is obtained using client_credentials grant type. User's id can be found in business application's user profile page, and the user must have either Admin or Manager role.
In: Headers
Example: …/v1/private/business-units/{businessUnitId}/email-invitations

Request
{
  "replyTo": "john.doe@trustpilot.com",
  "locale": "en-US",
  "senderName": "John Doe",
  "senderEmail": "john.doe@trustpilot.com",
  "locationId": "ABC123",
  "referenceNumber": "inv00001",
  "consumerName": "John Doe",
  "consumerEmail": "john.doe@trustpilot.com",
  "type": "email",
  "serviceReviewInvitation": {
    "templateId": "507f191e810c19729de860ea",
    "preferredSendTime": "09/07/2013 13:37:00",
    "redirectUri": "http://trustpilot.com",
    "tags": [
      "tag1",
      "tag2"
    ]
  },
  "productReviewInvitation": {
    "templateId": "507f191e810c19729de860ea",
    "preferredSendTime": "09/07/2013 13:37:00",
    "redirectUri": "http://trustpilot.com",
    "products": [
      {
        "sku": "ABC-1234",
        "name": "Metal Toy Car",
        "mpn": "7TX1641",
        "brand": "ACME",
        "imageUrl": "http://www.mycompanystore.com/products/images/12345.jpg",
        "productUrl": "http://www.mycompanystore.com/products/12345.htm",
        "gtin": "01234567890",
        "productCategoryGoogleId": "1267"
      }
    ],
    "productSkus": [
      "sku1",
      "sku2"
    ]
  }
}

When providing a list of email addresses, all invitations data related to the specified consumer email addresses will be deleted. When providing a date, all invitations data older than the specified date will be deleted. It is not possible to specify a list of email addresses and a date at the same time. This is not reversible.

POST
https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-data/delete
Parameters
businessUnitId, Required String
The ID of the business unit.
Example: …/v1/private/business-units/{businessUnitId}/invitation-data/delete

x-business-user-id, Optional String
The ID of the business user on behalf of who to delete invitation data. Should be provided when access token is obtained using client_credentials grant type. User's id can be found in business application's user profile page, and the user must have either Admin or Manager role.
In: Headers
Example: …/v1/private/business-units/{businessUnitId}/invitation-data/delete

Request
{
  "customerEmails": [
    "joe@example.com",
    "jane@example.com"
  ],
  "deleteOlderThan": "09/07/2013 13:37:00"
}

Generate a unique invitation link that can be sent to a consumer by email or website. Use the request parameter called redirectURI to take the user to a product review link after the user has left a service review.

POST
https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/invitation-links
Parameters
businessUnitId, Required String
The ID of the business unit.
Example: …/v1/private/business-units/{businessUnitId}/invitation-links

Request
{
  "locationId": "ABC123",
  "referenceId": "inv00001",
  "email": "john.doe@trustpilot.com",
  "name": "John Doe",
  "locale": "en-US",
  "tags": [
    "tag1",
    "tag2"
  ],
  "redirectUri": "http://trustpilot.com"
}
Response
{
  "id": "9ee95945f2aa3a748301efdc6b8b51d7",
  "url": "https://www.trustpilot.com/evaluate-link/9ee95945f2aa3a748301efdc6b8b51d7"
}

Returns a list of ID and Names of the templates available to be used in invitations. Includes both default/optimized and custom templates.

GET
https://invitations-api.trustpilot.com/v1/private/business-units/{businessUnitId}/templates
Parameters
businessUnitId, Required String
The ID of the business unit.
Example: …/v1/private/business-units/{businessUnitId}/templates

Response
{
  "templates": [
    {
      "id": "507f191e810c19729de860ea",
      "name": "Standard template for English",
      "isDefaultTemplate": true,
      "locale": "da-DK",
      "type": "ServiceReview"
    }
  ]
}