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

# Quickstart

> Get started with the LeadLex API in 5 minutes

## Get Your API Key

1. Log in to your [LeadLex Dashboard](https://app.leadlex.com)
2. Navigate to **Settings** → **API & Integrations**
3. Click **Create API Key**
4. Give your key a name (e.g., "My Bot")
5. Select permissions:
   * **Read**: View contacts, lists, campaigns
   * **Write**: Create and update data
   * **Lexi**: Interact with Lexi AI
6. Click **Create**

<Warning>
  **Save your API key immediately!** You won't be able to see it again after closing the dialog.
</Warning>

Your API key will start with `wbk_` (workspace key) and look like this:

```
wbk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
```

## Make Your First Request

Let's list your contacts using cURL:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://data.leadlex.com/functions/v1/api-gateway/v1/contacts \
    -H "Authorization: Bearer wbk_your_api_key_here"
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "wbk_your_api_key_here"
  BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"

  headers = {"Authorization": f"Bearer {API_KEY}"}
  response = requests.get(f"{BASE_URL}/v1/contacts", headers=headers)

  if response.status_code == 200:
      data = response.json()
      print(f"Found {len(data['data']['contacts'])} contacts")
  else:
      print(f"Error: {response.json()['error']['message']}")
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'wbk_your_api_key_here';
  const BASE_URL = 'https://data.leadlex.com/functions/v1/api-gateway';

  async function listContacts() {
    const response = await fetch(`${BASE_URL}/v1/contacts`, {
      headers: { 'Authorization': `Bearer ${API_KEY}` }
    });
    
    if (response.ok) {
      const data = await response.json();
      console.log(`Found ${data.data.contacts.length} contacts`);
    } else {
      const error = await response.json();
      console.error(`Error: ${error.error.message}`);
    }
  }

  listContacts();
  ```
</CodeGroup>

## Expected Response

```json theme={null}
{
  "data": {
    "contacts": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "full_name": "Jane Doe",
        "email": "jane@example.com",
        "phone": "+1234567890",
        "job_title": "General Counsel",
        "company_name": "Acme Legal",
        "created_at": "2026-02-24T10:00:00Z"
      }
    ]
  },
  "meta": {
    "page": 1,
    "per_page": 50,
    "total": 1
  }
}
```

## Create a Contact

Now let's create a new contact:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    https://data.leadlex.com/functions/v1/api-gateway/v1/contacts \
    -H "Authorization: Bearer wbk_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "full_name": "John Smith",
      "email": "john@example.com",
      "job_title": "CEO",
      "company_name": "Tech Corp"
    }'
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "wbk_your_api_key_here"
  BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"

  headers = {
      "Authorization": f"Bearer {API_KEY}",
      "Content-Type": "application/json"
  }

  data = {
      "full_name": "John Smith",
      "email": "john@example.com",
      "job_title": "CEO",
      "company_name": "Tech Corp"
  }

  response = requests.post(f"{BASE_URL}/v1/contacts", headers=headers, json=data)

  if response.status_code == 200:
      contact = response.json()["data"]
      print(f"Created contact: {contact['id']}")
  else:
      print(f"Error: {response.json()['error']['message']}")
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'wbk_your_api_key_here';
  const BASE_URL = 'https://data.leadlex.com/functions/v1/api-gateway';

  async function createContact() {
    const response = await fetch(`${BASE_URL}/v1/contacts`, {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        full_name: 'John Smith',
        email: 'john@example.com',
        job_title: 'CEO',
        company_name: 'Tech Corp'
      })
    });
    
    if (response.ok) {
      const data = await response.json();
      console.log(`Created contact: ${data.data.id}`);
    } else {
      const error = await response.json();
      console.error(`Error: ${error.error.message}`);
    }
  }

  createContact();
  ```
</CodeGroup>

## Check Rate Limits

Every API response includes rate limit headers:

```
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 995
X-RateLimit-Reset: 1708905600
```

<Tip>
  Rate limits reset at midnight UTC. Check the `X-RateLimit-Remaining` header to track your usage.
</Tip>

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Learn about API keys, permissions, and rate limits
  </Card>

  <Card title="Code Examples" icon="code" href="/examples">
    Complete workflows for common use cases
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/contacts/list">
    Browse all available endpoints
  </Card>

  <Card title="Webhooks" icon="webhook" href="/webhooks">
    Get notified when events occur in your workspace
  </Card>
</CardGroup>
