> ## Documentation Index
> Fetch the complete documentation index at: https://dev.gomega.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Make your first pull and push request in a couple of minutes.

<Steps>
  <Step title="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.
  </Step>

  <Step title="List your most recent leads">
    ```bash theme={null}
    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"
    ```

    ```json Response theme={null}
    {
      "leads": [
        {
          "id": "3f8c...",
          "customer_id": "0000...",
          "contact_name": "Jane Buyer",
          "contact_phone": "+12065550123",
          "contact_email": "jane@example.com",
          "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..."
    }
    ```
  </Step>

  <Step title="Create a lead">
    ```bash theme={null}
    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": "sam@example.com", "source_platform": "referral" }'
    ```

    Returns `201` with the created (or merged) lead under `lead`.
  </Step>

  <Step title="Explore the reference">
    Open the **API Reference** tab for the full schema, or read the [Pull](/pull-leads), [Push](/push-leads), and [Webhooks](/webhooks) guides.
  </Step>
</Steps>

<Note>
  Every successful response includes `RateLimit-Limit`, `RateLimit-Remaining`, and `RateLimit-Reset` headers. See [Rate limits](/rate-limits).
</Note>
