Coding agent documentation index Fetch the complete documentation index at: https://docs.worklittle.com/docs-agent-manifest.json Use this file to discover all available pages before exploring further.
Surveys
Create and manage organization surveys, collect public responses, and list results via REST, SDK, or CLI.
Overview
/business/surveys creates and manages organization surveys and lists their responses. Respondents submit answers on public routes with no key.
curl -s "https://api.worklittle.com/business/surveys" \
-H "Authorization: Bearer $WORKLITTLE_API_KEY"
Management routes need a Bearer key with employees:read, or a Worklittle Business session on the same paths. API keys skip browser CSRF checks.
Collect responses
Public routes need no key.
# Form schema
curl -s "https://api.worklittle.com/business/surveys/public/SURVEY_ID"
# Submit answers, keyed by question id
curl -s -X POST "https://api.worklittle.com/business/surveys/public/SURVEY_ID/responses" \
-H "Content-Type: application/json" \
-d '{"answers":{"q1":"Yes"}}'
| Method | Path | Description | | --- | --- | --- | | GET | `/business/surveys/public/:id` | Form schema | | POST | `/business/surveys/public/:id/responses` | Submit answers |
GET returns { survey }. A survey that is closed or not shared returns 404 on both routes. The submit body is JSON with an answers map keyed by question id, and optional name, email, and phone. A new submission returns 201 with { ok, response_id }. A respondent who submits again updates their earlier response and gets already_submitted: true.
Read results
curl -s "https://api.worklittle.com/business/surveys/SURVEY_ID/responses" \
-H "Authorization: Bearer $WORKLITTLE_API_KEY"
Manage routes
All require employees:read.
| Method | Path | Description | | --- | --- | --- | | GET | `/business/surveys` | List surveys | | POST | `/business/surveys` | Create | | GET | `/business/surveys/:id` | Get one survey | | PATCH | `/business/surveys/:id` | Update | | DELETE | `/business/surveys/:id` | Delete | | POST | `/business/surveys/:id/duplicate` | Duplicate | | GET | `/business/surveys/:id/responses` | List responses | | PATCH | `/business/surveys/:id/responses/bulk` | Bulk update responses | | DELETE | `/business/surveys/:id/responses/bulk` | Bulk delete responses | | PATCH | `/business/surveys/:id/response-notify` | Response notification settings | | GET, PUT | `/business/surveys/:id/shares` | Share targets |
Errors
| Cause | Result | | --- | --- | | Management route without `employees:read` | `403` | | Public form or submit for a closed or unshared survey | `404` | | `answers` that fail validation | `400` with the error message |
Events
survey.response_submitted, survey.sentiment_average_below, survey.response_count_reached, and survey.deleted are available as webhooks.
SDK
import { createWorklittle } from "worklittle";
const wl = createWorklittle({ apiKey: process.env.WORKLITTLE_API_KEY });
const list = await wl.surveys.list();
const one = await wl.surveys.get("SURVEY_ID");
const created = await wl.surveys.create({ title: "Engagement pulse" });
Install and setup: SDK.