Create or update a person and schedule a survey email.
You can add properties to a survey request by passing the properties[key]=value
parameter. Sending this data is useful for filtering responses on the dashboard (e.g. you might send “Location”). You can also use properties to integrate the API across different software tools. For example, if you have a unique customer ID that is used across all of your other tools, you could send it as a property to continue that link within Delighted. You can add as many properties as you like for each person.
Check out our properties guide for more information on how to segment your feedback.
You can create a person without scheduling a survey email by passing the send=false
parameter. This is useful if you wish to handle surveying the person yourself and add your own survey response data via our API.
Depending on the survey throttling interval set on your account, it’s possible that a person you add via the API will not be sent a survey if they have been sent one recently.
POST /v1/people.json
curl https://api.delighted.com/v1/people.json \
-u YOUR_DELIGHTED_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"email": "jony@appleseed.com",
"properties": { "Purchase Experience": "Mobile App", "State": "CA" }
}'
Delighted::Person.create(
email: "jony@appleseed.com",
properties: { "Purchase Experience" => "Mobile App", "State": "CA" }
)
// returns a promise
delighted.person.create({
email: 'jony@appleseed.com',
properties: { "Purchase Experience": "Mobile App", "State": "CA" }
});
delighted.Person.create(email='jony@appleseed.com',
properties={'Purchase Experience': 'Mobile App', 'State': 'CA'})
\Delighted\Person::create([
'email' => 'jony@appleseed.com',
'properties' => [
'Purchase Experience' => 'Mobile App',
'State' => 'CA'
]
]);
{
"id": "1",
"email": "jony@appleseed.com",
"name": null,
"survey_scheduled_at": 1732207941,
"properties": { "Purchase Experience": "Mobile App", "State": "CA" }
}
Name | Type | Description |
---|---|---|
email |
String | Email of the person (required if phone_number is not provided). |
phone_number |
String |
Phone number of the person (required if The phone number format must be E.164 (e.g. |
channel |
String | Survey channel. Specify sms and provide a phone_number to have the survey request sent via SMS. Specify email , or leave out the option, to have the survey request sent via email. |
name |
String | Name of the person. |
delay |
Integer |
The amount of seconds to wait before sending the survey email. The default is 0 (i.e. it will send immediately). This parameter will be ignored if you set send=false . There is no maximum delay.
|
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
For example, if you wanted to add a “Customer ID” and a “Location”, you would
you could pass 2 parameters,
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
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
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
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
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
|
send |
Boolean |
Set to false if you do not want to send a survey email. The default is true .
|
last_sent_at |
Timestamp |
An optional Unix timestamp to manually set the time a person was most recently sent a survey. This value will be considered by the survey throttling system. Formatting example (for the current time): 1732204341 .
|
email_update |
String |
Optional field to update the person's email. If you wish to update a person's email, you need to send the old email via the
For example, to update clientA@delighted.com to clientB@delighted.com, you would pass the following:
You may want to update a person's email, but not survey them. In this case, also pass the |
phone_number_update |
String |
Optional field to update the person's phone number. If you wish to update a person's phone number, you need to send the old number via the
For example, to update +18880000000 to +18881111111, you would pass the following:
You may want to update a person's phone number, but not survey them. In this case, also pass the |