Get public
Reads a published form as its page draws it: the questions, the screens, the hidden values it takes, how it is answered and its theme.
GET /v1/form/public/{id}
| Address | https://api.hanzo.ai/v1/form/public/{id} |
| Method | GET |
| Operation | get_public_form |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Reads a published form as its page draws it: the questions, the screens, the hidden values it takes, how it is answered and its theme. Nothing about where its responses go. No credential is needed; a form that is private, deleted or never was is a 404.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the form's public id, "<org>.<slug or id>", from the path. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | form.PublicForm | ok |
default | problem-details | refused |
200 body — 52 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
fields | body | form.Field[] | — | Fields are the questions, in order. |
fields[].choices | body | form.Choice[] | — | Choices are what a multiple_choice or dropdown field offers, in order. |
fields[].choices[].id | body | string | — | ID is the choice's id, assigned when empty. |
fields[].choices[].label | body | string | — | Label is the choice as shown. |
fields[].choices[].ref | body | string | — | Ref is how an answer names the choice; unique in the field, defaults to the id. |
fields[].description | body | string | — | Description is the line under the question. |
fields[].id | body | string | — | ID is the field's id: assigned when a write leaves it empty, and kept across edits by sending it back. |
fields[].labels | body | form.Labels | — | |
fields[].labels.center | body | string | — | |
fields[].labels.left | body | string | — | |
fields[].labels.right | body | string | — | |
fields[].multiple | body | boolean | — | Multiple is whether a multiple_choice field takes several choices. |
fields[].ref | body | string | — | Ref is the field's stable name, how an answer and a sink name it: lowercase letters, digits, dash and underscore, at most 64, unique in the form. |
fields[].required | body | boolean | — | Required is whether a completed response must answer it. |
fields[].start | body | integer (int64) | — | Start is where an opinion_scale begins: 0 (the default) or 1. |
fields[].steps | body | integer (int64) | — | Steps is how many points a rating (3 to 10, default 5) or an opinion_scale (5 to 11, default 11) has. |
fields[].title | body | string | — | Title is the question as asked. |
fields[].type | body | string | — | Type is one of short_text, long_text, email, phone, url, number, rating, opinion_scale, yes_no, multiple_choice, dropdown, date and statement. |
fields[].validations | body | form.Validations | — | |
fields[].validations.max_length | body | integer (int64) | — | MaxLength is the most characters a text answer holds, at most the platform's bound for the type. |
fields[].validations.max_value | body | number (double) | — | MaxValue is the most a number answer may be. |
fields[].validations.min_value | body | number (double) | — | MinValue is the least a number answer may be. |
hidden | body | string[] | — | Hidden names the values the page passes in. |
id | body | string | — | ID is the form's public id. |
kind | body | string | — | Kind is form or subscribe. |
settings | body | form.Drawn | — | |
settings.language | body | string | — | Language is the form's language tag. |
settings.mode | body | string | — | Mode is one (a question at a time) or all. |
settings.progress | body | boolean | — | Progress is whether a progress bar is shown. |
thanks | body | form.Screen | — | |
thanks.button | body | string | — | Button is the button's label. |
thanks.description | body | string | — | Description is the text under it. |
thanks.redirect | body | string | — | Redirect is where a thank-you screen sends the respondent instead of showing itself: an https address. |
thanks.title | body | string | — | Title is the screen's heading. |
theme | body | form.Theme | — | |
theme.background | body | string | — | Background is an https address of an image drawn behind the form. |
theme.colors | body | form.Colors | — | |
theme.colors.answer | body | string | — | |
theme.colors.background | body | string | — | |
theme.colors.button | body | string | — | |
theme.colors.question | body | string | — | |
theme.created | body | string | — | Created is when the theme was made, RFC 3339. |
theme.font | body | string | — | Font is the font family the form is set in: letters, digits, spaces and dashes, at most 64. |
theme.id | body | string | — | ID is the theme's id. |
theme.name | body | string | — | Name is the theme's name in its org. |
theme.updated | body | string | — | Updated is when it last changed, RFC 3339. |
title | body | string | — | Title is the form's title. |
welcome | body | form.Screen | — | |
welcome.button | body | string | — | Button is the button's label. |
welcome.description | body | string | — | Description is the text under it. |
welcome.redirect | body | string | — | Redirect is where a thank-you screen sends the respondent instead of showing itself: an https address. |
welcome.title | body | string | — | Title is the screen's heading. |
Failure carries the platform error shape — see Errors.
Examples
hanzo form public get <id>import { Configuration, FormApi } from 'hanzoai';
const api = new FormApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getPublicForm({ id: 'id' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import FormApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = FormApi(client).get_public_form(id='id')cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)
resp, _, err := client.FormAPI.GetPublicForm(context.Background()).Execute()
if err != nil {
return err
}use hanzo_client::apis::{configuration::Configuration, form_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = form_api::get_public_form(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.FormApi;
ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));
var result = new FormApi(client).getPublicForm();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/form/public/<id> \
-H "Authorization: Bearer $HANZO_API_KEY"Tool form, op get_public_form — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "form",
"arguments": {
"op": "get_public_form",
"input": {
"id": "<id>"
}
}
}
}'