Form That Creates Pipeline Opportunities
Last updated 18 November 2026Applies to Pipelines v6.0
When you finish this tutorial, your site has a public enquiry form. Each submission saves a row, emails you, and adds an opportunity to the first stage of your sales pipeline. The visitor also becomes a CRM contact, and their message is attached to the opportunity as a note.
Your code talks to the Pipelines and CRM modules through your site's REST API, the same API other systems use. You need a site with a sales pipeline that has at least one stage, and a project you can deploy from. If you have not set up a project yet, start with Set Up Your Environment. To learn how pipelines and stages work, see Pipelines Introduction.
Step 1 of 11
Save your API key and site address
The REST API needs your site API key. In your admin, open Integrations > Site API Key and copy the key. Then save two constants:
| Constant | Value |
|---|---|
INSITES_API_KEY | The site API key you copied |
SITE_URL | Your site address, for example https://example.insites.io, with no slash at the end |
This tutorial set its constants through CloudShell, with its insites_env_add tool: one call per constant, each with a key and a value. CloudShell answers with the name, the value and the time it was saved. Your code reads them as context.constants.INSITES_API_KEY and context.constants.SITE_URL.
To check it worked, you use both constants in the next two steps. A wrong key makes the setup page in step 3 come back empty.
All 11 steps done
You finished Form That Creates Pipeline Opportunities. Pick where to go next.