O que você precisa saber
- O formulário é um único objeto JSON com as chaves principais listadas abaixo. Todo salvamento envia todas elas.
- Cada pergunta, opção, linha, regra e cálculo tem um
id: um UUIDv7 em minúsculas, único no formulário. - Títulos e descrições são pequenos documentos de texto formatado, não strings. Já os rótulos de opções, linhas e botões são strings simples.
- Imagens e logos são enviados no trulyform, não via MCP. Mantenha os IDs de arquivo que
get_formretorna e usenullnas perguntas novas. Veja Design e tema. - Qualquer chave que o formato não define faz o salvamento falhar, seja onde for. Já uma configuração conhecida que o tipo de pergunta não usa é simplesmente ignorada.
Chaves principais
A referência técnica a seguir é gerada a partir do código e está em inglês, como os assistentes de IA a leem.
| Chave | Tipo | O que contém |
|---|---|---|
schemaVersion |
2 | Always 2 for new and edited forms. Keep the value get_form returns. |
mediaDefaults |
object | The form-wide image: {assetId, layout, altText}. Keep it as get_form returns it. |
welcome |
object | The first screen: {enabled, title, description, button}. title and description are rich text; button is the start button label. |
ending |
object | The screen after the last question: {title, description}, both rich text. It can show piped answers. |
fields |
list | The questions, in the order respondents see them. |
theme |
object | Colors, font, corner radius and spacing. See the theme fields below. |
settings |
object | Form-wide behavior: {allowReanswer, hiddenFields, fillLimit, language}. |
rules |
list | Logic rules that show, hide, require or skip questions. |
calculations |
list | Named numeric results computed from answers. |
Um formulário novo, do jeito que create_form retorna:
Um formulário novo, do jeito que create_form retorna
{
"schemaVersion": 2,
"mediaDefaults": {
"assetId": null,
"layout": "above",
"altText": ""
},
"welcome": {
"enabled": true,
"title": {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Boas-vindas!"}]}]},
"description": {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Queremos muito ouvir você."}]}]},
"button": "Começar"
},
"ending": {
"title": {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Obrigado!"}]}]},
"description": {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"Sua resposta foi recebida."}]}]}
},
"fields": [
{
"id": "01990000-0000-7000-8000-000000000001",
"kind": "short_text",
"title": {"type":"doc","content":[{"type":"paragraph","content":[]}]},
"description": {"type":"doc","content":[{"type":"paragraph","content":[]}]},
"required": false,
"options": [],
"rows": [],
"settings": {"nextButton":"Próxima"},
"media": {"inherit":true,"assetId":null,"layout":"above"}
}
],
"theme": {
"preset": "paper",
"background": "#ffffff",
"foreground": "#111827",
"primary": "#2563eb",
"buttonText": "#ffffff",
"font": "Inter",
"radius": 12,
"density": "comfortable",
"logoAssetId": null,
"backgroundAssetId": null
},
"settings": {
"allowReanswer": true,
"hiddenFields": [],
"fillLimit": null,
"language": "pt-BR"
},
"rules": [],
"calculations": []
}
Selecione o texto para copiá-lo.
Identificadores
- Formato: 32 dígitos hexadecimais em minúsculas, em grupos de 8-4-4-4-12. O terceiro grupo começa com
7(versão 7), e o quarto, com8,9,aoub. Por exemplo:01990000-0000-7000-8000-000000000001. - Únicos no formulário, contando perguntas, opções, linhas, regras e cálculos juntos. Duas opções de perguntas diferentes não podem ter o mesmo ID.
- Mantenha os IDs existentes ao editar. Respostas, regras de lógica e referências de resposta apontam para eles; uma pergunta com ID novo é uma pergunta nova.
- IDs novos: gere um UUIDv7 ou chame
list_field_typescomid_countpara receber IDs prontos. A parte de data e hora do UUIDv7 não é verificada. Os IDs desta documentação são exemplos fáceis de ler; confira se nenhum deles repete um ID que já existe no formulário. - O
mutation_iddesave_form_drafttambém é um UUIDv7, novo a cada salvamento.
Perguntas
Cada item de fields é uma pergunta:
| Chave | Tipo | Observações |
|---|---|---|
id |
UUIDv7 | Unique across every question, choice, row, rule and calculation in the form. |
kind |
string | One of the question types. |
title |
rich text | The question. Required before publishing. |
description |
rich text | Optional help text under the question. Use an empty paragraph when there is none. |
required |
boolean | Whether respondents must answer. Always false for statements. |
options |
list | Choices as {id, label}, with an optional decimal-string score. Empty for kinds without choices. |
rows |
list | Matrix rows as {id, label}. Empty for every other kind. |
settings |
object | Kind-specific settings. Include nextButton; leave out settings the kind does not use. |
media |
object | {inherit, assetId, layout}. Keep {"inherit": true, "assetId": null, "layout": "above"} unless get_form shows an image. |
O que cada tipo aceita está em Tipos de pergunta.
Texto formatado
Os títulos e as descrições das perguntas, da tela de boas-vindas e da tela final são documentos de texto formatado: um doc com parágrafos, e os parágrafos com texto.
Um título com uma palavra em negrito
{
"type": "doc",
"content": [
{
"type": "paragraph",
"content": [
{ "type": "text", "text": "What is your " },
{ "type": "text", "text": "work", "marks": [{ "type": "bold" }] },
{ "type": "text", "text": " email address?" }
]
}
]
}
Selecione o texto para copiá-lo.
Uma descrição vazia fica assim: {"type": "doc", "content": [{"type": "paragraph", "content": []}]}.
| Nó | Uso |
|---|---|
doc |
The root. Its content is a list of paragraphs. |
paragraph |
A paragraph. Its content holds text, hardBreak and answerToken nodes. An empty paragraph has "content": []. |
text |
A run of text: {"type": "text", "text": "…"}. Optional "marks" style it. |
hardBreak |
A line break inside a paragraph: {"type": "hardBreak"}. |
answerToken |
Pipes in an earlier answer or a calculation: {"type": "answerToken", "attrs": {"source": "answer", "ref": "<question id>", "fallback": "there"}}. |
Text marks: bold, italic, underline, strike, written as "marks": [{"type": "bold"}]. Up to 4 marks per text node and 10,000 characters per text node.
Para ter várias linhas de texto, use vários parágrafos. Não existe formatação de link: para indicar uma página, escreva o endereço como texto, na descrição, por exemplo. Não adicione marcador de obrigatório, como um asterisco: o trulyform já mostra um nas perguntas obrigatórias.
Referências de resposta
Um nó answerToken mostra uma resposta anterior ou o resultado de um cálculo dentro do texto, com um fallback para quando não houver nada a mostrar. Onde os tokens podem aparecer está explicado em Referências de resposta.
Telas de boas-vindas e final
welcome:{enabled, title, description, button}. Para começar direto na primeira pergunta, definaenabledcomo false. Sebuttonficar em branco, aparece o texto padrão.ending:{title, description}, mostrada depois da última pergunta.
Configurações do formulário
| Configuração | Tipo | Observações |
|---|---|---|
allowReanswer |
boolean | Lets respondents go back and change earlier answers. |
hiddenFields |
list of strings | URL parameter names to capture with each response, such as "source". Each starts with a letter and uses only letters, digits and underscores, up to 64 characters. They are stored with the response; they cannot be used in logic or piping, and get_response does not return them. |
fillLimit |
integer or null | Stop accepting responses after this many. null means no limit. |
language |
string | The language respondents see buttons and messages in: "en" or "pt-BR". New forms use their creator's language; a form without it is English. It does not translate the questions you write. |
Tema e imagens
O theme, o mediaDefaults e o media de cada pergunta estão em Design e tema. Via MCP, mantenha os IDs de arquivo exatamente como get_form retorna e use {"inherit": true, "assetId": null, "layout": "above"} nas perguntas novas.