PATCH /teams/{teamId}/forms/{formId}
Update parcial (COALESCE)
- 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`.
Publish/archive é PATCH {status}.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
teamId | path | string | yes | |
formId | path | string | yes |
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
name | string | null | no | |
slug | string | null | no | |
description | string | null | no | |
schema | oneOf | no | |
layout | string | null | no | |
status | string | null | no | enum: |
{
"name": "string",
"slug": "string",
"description": "string",
"schema": {
"fields": [
{}
],
"steps": [
{}
],
"settings": {
"submit_label": "string",
"thank_you_message": "string",
"redirect_url": "string",
"honeypot": true,
"double_opt_in": true,
"triggers": [],
"notify_emails": [],
"webhook_url": "string",
"webhook_secret": "string"
}
},
"layout": "string",
"status": "draft"
}Responses
200
Form atualizado
| 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 |
404
Recurso não encontrado
| 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 PATCH 'https://api-forms.axuz.net/teams/TEAM_ID/forms/FORM_ID' \
-H "Authorization: Bearer $AXUZ_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"string","slug":"string","description":"string","schema":{"fields":[{}],"steps":[{}],"settings":{"submit_label":"string","thank_you_message":"string","redirect_url":"string","honeypot":true,"double_opt_in":true,"triggers":[],"notify_emails":[],"webhook_url":"string","webhook_secret":"string"}},"layout":"string","status":"draft"}'Node.js
const res = await fetch("https://api-forms.axuz.net/teams/TEAM_ID/forms/FORM_ID", {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.AXUZ_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"slug": "string",
"description": "string",
"schema": {
"fields": [
{}
],
"steps": [
{}
],
"settings": {
"submit_label": "string",
"thank_you_message": "string",
"redirect_url": "string",
"honeypot": true,
"double_opt_in": true,
"triggers": [],
"notify_emails": [],
"webhook_url": "string",
"webhook_secret": "string"
}
},
"layout": "string",
"status": "draft"
}),
});
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(
"PATCH",
"https://api-forms.axuz.net/teams/TEAM_ID/forms/FORM_ID",
headers={
"Authorization": f"Bearer {os.environ['AXUZ_TOKEN']}",
},
json={
"name": "string",
"slug": "string",
"description": "string",
"schema": {
"fields": [
{},
],
"steps": [
{},
],
"settings": {
"submit_label": "string",
"thank_you_message": "string",
"redirect_url": "string",
"honeypot": True,
"double_opt_in": True,
"triggers": [],
"notify_emails": [],
"webhook_url": "string",
"webhook_secret": "string",
},
},
"layout": "string",
"status": "draft",
},
timeout=30,
)
res.raise_for_status()
print(res.json())