Create Survey
create_surveyCreate a structured survey to collect feedback from a group. Define questions with types like single choice, multi choice, text, scale, or matrix. Get a shareable URL to collect responses and a survey ID to retrieve results later.
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. The schema parameter is fully typed — follow the field types rather than guessing. 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. Embedding: append "?embed=1" to the returned survey_url to render inside an on any host site (onboarding/lead-capture flows). The embedded form posts events to window.parent with source: "humansurvey" — type "loaded", "resize" (with height), and "submitted" (with responseId and answers). See https://www.humansurvey.co/llms.txt for the full embed contract.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | Survey definition. Each question is a discriminated union keyed by type: single_choice, multi_choice, text, scale, or matrix. Use the typed fields below — do not send free-form JSON. | |
| 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. |