Skip to main content
POST
Create Lead
At least one of 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

* At least one of 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 in sessionStorage as octa_sid. The pixel also injects a hidden field into forms:
For Elementor forms, the pixel also injects:
Your server should read that value from the submitted form and send it to the API as sessionId.
If 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.
Never expose your API key in browser JavaScript. Submit the form to your own backend first, then call the Octanist API from your server.

Example Request

Example Response (201 Created)

Example Response (200 Existing Lead)

An idempotent replay with the same externalId returns the existing lead:
External IDs are supported by the authenticated Leads API and by pixel form mapping. The GTM DataLayer endpoint and the legacy WordPress endpoint return Octanist’s internal lead UUID, but reject externalId input.

Error Responses

Authorizations

X-API-KEY
string
header
required

API key for authentication

Body

application/json

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.

externalId
string

Customer-owned lead identifier, unique within the organization. Whitespace is trimmed and the value acts as an idempotency key.

Required string length: 1 - 255
Example:

"QUOTE-2026-0042"

name
string

Lead name

Example:

"John Doe"

email
string<email>

Lead email

Example:

"john@example.com"

phone
string

Lead phone number

Example:

"+1234567890"

custom

Custom data. Accepts a string or JSON object/array. Non-string values are automatically stringified. Always returned as a string in responses.

note
string

Note to attach to the lead

sessionId
string

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.

Example:

"550e8400-e29b-41d4-a716-446655440000"

website
string

Website URL

Example:

"https://example.com"

path
string

Page path

Example:

"/contact"

gclid
string

Google Ads Click ID

dclid
string

Google Display Click ID

wbraid
string

Google Ads web-to-app click ID

gbraid
string

Google Ads app-to-web click ID

fbc
string

Meta (Facebook) Click ID

fbp
string

Meta (Facebook) Browser ID

ga4cid
string

Google Analytics 4 Client ID

ga4sid
string

Google Analytics 4 Session ID

li_fat_id
string

LinkedIn Click ID

msclkid
string

Microsoft Ads Click ID

ttclid
string

TikTok Click ID

twclid
string

X (Twitter) Click ID

rdt_cid
string

Reddit Click ID

sccid
string

Snapchat Click ID

epik
string

Pinterest click ID

utm_source
string

UTM source

Example:

"google"

utm_medium
string

UTM medium

Example:

"cpc"

utm_campaign
string

UTM campaign

ad_storage
default:false

Ad storage consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.

ad_user_data
default:false

Ad user data consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.

ad_personalization
default:false

Ad personalization consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.

analytics_storage
default:false

Analytics storage consent. Accepts booleans or strings; only "true" (case-insensitive) is treated as true.

Response

Existing lead returned for an idempotent external ID replay

success
boolean
Example:

true

data
object
meta
object