Create a lead
curl --request POST \ --url https://example.com/api/v1/leads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "amount": 1, "companyName": "example", "contactEmail": "hello@example.com", "contactFirstName": "example", "contactLastName": "example", "leadSourceId": "example", "legalName": "example", "ownerId": "example", "referrerClientId": "example", "referrerContactId": "example", "submissionKey": "example", "title": "example" }'Creates a new Lead company + contact person + Deal in one operation. Finds or creates the client by the contact’s exact email; the same email never duplicates the company. referrerClientId (with commissions.manage) records who referred it, and referrerContactId the rep at that company; a rep that is not its contact is refused with 422. submissionKey makes the call idempotent: a key that already opened a deal returns that deal with 200 and writes nothing, or 422 when the deal is outside the caller’s deal scope. Requires deals.create.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The company’s legal name, shown on invoices and on the contract page. Optional: a lead whose legal name is not known yet is created without it. Saved only on a company the lead creates; a company that already exists keeps its own.
The rep who sent the lead: a contact of referrerClientId, which it requires. Never changes a commission.
The caller’s own key for this submission. The first call with a key opens the deal (201); every later call with it returns that same deal (200) and writes nothing.
Example generated
{ "amount": 1, "companyName": "example", "contactEmail": "hello@example.com", "contactFirstName": "example", "contactLastName": "example", "leadSourceId": "example", "legalName": "example", "ownerId": "example", "referrerClientId": "example", "referrerContactId": "example", "submissionKey": "example", "title": "example"}Responses
Section titled “Responses”The submission key had already opened this deal; nothing was written.
object
object
Example generated
{ "data": { "clientId": "example", "clientName": "example", "createdNewClient": true, "dealId": "example" }}Lead and deal created.
object
object
Example generated
{ "data": { "clientId": "example", "clientName": "example", "createdNewClient": true, "dealId": "example" }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Invalid input.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC