Create Lead
Create a new lead
externalId, name, email, phone, or custom must be provided.
Use externalId for a customer-owned business identifier, such as an order number, quotation number, application ID, opportunity ID, or CRM lead ID. The value is trimmed, can contain up to 255 characters, and must be unique within your Octanist organization.
When externalId is provided, it also acts as an idempotency key. Repeating a request with the same external ID returns the existing lead with 200 OK and created: false. If the repeated request supplies an email or phone number that conflicts with the existing lead, Octanist returns 409 CONFLICT instead.
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
externalId, 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)
Example Response (200 Existing Lead)
An idempotent replay with the sameexternalId returns the existing lead:
externalId input.Error Responses
Authorizations
API key for authentication
Body
Lead data. At least one of externalId, name, email, phone, or custom is required.
At least one of externalId, name, email, phone, or custom is required.
Customer-owned lead identifier, unique within the organization. Whitespace is trimmed and the value acts as an idempotency key.
1 - 255"QUOTE-2026-0042"
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.