Integrations: FeedLetter API
Available with Business plans.
Create Survey
Creates a new public survey for the authenticated account.
Authentication is done via the Authorization header, using the API key as the header value.
Endpoint
POST https://api.feedletter.co/api/public/surveys
Headers
Authorization: <api-key>
Content-Type: application/json
Request body
{
"survey_type": "newsletter",
"name": "April Product Feedback"
}
For onetime and webrating, include template_id:
{
"survey_type": "onetime",
"name": "Homepage Poll April",
"template_id": "550e8400-e29b-41d4-a716-446655440000"
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
survey_type | string | yes | One of newsletter, onetime, or webrating |
name | string | yes | Name of the survey |
template_id | UUID string | only for onetime and webrating | Template survey ID to clone from |
Rules
-
survey_typemust be one of:newsletteronetimewebrating
-
template_idis required foronetimeandwebrating -
template_idmust belong to the authenticated account -
survey names must be unique per account
Example requests
Newsletter
curl -X POST https://your-api-host/api/public/surveys \
-H "Authorization: <api-key>" \
-H "Content-Type: application/json" \
-d '{
"survey_type": "newsletter",
"name": "April Newsletter Feedback"
}'
One-time
curl -X POST https://your-api-host/api/public/surveys \
-H "Authorization: <api-key>" \
-H "Content-Type: application/json" \
-d '{
"survey_type": "onetime",
"name": "Homepage Poll April",
"template_id": "550e8400-e29b-41d4-a716-446655440000"
}'
Web rating
curl -X POST https://your-api-host/api/public/surveys \
-H "Authorization: <api-key>" \
-H "Content-Type: application/json" \
-d '{
"survey_type": "webrating",
"name": "Pricing Page Rating",
"template_id": "550e8400-e29b-41d4-a716-446655440000"
}'
Success response
For newsletter and onetime surveys:
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"email_section": "<p><strong>How was this issue?</strong></p><p>Pick the option that fits best.</p><ul><li><a href=\"https://a.feedletter.co/s/f47ac10b-58cc-4372-a567-0e02b2c3d479/1\" target=\"_blank\">Great</a></li><li><a href=\"https://a.feedletter.co/s/f47ac10b-58cc-4372-a567-0e02b2c3d479/2\" target=\"_blank\">Okay</a></li><li><a href=\"https://a.feedletter.co/s/f47ac10b-58cc-4372-a567-0e02b2c3d479/3\" target=\"_blank\">Not good</a></li></ul>",
"links": [
{
"href": "https://a.feedletter.co/s/f47ac10b-58cc-4372-a567-0e02b2c3d479/1",
"text": "Great"
},
{
"href": "https://a.feedletter.co/s/f47ac10b-58cc-4372-a567-0e02b2c3d479/2",
"text": "Okay"
},
{
"href": "https://a.feedletter.co/s/f47ac10b-58cc-4372-a567-0e02b2c3d479/3",
"text": "Not good"
}
]
}
For webrating surveys:
{
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
}
Response fields
| Field | Type | Description |
|---|---|---|
id | UUID string | Newly created survey ID |
email_section | string | HTML snippet for embedding the survey into an email |
links | array | List of survey option links |
links item format
| Field | Type | Description |
|---|---|---|
href | string | Public response URL for an option |
text | string | Label shown for that option |
Error response format
{
"message": "TemplateId is required"
}
Common errors
422 Unprocessable Entity
{
"message": "Invalid survey type (know: newsletter, onetime & webrating)"
}
{
"message": "TemplateId is required"
}
{
"message": "Survey with this name already exists"
}
400 Bad Request
{
"message": "Can't find survey with provided template id"
}
{
"message": "Access Denied for provided template id"
} 