Create, retrieve, update, and delete surveys. Surveys are the core resource for collecting responses.
/surveysRetrieve a paginated list of surveys for your organization.
| Name | Type | Description |
|---|---|---|
page | integer | Page number (default: 1) |
pageSize | integer | Items per page (1-100, default: 20) |
status | string | Filter by status: draft, live, paused, closed |
curl -X GET "https://surventrics.ai/api/v1/surveys?status=live" \
-H "Authorization: Bearer YOUR_API_KEY"{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"title": "Customer Satisfaction Survey",
"description": "Help us improve our service",
"slug": "customer-satisfaction-2024",
"status": "live",
"questionCount": 10,
"responseCount": 142,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-01-20T14:45:00Z"
}
],
"pagination": {
"total": 15,
"page": 1,
"pageSize": 20,
"totalPages": 1,
"hasMore": false
}
}surveys:read/surveysCreate a new survey. The survey will be created in draft status.
| Name | Type | Description |
|---|---|---|
title | string | Survey title (required, max 200 chars) |
description | string | Survey description (max 2000 chars) |
welcomeMessage | string | Message shown at survey start |
thankYouMessage | string | Message shown at completion |
curl -X POST "https://surventrics.ai/api/v1/surveys" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Product Feedback Survey",
"description": "Tell us what you think about our product",
"welcomeMessage": "Thanks for taking the time to share your thoughts!",
"thankYouMessage": "Your feedback has been recorded."
}'{
"id": "550e8400-e29b-41d4-a716-446655440001",
"title": "Product Feedback Survey",
"description": "Tell us what you think about our product",
"slug": "product-feedback-survey",
"status": "draft",
"questionCount": 0,
"responseCount": 0,
"createdAt": "2024-01-21T09:00:00Z",
"updatedAt": "2024-01-21T09:00:00Z"
}surveys:write/surveys/:idRetrieve a single survey by ID. If your API key has the questions:read scope, questions will be included in the response.
| Name | Type | Description |
|---|---|---|
id | string | Survey ID (UUID) |
curl -X GET "https://surventrics.ai/api/v1/surveys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY"surveys:read/surveys/:idUpdate an existing survey. You can change the title, description, messages, and status.
| Name | Type | Description |
|---|---|---|
title | string | Survey title |
description | string | Survey description |
welcomeMessage | string | Welcome message |
thankYouMessage | string | Thank you message |
status | string | Status: draft, live, paused, closed |
curl -X PUT "https://surventrics.ai/api/v1/surveys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "live"}'surveys:write/surveys/:idDelete a survey. Live surveys cannot be deleted - pause or close them first.
curl -X DELETE "https://surventrics.ai/api/v1/surveys/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_API_KEY"Returns 204 No Content on success.
surveys:write