Skip to main content
POST
/
api
/
agents
/
crm
/
leads
Create a single lead
curl --request POST \
  --url https://app.gomega.ai/api/agents/crm/leads \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-customer-id: <x-customer-id>' \
  --data '
{
  "contact_name": "<string>",
  "contact_phone": "<string>",
  "contact_email": "[email protected]",
  "stage_slug": "<string>",
  "custom_fields": {}
}
'
{
  "lead": {
    "id": "<string>",
    "customer_id": "<string>",
    "source_platform": "<string>",
    "source_type": "<string>",
    "status": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "contact_name": "<string>",
    "contact_phone": "<string>",
    "contact_email": "<string>",
    "score": 123,
    "qualified": true,
    "current_stage": {
      "id": "<string>",
      "slug": "<string>",
      "name": "<string>",
      "color": "<string>"
    },
    "owner": {
      "id": "<string>",
      "name": "<string>",
      "role_name": "<string>"
    },
    "last_interaction_at": "2023-11-07T05:31:56Z",
    "interaction_count": 123,
    "custom_fields": {}
  }
}

Authorizations

Authorization
string
header
required

Admin-issued Personal Access Token, e.g. Authorization: Bearer mega_<64 hex>. The key carries scopes (public_api:leads:read, public_api:leads:write, public_api:webhooks:manage) and is locked to one customer.

Headers

x-customer-id
string<uuid>
required

The customer this request acts on. Must match the customer your key is locked to.

Idempotency-Key
string

Client-generated unique key. Replaying the same key returns the original stored response instead of creating duplicates. Scoped per customer + endpoint; reuse with a different body returns 409.

Body

application/json

At least one of contact_name, contact_phone, contact_email is required.

contact_name
string
contact_phone
string
contact_email
string<email>
source_platform
enum<string>
Available options:
google_ads,
meta_ads,
google_organic,
direct,
referral,
hubspot,
zoho,
ghl,
shopify,
zenmaid,
lead_docket,
salesforce
source_type
enum<string>
Available options:
form,
phone_call,
email,
chat,
sms,
manual,
import
stage_slug
string
custom_fields
object

Map of custom-field slug to a scalar value (string | number | boolean | null).

Response

The created (or merged) lead.

lead
object
required