POST /teams/{teamId}/forms/
Cria form novo (status=draft)
- Access: Team member
- Service:
https://api-forms.axuz.net
Accepted authentication
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.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
teamId | path | string | yes |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
slug | string | no | Opcional; default = nanoid(10). Regex |
description | string | no | |
schema | FormsFormSchema | no | |
schema.fields | array<FormsField> | yes | |
schema.fields[].id | string | yes | |
schema.fields[].type | string | yes | enum: |
schema.fields[].label | string | no | |
schema.fields[].name | string | yes | |
schema.fields[].required | boolean | no | |
schema.fields[].placeholder | string | no | |
schema.fields[].help_text | string | no | |
schema.fields[].default | any | no | |
schema.fields[].options | array<FormsFieldOption> | no | |
schema.fields[].options[].value | string | yes | |
schema.fields[].options[].label | string | yes | |
schema.fields[].max_length | integer | null | no | |
schema.fields[].min | number | null | no | |
schema.fields[].max | number | null | no | |
schema.fields[].rows | integer | null | no | |
schema.fields[].pattern | string | no | |
schema.fields[].extra | object | no | |
schema.steps | array<FormsStep> | no | |
schema.steps[].id | string | yes | |
schema.steps[].title | string | yes | |
schema.steps[].field_ids | array<string> | yes | |
schema.settings | FormsSettings | yes | |
schema.settings.submit_label | string | no | |
schema.settings.thank_you_message | string | no | |
schema.settings.redirect_url | string | null | no | |
schema.settings.honeypot | boolean | no | Se true, adiciona campo axuz_hp e rejeita submits com valor. |
schema.settings.double_opt_in | boolean | no | |
schema.settings.triggers | array<FormsTrigger> | no | |
schema.settings.triggers[].id | string | yes | client uuid |
schema.settings.triggers[].type | string | yes | enum: |
schema.settings.triggers[].enabled | boolean | yes | |
schema.settings.triggers[].label | string | no | |
schema.settings.triggers[].mapping | object | no | |
schema.settings.triggers[].config | object | no | Shape depende de |
schema.settings.notify_emails | array<string<email>> | no | Legacy Fase 178. Promovido em memória pra Triggers no read. |
schema.settings.webhook_url | string | no | |
schema.settings.webhook_secret | string | no | |
layout | string | no |
{
"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"
}Responses
201
Criado
| Name | Type | Required | Description |
|---|---|---|---|
id | string<uuid> | yes | |
team_id | string<uuid> | yes | |
slug | string | yes | |
name | string | yes | |
description | string | null | no | |
schema | FormsFormSchema | yes | |
schema.fields | array<FormsField> | yes | |
schema.fields[].id | string | yes | |
schema.fields[].type | string | yes | enum: |
schema.fields[].label | string | no | |
schema.fields[].name | string | yes | |
schema.fields[].required | boolean | no | |
schema.fields[].placeholder | string | no | |
schema.fields[].help_text | string | no | |
schema.fields[].default | any | no | |
schema.fields[].options | array<FormsFieldOption> | no | |
schema.fields[].options[].value | string | yes | |
schema.fields[].options[].label | string | yes | |
schema.fields[].max_length | integer | null | no | |
schema.fields[].min | number | null | no | |
schema.fields[].max | number | null | no | |
schema.fields[].rows | integer | null | no | |
schema.fields[].pattern | string | no | |
schema.fields[].extra | object | no | |
schema.steps | array<FormsStep> | no | |
schema.steps[].id | string | yes | |
schema.steps[].title | string | yes | |
schema.steps[].field_ids | array<string> | yes | |
schema.settings | FormsSettings | yes | |
schema.settings.submit_label | string | no | |
schema.settings.thank_you_message | string | no | |
schema.settings.redirect_url | string | null | no | |
schema.settings.honeypot | boolean | no | Se true, adiciona campo axuz_hp e rejeita submits com valor. |
schema.settings.double_opt_in | boolean | no | |
schema.settings.triggers | array<FormsTrigger> | no | |
schema.settings.triggers[].id | string | yes | client uuid |
schema.settings.triggers[].type | string | yes | enum: |
schema.settings.triggers[].enabled | boolean | yes | |
schema.settings.triggers[].label | string | no | |
schema.settings.triggers[].mapping | object | no | |
schema.settings.triggers[].config | object | no | Shape depende de |
schema.settings.notify_emails | array<string<email>> | no | Legacy Fase 178. Promovido em memória pra Triggers no read. |
schema.settings.webhook_url | string | no | |
schema.settings.webhook_secret | string | no | |
layout | string | yes | Layout resolvido via ResolveLayout. |
status | string | yes | enum: |
submit_count | integer | yes | |
created_by | string<uuid> | null | no | |
created_at | string<date-time> | yes | |
updated_at | string<date-time> | yes | |
deleted_at | string<date-time> | null | no |
400
Parâmetro/body inválido
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
401
Sem auth ou JWT inválido
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
403
Sem forms:write no team (missing_permission: forms:write; guest é read-only, W-012 S-3).
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
409
Slug já em uso
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro inesperado
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
503
PDP (auth_api) indisponível; fechado, com Retry-After (permission_check_unavailable).
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
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())