API documentation

Adding people to Autopilot

Add a person to Autopilot or update their properties.

Adding a person to Autopilot

You can add a person to Autopilot and Delighted will automatically schedule a survey for them and continue sending surveys at the frequency configured in your Autopilot settings. You can also include any properties you would like to attach to the surveys sent to this person via Autopilot.

Updating properties for a person in Autopilot

To change the properties used for a person's Autopilot surveys, send a new Map/Dictionary of properties with their email and/or phone number, which will replace the old properties. Delighted will use the new properties for the next upcoming and all future Autopilot surveys. Other surveys outside of Autopilot will not be affected by these new properties.

Endpoint

For email:
POST /v1/autopilot/email/memberships.json
For SMS:
POST /v1/autopilot/sms/memberships.json

Example request

curl https://api.delighted.com/v1/autopilot/email/memberships.json \
  -u YOUR_DELIGHTED_API_KEY: \
  -H "Content-Type: application/json" \
  -d '{
      "person_email": "jony@appleseed.com",
      "properties": {
        "Purchase Experience": "Mobile App",
        "State": "CA"
      }
    }'
result = Delighted::AutopilotMembership::Email.create(
  person_email: "jony@appleseed.com",
  properties: {
    "Purchase Experience": "Mobile App",
    "State": "CA"
  }
)
result = delighted.autopilotMembership.forEmail().create({
  person_email: 'jony@appleseed.com',
  properties: {
    'Purchase Experience': 'Mobile App',
    'State': 'CA'
  }
});
$properties = ['Purchase Experience' => 'Mobile App', 'State' => 'CA'];
$result = \Delighted\AutopilotMembership\Email::create(['person_email' => 'jony@appleseed.com', 'properties' => $properties]);
properties = {'Purchase Experience': 'Mobile App', 'State': 'CA'}
result = delighted.AutopilotMembership.forEmail().create(person_email='jony@appleseed.com', properties=properties)

Example response

{
  "person": {
    "id": "1",
    "name": null,
    "email": "jony@appleseed.com",
    "created_at": 1703790443,
    "phone_number": "+1555555112"
  },
  "properties": {
    "Purchase Experience": "Mobile App",
    "State": "CA"
  }
}

Parameters

Name Type Description
person_id String Id of the person to be added to or updated in Autopilot.
person_email String Email of the person (required for Autopilot surveys by email).
person_phone_number String

Phone number of the person (required for Autopilot surveys by SMS).

The phone number format must be E.164 (e.g. +17132746524). The value should start with a + followed by the country code and then the number. The value should contain only + and digits, no spaces or other punctuation.

person_name String Name of the person.
properties Map/Dictionary

Custom properties to associate with the survey. You can add as many properties as you need. For each property you wish to add, pass a separate properties[key]=value parameter.

For example, if you wanted to add a “Customer ID” and a “Location”, you would you could pass 2 parameters, properties[customer_id]=123 and properties[location]=USA

You can optionally set a custom Question Product Name to be used in the survey question. For example, our fictitious clothing company, Hem & Stitch, could pass properties[question_product_name]=The Classic Oxford which would result in the following question being shown in the survey: “How likely are you to recommend The Classic Oxford to a friend?”. Check out our help page for more information on this special property.

You can optionally set a custom Delighted Email Subject to be used in the survey email (150 character limit). For example, our fictitious clothing company, Hem & Stitch, could pass properties[delighted_email_subject]=Tell us what you think which would result in the following subject being used in the survey email: “Tell us what you think”. Check out our help page for more information on this special property.

You can optionally set a custom Delighted Intro Message to be used in the survey email (300 character limit). For example, our fictitious clothing company, Hem & Stitch, could pass properties[delighted_intro_message]=How was your recent purchase? which would be displayed in the survey email. Check out our help page for more information on this special property.

You can optionally set a specific Locale to be used in the survey experience. This will determine localization (including language) of the survey experience. This locale string is composed of a lowercase ISO 639-1 language code and an optional uppercase ISO 3166-1 alpha-2 country code, separated by a hyphen. For example, to specify German, pass locale=de, or to specify Chinese (Simplified), pass locale=zh-CN.

We currently support the following locales: ar/Arabic, bg/Bulgarian, zh-CN/Chinese (Simplified), zh-HK/Chinese (Traditional, Hong Kong), zh-TW/Chinese (Traditional, Taiwan), hr/Croatian, cs/Czech, da/Danish, nl/Dutch, en/English, et/Estonian, fi/Finnish, fr/French, ka/Georgian, de/German, el/Greek, he/Hebrew, hu/Hungarian, id/Indonesian, it/Italian, ja/Japanese, ko/Korean, lv/Latvian, lt/Lithuanian, ms/Malaysian, nb/Norwegian Bokmål, pl/Polish, pt-BR/Portuguese (Brazil), pt/Portuguese (Portugal), ro/Romanian, ru/Russian, sr/Serbian, es/Spanish, sv/Swedish, th/Thai, tr/Turkish, and vi/Vietnamese. If you pass a value which is not in this list, the default en/English locale will be used. Please get in touch with us if you would like us to add a locale.

You can optionally configure the thank you page with a custom message and link. For example, pass properties[thank_you_message]=message which will display in the thank you page, once the survey has been completed. You can also pass properties[thank_you_link_text]=text, and properties[thank_you_link_url]=url to configure the link displayed on the thank you page. Check out our help page for more information on these special properties.

Response

Name Type Description
properties Map/Dictionary

A JSON object of property names and values that will be attached to Autopilot survey requests for this person.

Nested under person
id String Id of the person.
name String Name of the person, if defined.
email String Email of the person.
phone_number String Phone number of the person, if defined.
created_at Timestamp A Unix timestamp describing when the person was added.