Endpoint

POST /getFormFields

Parâmetros

hostId
string (UUID)

ID do host. Se omitido, é derivado do token.

domainId
string (UUID)

Valida que o host pertence ao domain informado.

avatarIds
array de UUIDs

Filtra variáveis vinculadas aos avatares especificados.

show_other_values
boolean

Se true, inclui variáveis não relacionadas a nenhum formulário.

Exemplo

curl -X POST {BASE_URL}/getFormFields \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "avatarIds": ["uuid1", "uuid2"],
    "show_other_values": true
  }'

Resposta

[
  {
    "id": "uuid",
    "host_id": "uuid",
    "name": "nome_cliente",
    "label": "Nome do Cliente",
    "type": "text",
    "required": false,
    "default_value": null,
    "validation": null,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z",
    "deleted_at": null
  }
]

Campos da Resposta

id
string
UUID da variável.
host_id
string
UUID do host proprietário.
name
string
Nome canônico da variável (ex: nome_cliente).
label
string
Rótulo exibido na interface.
type
string
Tipo de dado: text, number, boolean, integer, date, datetime, json, email, phone.
required
boolean
Se a variável é obrigatória por padrão.
default_value
any
Valor padrão quando não capturado.
validation
object
Fragmentos de JSON Schema para validação.
deleted_at
string | null
Preenchido em caso de soft delete.

Erros

CódigoDescrição
401Token inválido ou ausente
400Parâmetros inválidos
500Erro interno do servidor