POST /teams/{teamId}/forms/
Cria form novo (status=draft)
- Acesso: Membro da equipe
- Serviço:
https://api-forms.axuz.net
Autenticação aceita
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.bearerSession— JWT de acesso da sessão em `Authorization: Bearer`.
slug opcional → nanoid(10). Regex slug: ^[a-zA-Z0-9_-]{3,64}$. layout normalizado via ResolveLayout.
Parâmetros
| Nome | Em | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
teamId | path | string | sim |
Corpo da requisição
application/json · Obrigatório
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string | sim | |
slug | string | não | Opcional; default = nanoid(10). Regex |
description | string | não | |
schema | FormsFormSchema | não | |
schema.fields | array<FormsField> | sim | |
schema.fields[].id | string | sim | |
schema.fields[].type | string | sim | enum: |
schema.fields[].label | string | não | |
schema.fields[].name | string | sim | |
schema.fields[].required | boolean | não | |
schema.fields[].placeholder | string | não | |
schema.fields[].help_text | string | não | |
schema.fields[].default | any | não | |
schema.fields[].options | array<FormsFieldOption> | não | |
schema.fields[].options[].value | string | sim | |
schema.fields[].options[].label | string | sim | |
schema.fields[].max_length | integer | null | não | |
schema.fields[].min | number | null | não | |
schema.fields[].max | number | null | não | |
schema.fields[].rows | integer | null | não | |
schema.fields[].pattern | string | não | |
schema.fields[].extra | object | não | |
schema.steps | array<FormsStep> | não | |
schema.steps[].id | string | sim | |
schema.steps[].title | string | sim | |
schema.steps[].field_ids | array<string> | sim | |
schema.settings | FormsSettings | sim | |
schema.settings.submit_label | string | não | |
schema.settings.thank_you_message | string | não | |
schema.settings.redirect_url | string | null | não | |
schema.settings.honeypot | boolean | não | Se true, adiciona campo axuz_hp e rejeita submits com valor. |
schema.settings.double_opt_in | boolean | não | |
schema.settings.triggers | array<FormsTrigger> | não | |
schema.settings.triggers[].id | string | sim | client uuid |
schema.settings.triggers[].type | string | sim | enum: |
schema.settings.triggers[].enabled | boolean | sim | |
schema.settings.triggers[].label | string | não | |
schema.settings.triggers[].mapping | object | não | |
schema.settings.triggers[].config | object | não | Shape depende de |
schema.settings.notify_emails | array<string<email>> | não | Legacy Fase 178. Promovido em memória pra Triggers no read. |
schema.settings.webhook_url | string | não | |
schema.settings.webhook_secret | string | não | |
layout | string | não |
{
"name": "string",
"slug": "string",
"description": "string",
"schema": {
"fields": [
{
"id": "string",
"type": "text",
"label": "string",
"name": "string",
"required": true,
"placeholder": "string",
"help_text": "string",
"default": "string",
"options": [],
"max_length": 1,
"min": 1,
"max": 1,
"rows": 1,
"pattern": "string",
"extra": {}
}
],
"steps": [
{
"id": "string",
"title": "string",
"field_ids": []
}
],
"settings": {
"submit_label": "string",
"thank_you_message": "string",
"redirect_url": "string",
"honeypot": true,
"double_opt_in": true,
"triggers": [
{}
],
"notify_emails": [
"pessoa@example.test"
],
"webhook_url": "string",
"webhook_secret": "string"
}
},
"layout": "string"
}Respostas
201
Criado
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
id | string<uuid> | sim | |
team_id | string<uuid> | sim | |
slug | string | sim | |
name | string | sim | |
description | string | null | não | |
schema | FormsFormSchema | sim | |
schema.fields | array<FormsField> | sim | |
schema.fields[].id | string | sim | |
schema.fields[].type | string | sim | enum: |
schema.fields[].label | string | não | |
schema.fields[].name | string | sim | |
schema.fields[].required | boolean | não | |
schema.fields[].placeholder | string | não | |
schema.fields[].help_text | string | não | |
schema.fields[].default | any | não | |
schema.fields[].options | array<FormsFieldOption> | não | |
schema.fields[].options[].value | string | sim | |
schema.fields[].options[].label | string | sim | |
schema.fields[].max_length | integer | null | não | |
schema.fields[].min | number | null | não | |
schema.fields[].max | number | null | não | |
schema.fields[].rows | integer | null | não | |
schema.fields[].pattern | string | não | |
schema.fields[].extra | object | não | |
schema.steps | array<FormsStep> | não | |
schema.steps[].id | string | sim | |
schema.steps[].title | string | sim | |
schema.steps[].field_ids | array<string> | sim | |
schema.settings | FormsSettings | sim | |
schema.settings.submit_label | string | não | |
schema.settings.thank_you_message | string | não | |
schema.settings.redirect_url | string | null | não | |
schema.settings.honeypot | boolean | não | Se true, adiciona campo axuz_hp e rejeita submits com valor. |
schema.settings.double_opt_in | boolean | não | |
schema.settings.triggers | array<FormsTrigger> | não | |
schema.settings.triggers[].id | string | sim | client uuid |
schema.settings.triggers[].type | string | sim | enum: |
schema.settings.triggers[].enabled | boolean | sim | |
schema.settings.triggers[].label | string | não | |
schema.settings.triggers[].mapping | object | não | |
schema.settings.triggers[].config | object | não | Shape depende de |
schema.settings.notify_emails | array<string<email>> | não | Legacy Fase 178. Promovido em memória pra Triggers no read. |
schema.settings.webhook_url | string | não | |
schema.settings.webhook_secret | string | não | |
layout | string | sim | Layout resolvido via ResolveLayout. |
status | string | sim | enum: |
submit_count | integer | sim | |
created_by | string<uuid> | null | não | |
created_at | string<date-time> | sim | |
updated_at | string<date-time> | sim | |
deleted_at | string<date-time> | null | não |
400
Parâmetro/body inválido
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
401
Sem auth ou JWT inválido
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
403
Sem forms:write no team (missing_permission: forms:write; guest é read-only, W-012 S-3).
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
409
Slug já em uso
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro inesperado
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
503
PDP (auth_api) indisponível; fechado, com Retry-After (permission_check_unavailable).
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
curl
curl -sS -X POST 'https://api-forms.axuz.net/teams/TEAM_ID/forms/' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"string","slug":"string","description":"string","schema":{"fields":[{"id":"string","type":"text","label":"string","name":"string","required":true,"placeholder":"string","help_text":"string","default":"string","options":[],"max_length":1,"min":1,"max":1,"rows":1,"pattern":"string","extra":{}}],"steps":[{"id":"string","title":"string","field_ids":[]}],"settings":{"submit_label":"string","thank_you_message":"string","redirect_url":"string","honeypot":true,"double_opt_in":true,"triggers":[{}],"notify_emails":["pessoa@example.test"],"webhook_url":"string","webhook_secret":"string"}},"layout":"string"}'Node.js
const res = await fetch("https://api-forms.axuz.net/teams/TEAM_ID/forms/", {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"slug": "string",
"description": "string",
"schema": {
"fields": [
{
"id": "string",
"type": "text",
"label": "string",
"name": "string",
"required": true,
"placeholder": "string",
"help_text": "string",
"default": "string",
"options": [],
"max_length": 1,
"min": 1,
"max": 1,
"rows": 1,
"pattern": "string",
"extra": {}
}
],
"steps": [
{
"id": "string",
"title": "string",
"field_ids": []
}
],
"settings": {
"submit_label": "string",
"thank_you_message": "string",
"redirect_url": "string",
"honeypot": true,
"double_opt_in": true,
"triggers": [
{}
],
"notify_emails": [
"pessoa@example.test"
],
"webhook_url": "string",
"webhook_secret": "string"
}
},
"layout": "string"
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://api-forms.axuz.net/teams/TEAM_ID/forms/",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"name": "string",
"slug": "string",
"description": "string",
"schema": {
"fields": [
{
"id": "string",
"type": "text",
"label": "string",
"name": "string",
"required": True,
"placeholder": "string",
"help_text": "string",
"default": "string",
"options": [],
"max_length": 1,
"min": 1,
"max": 1,
"rows": 1,
"pattern": "string",
"extra": {},
},
],
"steps": [
{
"id": "string",
"title": "string",
"field_ids": [],
},
],
"settings": {
"submit_label": "string",
"thank_you_message": "string",
"redirect_url": "string",
"honeypot": True,
"double_opt_in": True,
"triggers": [
{},
],
"notify_emails": [
"pessoa@example.test",
],
"webhook_url": "string",
"webhook_secret": "string",
},
},
"layout": "string",
},
timeout=30,
)
res.raise_for_status()
print(res.json())