create_form
Creates a new form from exact fields or a natural-language brief, with options to publish immediately or save as a draft.
Instructions
Create a new form. Provide exactly one of:
fields(withname): use this when you already know the questions. It is instant and exact.description: a natural-language brief; niceform's AI designs the form (takes 10-60 seconds).
Set publish: true to make the form live right away, optionally with close_at (deadline) and response_limit. Without it the form is a draft: use get_preview_url to look at it, then publish_form.
niceform does not send the form to anyone. Once published, share the returned publicUrl with respondents yourself (email, chat, etc.). To check on results later, call summarize_responses for totals, or list_form_responses with since (the previous latestSubmittedAt) for new answers. Call close_form when collection is over.
Examples:
fields: [{label: "Name", type: "text", required: true}, {label: "Attending?", type: "radio", options: ["Yes", "No"]}], name: "Party RSVP"
description: "Create a customer feedback form for a restaurant with rating scales and comments"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Form name. Required with fields. | |
| fields | No | Exact questions, in order. Mutually exclusive with description; requires name. | |
| publish | No | Publish immediately after creating. | |
| close_at | No | ISO 8601 timestamp with offset after which the form stops accepting responses. Requires publish: true. | |
| description | No | Natural language brief for niceform to design the form (10-60 s). Mutually exclusive with fields. | |
| response_limit | No | Maximum responses to accept. Requires publish: true. | |
| idempotency_key | Yes | A caller-generated unique key (preferably a UUID) for this intended form creation. Reuse the same key when retrying the same request. | |
| style_preference | No | Optional style preference for the form appearance. Default uses organization branding. | default |
| one_response_per_device | No | Allow only one response per device. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| formId | Yes | ||
| status | Yes | ||
| closeAt | No | ||
| publicId | Yes | ||
| publicUrl | No | Present when published; share this with respondents. | |
| stepCount | Yes | ||
| fieldCount | Yes | ||
| previewUrl | Yes | ||
| responseLimit | No | ||
| idempotencyKey | Yes |