Skip to main content
GET
/
api
/
public
/
v1
/
forms
/
{codeOrId}
Fetch a render-safe form schema
const options = {method: 'GET'};

fetch('{protocol}://{host}/api/public/v1/forms/{codeOrId}?publicKey=', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "code": "<string>",
  "title": "<string>",
  "submitLabel": "<string>",
  "locale": "<string>",
  "fields": [
    {
      "name": "<string>",
      "type": "<string>",
      "label": "<string>",
      "required": true,
      "placeholder": "<string>",
      "help": "<string>",
      "options": [
        {}
      ],
      "config": {},
      "validation": {
        "min_length": 123,
        "max_length": 123,
        "word_min": 123,
        "word_max": 123,
        "pattern": "<string>",
        "min": 123,
        "max": 123,
        "step": 123,
        "integer": true,
        "multiple_emails": true,
        "email_allow_domains": [
          "<string>"
        ],
        "url_https_only": true,
        "url_allow_domains": [
          "<string>"
        ],
        "date_min": "<string>",
        "date_max": "<string>",
        "date_no_weekends": true,
        "select_min": 123,
        "select_max": 123,
        "require_option": "<string>",
        "must_accept": true,
        "rating_min": 123,
        "file_min": 123,
        "file_max": 123,
        "image_min_width": 123,
        "image_min_height": 123,
        "messages": {}
      }
    }
  ]
}

Authorizations

publicKey
string
query
required

Public widget/form key (pk_live_…). Exchanged for a session token by POST /api/public/v1/chat/sessions. Public Forms operations accept the same key directly, supplied via this publicKey query param, the X-Comerix-Public-Key header (publicFormKey scheme), or in the JSON body.

Path Parameters

codeOrId
string
required

The form's stable code or its UUID.

Query Parameters

publicKey
string

Public gateway key. Alternatively send X-Comerix-Public-Key.

locale
string

Optional BCP-47 locale used to localise field labels/help.

Response

Form schema

code
string
required
title
string
required
submitLabel
string
required
locale
string | null
required
fields
object[]
required