Skip to main content
POST
/
api
/
agents
/
crm
/
leads
/
bulk
Bulk create / merge leads
curl --request POST \
  --url https://app.gomega.ai/api/agents/crm/leads/bulk \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-customer-id: <x-customer-id>' \
  --data '
{
  "leads": [
    {
      "row_ref": "<string>",
      "contact_name": "<string>",
      "contact_phone": "<string>",
      "contact_email": "[email protected]",
      "stage_slug": "<string>",
      "owner_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "custom_fields": {}
    }
  ],
  "on_duplicate": "update",
  "dry_run": false
}
'
{
  "dry_run": true,
  "summary": {
    "total": 123,
    "created": 123,
    "updated": 123,
    "skipped": 123,
    "failed": 123
  },
  "results": [
    {
      "row_ref": "<string>",
      "lead_id": "<string>",
      "errors": [
        "<string>"
      ],
      "ignored_custom_fields": [
        "<string>"
      ]
    }
  ],
  "unknown_custom_fields": [
    "<string>"
  ]
}

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
leads
object[]
required
Required array length: 1 - 500 elements
on_duplicate
enum<string>
default:update
Available options:
update,
skip
dry_run
boolean
default:false

Response

Per-row import results + summary.

dry_run
boolean
required
summary
object
required
results
object[]
required
unknown_custom_fields
string[]
required

Custom-field slugs that did not match any definition and were ignored.