Skip to main content
POST
Create lead connection

Authorizations

Authorization
string
header
required

Authenticate with an API access token in the Authorization header: Authorization: Bearer <token>. Create a token from the API Access Tokens page in Contractors Cloud, under Integrations.

Body

application/json
company_id
integer
required

The id of the company this connection belongs to. Required when creating a connection. Immutable afterward — the API ignores this field on update requests.

Example:

6

event_id
integer | null

The id of a marketing event configured for the company. Optional.

lead_source_id
integer | null

The id of a lead source configured for the company that leads from this connection should be attributed to. Optional.

Example:

44

workflow_id
integer | null

The id of a workflow configured for the company, assigned to projects created from leads through this connection. Optional.

rep_primary_id
integer | null

The id of a user in the company to set as the primary sales rep for leads created through this connection. Optional.

Example:

1159

site_type_id
integer | null

The id of a site type assigned to projects created from leads through this connection. Optional.

status_id
integer | null

The id of a project status assigned to projects created from leads through this connection. Optional.

is_active
boolean

Whether the connection accepts lead submissions. Defaults to true if omitted.

Example:

true

data_type
enum<string>
default:json

The format this connection accepts lead submissions in. Required when creating a connection; defaults to json if omitted.

Available options:
json,
excel,
text
Example:

"json"

name
string
default:Default Lead Connection

A display name for the connection. Required when creating a connection; defaults to Default Lead Connection if omitted.

Maximum string length: 255
Example:

"Website Contact Form"

description
string | null

Free-form notes about the connection. Optional.

Response

The created lead connection.

id
string<uuid>

The lead connection's unique identifier.

Example:

"3f9a2b6c-1d4e-4a8b-9c2f-7e5d6a1b8c30"

tenant_id
integer

The id of your organization's account.

Example:

12

company_id
integer

The id of the company within your organization that owns this connection. See Company.

Example:

6

event_id
integer | null

The id of the marketing event this connection is associated with. Null if not set. See Event.

lead_source_id
integer | null

The id of the lead source configured for the company that leads from this connection are attributed to. Null if not set. A lead source is a marketing channel configuration in Contractors Cloud — distinct from the Lead resource returned by this API. See Lead Source.

Example:

44

workflow_id
integer | null

The id of the workflow assigned to projects created from leads through this connection. Null if not set. See Workflow.

rep_primary_id
integer | null

The id of the user set as the primary sales rep for leads created through this connection. Null if not set.

Example:

1159

site_type_id
integer | null

The id of the site type assigned to projects created from leads through this connection. Null if not set.

status_id
integer | null

The id of the project status assigned to projects created from leads through this connection (for example, Lead or Prospect). Null if not set.

is_active
boolean

Whether the connection currently accepts lead submissions. Submitting to an inactive connection returns a 403 response.

Example:

true

data_type
enum<string>

The format this connection accepts lead submissions in. json accepts a JSON object or array; excel accepts an uploaded spreadsheet; text accepts a raw text body that's parsed automatically.

Available options:
json,
excel,
text
Example:

"json"

name
string

A display name for the connection.

Example:

"Website Contact Form"

description
string | null

Free-form notes about the connection. Null if not set.

created_at
string

Timestamp when the connection was created, formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2025-01-05 08:15:00"

updated_at
string

Timestamp when the connection was last updated, formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2025-01-05 08:15:00"

last_lead_received_at
string | null

Timestamp of the most recently received lead through this connection, formatted as YYYY-MM-DD HH:MM:SS. Null until the first lead arrives.

Example:

"2025-02-01 14:22:03"