Skip to main content
Sometimes the form must look like the rest of your site. Build the HTML form yourself, post it to your own backend, and let that backend send the answers to Brein. The flow is three hops:
The visitor never talks to Brein and never sees the form key. Your server adds the key, maps the fields to the form’s question keys, and creates the Respuesta, which lands in the CRM as a contact.

Create the form key

Open Compartir → Desde tu servidor and create a key. The full key looks like frm_sk_… and is shown once; Brein stores only its hash and a short prefix. Copy it into your secret manager. Revoke a key from the same dialog when a server should stop sending. The same dialog lists the endpoint of your form and the exact question keys, with each question’s type and whether it is required. Use those keys as the keys of answers.

Send a response

Send a POST to the public endpoint with the key in the Authorization header:
answers is an object whose keys are the form’s question keys. consent.privacy must be true. Idempotency-Key is optional: sending the same key twice returns the same Respuesta. A successful send answers 202:

Example: your form, your backend

This example has three parts: an HTML form on your site, a Next.js route handler (app/api/brein/route.ts) on your server, and the key in your environment. Replace frm_AbC123dEf4 with your form’s id, and the field names with the keys from Compartir → Desde tu servidor. Put the key in your server’s environment, never in the page:
The HTML form posts to your own route. Its design is yours; the only requirements are the field names and the consent checkbox:
The route handler reads that POST, maps each field to its question key, adds the consent, and forwards it to Brein with the key from the environment. On success it redirects to a thank-you page; on error it passes Brein’s status and body back to the page:
A multi-select question sends a list: read it with data.getAll('intereses') and pass the array as its answer. Any other server works the same way; only the forwarding and the response change.

Status codes

Keep the key on the server

A form key is a credential. Never put it in a browser, a mobile app, a public repository, or any code a visitor can read. The HTML form above posts to your own route precisely so the key never leaves your server. If you would rather not build a form at all, use the embed or the share link: the public door checks Turnstile and the allowed domains for you.