The ChatToSurvey.com API allows you to programmatically manage your projects, collect responses, and integrate with your existing systems.
All API requests require authentication using your API key. Include it in the Authorization header:
Authorization: Bearer your_api_key_here
GET /api/projects
Response:
{
"projects": [
{
"id": 1,
"name": "Customer Feedback",
"description": "Collect feedback from customers",
"created_at": "2024-03-06T12:00:00Z"
}
]
}
POST /api/projects
Request:
{
"project": {
"name": "New Project",
"description": "Project description",
"agenda": "AI context for questions"
}
}
Response:
{
"id": 2,
"name": "New Project",
"description": "Project description",
"created_at": "2024-03-06T12:00:00Z"
}
GET /api/responses?project_id=1
Response:
{
"responses": [
{
"id": 1,
"project_id": 1,
"respondent_id": 1,
"data": {
"question1": "answer1",
"question2": "answer2"
},
"created_at": "2024-03-06T12:00:00Z"
}
]
}
POST /api/responses
Request:
{
"response": {
"project_id": 1,
"respondent_id": 1,
"data": {
"question1": "answer1",
"question2": "answer2"
}
}
}
Response:
{
"id": 2,
"project_id": 1,
"respondent_id": 1,
"data": {
"question1": "answer1",
"question2": "answer2"
},
"created_at": "2024-03-06T12:00:00Z"
}
Set up webhooks to receive real-time notifications about new responses and other events.
POST /api/outgoing_webhooks
Request:
{
"webhook": {
"url": "https://your-domain.com/webhook",
"events": ["response.created", "response.updated"]
}
}
API requests are limited to 100 requests per minute per API key. If you need a higher limit, please contact support.