Sign in

Create data-capture form

POST https://{organization}.myguper.com/api/register/datacapture/form

Defines a data-capture form template (e.g. opt-in/lead form). Each form is a name plus a list of fields. The form must include a field whose name matches the organization's primary identifier (first column of matchPattern, typically cellphone or email); that field is automatically marked as required: true and identifier: true.

A field can also be flagged with metadata: true so its captured value is stored as person metadata (a custom key/value field) instead of being dropped. See the Custom Fields guide and the custom-field endpoints.

Try-it values populated from environment ACME (Demo)


Authentication

Token

Send your user token in the x-guper-authorization header.

Headers

Name Type Description
x-guper-authorization * string User token issued by Guper.
Content-Type * string Always `application/json` for endpoints that accept a JSON body.

Request body

Content-Type: application/json

{
    "name": "optin",
    "fields": [
        {
            "name": "name",
            "label": "Nome",                                    // optional
            "type": "text",                                     // optional
            "required": true,                                   // optional
            "metadata": false,                                  // optional
            "metaKey": "shirt_size"                             // optional
        }
    ]
}

Responses

{
    "id": 1,
    "name": "optin",
    "fields": [
        { "name": "name",      "label": "Nome",     "type": "text",  "required": true },
        { "name": "email",     "label": "E-mail",   "type": "email", "required": true, "identifier": true },
        { "name": "cellphone", "label": "Telefone", "type": "text",  "required": false },
        { "name": "shirt_size", "label": "Tamanho", "type": "text",  "required": false, "metadata": true, "metaKey": "shirt_size" }
    ]
}
Copied to clipboard