Skip to content

Leads Arrive on Their Own ​

Chapter 5 of the walkthroughs. Connect your website's contact form to Cubrel through the REST API, and let a workflow take over from there: the lead gets a welcome email, the right salesperson gets it with a call task, and sales management hears about it.

Workflows are part of the Pro and Enterprise plans. The REST API is on every plan.

At Tevatek

The website has a "Book a demo" form. Until now, someone copied every request into the sales tool by hand.

1. Create a token that can only create leads ​

Under Workspace > Integrations > API Tokens > New Token:

  • Name: after what uses it.
  • User: the person who should own new leads.
  • Full Access: off. Give only Write on Leads, so a leaked token can't read anything.

The token is shown once. Put it in your website's server configuration, never in the page itself.

At Tevatek

Website demo form, acting as Markus Brenner, head of sales.

A new token with only Write on Leads

See API Tokens.

2. Send the form to Cubrel ​

Your website's backend, or a tool like Zapier, Make or n8n, sends one request per form:

http
POST /api/v1/leads
Authorization: Bearer <token>
Content-Type: application/json

{
  "first_name": "Hanna",
  "last_name": "Frost",
  "email": "h.frost@vossberg-elektro.example",
  "company": "Vossberg Elektro",
  "lead_source": "website",
  "source_detail": "Demo request: Enterprise, 150 users"
}

Cubrel checks the fields like a form in the app would: a missing required field or a key that isn't a field of Leads is refused with a 422 that names it, and nothing is saved.

See Records.

3. Write the welcome email ​

Under Workspace > Email Settings > Email Templates, create a template for Leads. Use Insert field to place the lead's name and company.

At Tevatek

Thanks for your demo request:

Subject: Your Tevatek Planner demo

Hi [First Name], thanks for your interest in Tevatek Planner for [Company]. One of our team will call you within one working day to find a time for the demo.

See Email Templates.

4. Build the workflow ​

Under Workspace > Automation > Workflows > New Workflow, on Leads:

PartSetting
TriggerRecord created
ConditionsLead Source is Website
Action 1: Send emailYour welcome template, To: the lead's Email
Action 2: Create recordTasks: Call @Name, due today + 1 day, owner: Record owner
Action 3: Notify userWhoever should know about new leads

The task is linked to the lead and shows on its timeline. Leads created through the API start workflows just like leads created in the app.

At Tevatek

Demo request from the website notifies Markus: New demo request from @Name at @Company.

The Demo request from the website workflow

See Workflows.

5. Route some leads to someone else ​

To send certain leads to a specific person, build a second workflow with a narrower condition that sets the owner first. Add the opposite condition to the first workflow, so each lead matches exactly one.

At Tevatek

Mateo Herrera handles large customers. The first workflow gets Source Detail does not contain Enterprise. A second one, Enterprise demo to Mateo:

PartSetting
TriggerRecord created
ConditionsLead Source is Website, and Source Detail contains Enterprise
Action 1: Update fieldOwner = Mateo Herrera
Action 2: Send emailThe same welcome template
Action 3: Create recordTasks: Call @Name, owner: Mateo Herrera
Action 4: Notify userMarkus Brenner

6. Test, then switch on ​

Test run in the top bar picks an existing lead and shows what would happen: the email with its recipients and full text, the task's field values, the notification. Nothing is sent or created. When it looks right, switch the workflows to Active.

The Run history tab shows every run afterward. A failed run notifies the workflow's creator and can be retried.

What runs by itself now ​

StepDone by
Website enquiry lands in CubrelREST API
The lead gets a welcome emailWorkflow, Send email
A salesperson has a call task for tomorrowWorkflow, Create record
Sales management knows about itWorkflow, Notify user
Some leads go straight to a specific personWorkflow, Update field

Next: From Lead to Signed Project.

In short ​

QuestionAnswer
How does a website create leads?Its backend calls POST /api/v1/leads with an API token
Who owns leads created by the API?The token's user
Can the token read other data?Only what you grant it; give it Write on Leads only
Do API-created records start workflows?Yes
How do I check a workflow before it runs for real?Test run, which sends and creates nothing