Skip to main content
1

Get your credentials

Ask your MEGA account manager for a Personal Access Token and your customer id. You’ll get a token that starts with mega_ and a customer UUID.
2

List your most recent leads

curl "https://app.gomega.ai/api/agents/crm/leads?limit=5&sort_by=updated_at&sort_dir=desc" \
  -H "Authorization: Bearer $MEGA_TOKEN" \
  -H "x-customer-id: $MEGA_CUSTOMER_ID"
Response
{
  "leads": [
    {
      "id": "3f8c...",
      "customer_id": "0000...",
      "contact_name": "Jane Buyer",
      "contact_phone": "+12065550123",
      "contact_email": "[email protected]",
      "source_platform": "referral",
      "source_type": "form",
      "status": "active",
      "score": null,
      "qualified": null,
      "current_stage": { "id": "a1..", "slug": "new", "name": "New", "color": "#22c55e" },
      "owner": null,
      "last_interaction_at": null,
      "interaction_count": 0,
      "created_at": "2026-07-01T18:20:00.000Z",
      "updated_at": "2026-07-01T18:20:00.000Z"
    }
  ],
  "total": 128,
  "limit": 5,
  "offset": 0,
  "next_cursor": "eyJ..."
}
3

Create a lead

curl -X POST "https://app.gomega.ai/api/agents/crm/leads" \
  -H "Authorization: Bearer $MEGA_TOKEN" \
  -H "x-customer-id: $MEGA_CUSTOMER_ID" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6b1e9d2a-0001" \
  -d '{ "contact_name": "Sam Seller", "contact_email": "[email protected]", "source_platform": "referral" }'
Returns 201 with the created (or merged) lead under lead.
4

Explore the reference

Open the API Reference tab for the full schema, or read the Pull, Push, and Webhooks guides.
Every successful response includes RateLimit-Limit, RateLimit-Remaining, and RateLimit-Reset headers. See Rate limits.