Create Survey
create_surveyCreate surveys using JSON schema to collect structured feedback from groups. Returns a shareable response URL with support for conditional questions, response caps, and scheduled expiration.
Instructions
Use this when an agent task involves collecting structured feedback or data from a group of people. Common cases: post-event attendee feedback, product satisfaction after a launch, team health checks, customer ratings after support resolution. Provide a JSON schema object describing the survey. Returns a survey_url to share with respondents and a survey_id to pass to get_results later. The survey accepts responses immediately and stays open until you close it or it expires.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | Survey as a JSON schema object: { title: string, sections: [{ questions: [{ type, label, ...}] }] }. Question types: single_choice (needs options), multi_choice (needs options), text, scale (needs min/max, range ≤ 11), matrix (needs rows + columns). Add showIf: { questionId, operator: "eq"|"neq"|"contains"|"answered", value } to any question for conditional logic. | |
| max_responses | No | Optional. Close the survey automatically after this many responses. | |
| expires_at | No | Optional. ISO 8601 datetime — close the survey automatically at this time (e.g. "2026-04-14T00:00:00Z"). | |
| webhook_url | No | Optional. URL to POST to once when the survey closes. Payload: { survey_id, status: "closed", closed_reason: "manual" | "max_responses", response_count, closed_at }. Fires when you call close_survey or when max_responses is reached. Does not fire when expires_at elapses. |