Axuz Developers

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

NameInTypeRequiredDescription
teamIdpathstringyes

Request body

application/json · Required

NameTypeRequiredDescription
namestringyes
slugstringno

Opcional; default = nanoid(10). Regex ^[a-zA-Z0-9_-]{3,64}$.

descriptionstringno
schemaFormsFormSchemano
schema.fieldsarray<FormsField>yes
schema.fields[].idstringyes
schema.fields[].typestringyes

enum: "text", "email", "phone", "textarea", "number", "select", "radio", "checkbox", "date", "url", "file", "hidden"

schema.fields[].labelstringno
schema.fields[].namestringyes
schema.fields[].requiredbooleanno
schema.fields[].placeholderstringno
schema.fields[].help_textstringno
schema.fields[].defaultanyno
schema.fields[].optionsarray<FormsFieldOption>no
schema.fields[].options[].valuestringyes
schema.fields[].options[].labelstringyes
schema.fields[].max_lengthinteger | nullno
schema.fields[].minnumber | nullno
schema.fields[].maxnumber | nullno
schema.fields[].rowsinteger | nullno
schema.fields[].patternstringno
schema.fields[].extraobjectno
schema.stepsarray<FormsStep>no
schema.steps[].idstringyes
schema.steps[].titlestringyes
schema.steps[].field_idsarray<string>yes
schema.settingsFormsSettingsyes
schema.settings.submit_labelstringno
schema.settings.thank_you_messagestringno
schema.settings.redirect_urlstring | nullno
schema.settings.honeypotbooleanno

Se true, adiciona campo axuz_hp e rejeita submits com valor.

schema.settings.double_opt_inbooleanno
schema.settings.triggersarray<FormsTrigger>no
schema.settings.triggers[].idstringyes

client uuid

schema.settings.triggers[].typestringyes

enum: "email", "webhook", "calendar_event", "workspace_task"

schema.settings.triggers[].enabledbooleanyes
schema.settings.triggers[].labelstringno
schema.settings.triggers[].mappingobjectno
schema.settings.triggers[].configobjectno

Shape depende de type: - email: { to: string[] } - webhook: { url: string, secret?: string } - calendar_event/workspace_task: fields específicos do módulo.

schema.settings.notify_emailsarray<string<email>>no

Legacy Fase 178. Promovido em memória pra Triggers no read.

schema.settings.webhook_urlstringno
schema.settings.webhook_secretstringno
layoutstringno
{
  "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

NameTypeRequiredDescription
idstring<uuid>yes
team_idstring<uuid>yes
slugstringyes
namestringyes
descriptionstring | nullno
schemaFormsFormSchemayes
schema.fieldsarray<FormsField>yes
schema.fields[].idstringyes
schema.fields[].typestringyes

enum: "text", "email", "phone", "textarea", "number", "select", "radio", "checkbox", "date", "url", "file", "hidden"

schema.fields[].labelstringno
schema.fields[].namestringyes
schema.fields[].requiredbooleanno
schema.fields[].placeholderstringno
schema.fields[].help_textstringno
schema.fields[].defaultanyno
schema.fields[].optionsarray<FormsFieldOption>no
schema.fields[].options[].valuestringyes
schema.fields[].options[].labelstringyes
schema.fields[].max_lengthinteger | nullno
schema.fields[].minnumber | nullno
schema.fields[].maxnumber | nullno
schema.fields[].rowsinteger | nullno
schema.fields[].patternstringno
schema.fields[].extraobjectno
schema.stepsarray<FormsStep>no
schema.steps[].idstringyes
schema.steps[].titlestringyes
schema.steps[].field_idsarray<string>yes
schema.settingsFormsSettingsyes
schema.settings.submit_labelstringno
schema.settings.thank_you_messagestringno
schema.settings.redirect_urlstring | nullno
schema.settings.honeypotbooleanno

Se true, adiciona campo axuz_hp e rejeita submits com valor.

schema.settings.double_opt_inbooleanno
schema.settings.triggersarray<FormsTrigger>no
schema.settings.triggers[].idstringyes

client uuid

schema.settings.triggers[].typestringyes

enum: "email", "webhook", "calendar_event", "workspace_task"

schema.settings.triggers[].enabledbooleanyes
schema.settings.triggers[].labelstringno
schema.settings.triggers[].mappingobjectno
schema.settings.triggers[].configobjectno

Shape depende de type: - email: { to: string[] } - webhook: { url: string, secret?: string } - calendar_event/workspace_task: fields específicos do módulo.

schema.settings.notify_emailsarray<string<email>>no

Legacy Fase 178. Promovido em memória pra Triggers no read.

schema.settings.webhook_urlstringno
schema.settings.webhook_secretstringno
layoutstringyes

Layout resolvido via ResolveLayout.

statusstringyes

enum: "draft", "published", "archived"

submit_countintegeryes
created_bystring<uuid> | nullno
created_atstring<date-time>yes
updated_atstring<date-time>yes
deleted_atstring<date-time> | nullno

400

Parâmetro/body inválido

NameTypeRequiredDescription
errorstringyes

401

Sem auth ou JWT inválido

NameTypeRequiredDescription
errorstringyes

403

Sem forms:write no team (missing_permission: forms:write; guest é read-only, W-012 S-3).

NameTypeRequiredDescription
errorstringyes

409

Slug já em uso

NameTypeRequiredDescription
errorstringyes

429

Limite de requisições excedido.

NameTypeRequiredDescription
errorstringyes

500

Erro inesperado

NameTypeRequiredDescription
errorstringyes

503

PDP (auth_api) indisponível; fechado, com Retry-After (permission_check_unavailable).

NameTypeRequiredDescription
errorstringyes

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())