Create Lead
Create a new lead
name, email, phone, or custom must be provided.
When you include attribution fields such as click IDs, UTM parameters, website, path, or consent fields, Octanist stores that attribution on the lead’s session. Existing API integrations can keep sending those fields directly.
If the Octanist pixel is installed on the website, you can also send sessionId to link the lead to an existing pixel session. This is the preferred setup for server-side form capture because it keeps the lead connected to the original page views and attribution.
When sessionId is provided, Octanist links the lead to that existing session and uses the attribution already stored on the session. Direct attribution fields in the same request are only used when sessionId is missing.
Request Body
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | No* | - | Lead name |
email | string | No* | - | Lead email |
phone | string | No* | - | Lead phone number |
custom | string | object | No* | - | Custom data. Accepts a string or JSON object/array. Non-string values are automatically stringified. Always returned as a string in responses. |
note | string | No | - | Note to attach to the lead |
sessionId | string | No | - | Existing Octanist pixel session ID. Send the value from the hidden octa_sid form field or window.OCT.getSessionId(). |
website | string | No | - | Website URL |
path | string | No | - | Page path |
gclid | string | No | - | Google Ads Click ID |
dclid | string | No | - | Google Display Click ID |
wbraid | string | No | - | Google Ads web-to-app click ID |
gbraid | string | No | - | Google Ads app-to-web click ID |
fbc | string | No | - | Meta (Facebook) Click ID |
fbp | string | No | - | Meta (Facebook) Browser ID |
ga4cid | string | No | - | Google Analytics 4 Client ID |
ga4sid | string | No | - | Google Analytics 4 Session ID |
li_fat_id | string | No | - | LinkedIn Click ID |
msclkid | string | No | - | Microsoft Ads Click ID |
ttclid | string | No | - | TikTok Click ID |
twclid | string | No | - | X (Twitter) Click ID |
rdt_cid | string | No | - | Reddit Click ID |
sccid | string | No | - | Snapchat Click ID |
epik | string | No | - | Pinterest click ID |
utm_source | string | No | - | UTM source |
utm_medium | string | No | - | UTM medium |
utm_campaign | string | No | - | UTM campaign |
ad_storage | boolean | string | No | false | Ad storage consent |
ad_user_data | boolean | string | No | false | Ad user data consent |
ad_personalization | boolean | string | No | false | Ad personalization consent |
analytics_storage | boolean | string | No | false | Analytics storage consent |
name, email, phone, or custom is required.
Consent fields accept both booleans and strings. Only the string "true" (case-insensitive) is treated as true; any other string value is treated as false.
Session linking
When the pixel runs on a page, it creates a session ID and stores it insessionStorage as octa_sid. The pixel also injects a hidden field into forms:
sessionId.
sessionId is valid, Octanist links the new lead to the existing pixel session. If sessionId is missing, Octanist creates a synthetic session from the attribution fields in the request. Direct attribution fields in the request are not merged into an existing pixel session when sessionId is provided.
Example Request
Example Response (201 Created)
Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid JSON, missing required field, invalid field values, or invalid sessionId |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | Lead rejected by filtering rules |
| 500 | INTERNAL_ERROR | Server error |
Authorizations
API key for authentication
Body
Lead data. At least one of name, email, phone, or custom is required.
At least one of name, email, phone, or custom is required.
Lead name
"John Doe"
Lead email
"john@example.com"
Lead phone number
"+1234567890"
Custom data. Accepts a string or JSON object/array. Non-string values are automatically stringified. Always returned as a string in responses.
Note to attach to the lead
Existing Octanist pixel session ID. Use the value from the hidden octa_sid form field or window.OCT.getSessionId(). When provided, the lead uses the existing session attribution and direct attribution fields in this request are ignored.
"550e8400-e29b-41d4-a716-446655440000"
Website URL
"https://example.com"
Page path
"/contact"
Google Ads Click ID
Google Display Click ID
Google Ads web-to-app click ID
Google Ads app-to-web click ID
Meta (Facebook) Click ID
Meta (Facebook) Browser ID
Google Analytics 4 Client ID
Google Analytics 4 Session ID
LinkedIn Click ID
Microsoft Ads Click ID
TikTok Click ID
X (Twitter) Click ID
Reddit Click ID
Snapchat Click ID
Pinterest click ID
UTM source
"google"
UTM medium
"cpc"
UTM campaign
Ad storage consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.
Ad user data consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.
Ad personalization consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.
Analytics storage consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.