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

# Quickstart

> Start using the API in less than 5 minutes

## Prerequisites

<Steps>
  <Step title="Leavo Account">
    Create an account at [app.leavo.ai](https://app.leavo.ai)
  </Step>

  <Step title="API Key">
    Generate an API key in **Settings** > **API Keys**
  </Step>
</Steps>

## Your First Request

Let's make a simple request to list your leads:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.leavo.ai/backend/leads" \
    -H "Authorization: Bearer your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.leavo.ai/backend/leads', {
    headers: {
      'Authorization': 'Bearer your_api_key_here'
    }
  });

  const leads = await response.json();
  console.log(leads);
  ```

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

  response = requests.get(
      'https://api.leavo.ai/backend/leads',
      headers={'Authorization': 'Bearer your_api_key_here'}
  )

  print(response.json())
  ```
</CodeGroup>

## Create Your First Lead

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.leavo.ai/backend/leads" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "John Smith",
      "email": "john@example.com",
      "phone": "+15551234567",
      "company": "XYZ Company"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.leavo.ai/backend/leads', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'John Smith',
      email: 'john@example.com',
      phone: '+15551234567',
      company: 'XYZ Company'
    })
  });

  const lead = await response.json();
  console.log('Lead created:', lead);
  ```

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

  response = requests.post(
      'https://api.leavo.ai/backend/leads',
      headers={
          'Authorization': 'Bearer your_api_key_here',
          'Content-Type': 'application/json'
      },
      json={
          'name': 'John Smith',
          'email': 'john@example.com',
          'phone': '+15551234567',
          'company': 'XYZ Company'
      }
  )

  print('Lead created:', response.json())
  ```
</CodeGroup>

## Process Message with AI

Send a message for AI processing:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.leavo.ai/ai/process" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "tenant_id": "your_tenant_id",
      "lead_id": "lead_id",
      "role": "user",
      "content": "Hello, I would like to know more about the product",
      "message_type": "text",
      "debounce": true,
      "postback_url": "https://your-webhook.com/callback"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.leavo.ai/ai/process', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tenant_id: 'your_tenant_id',
      lead_id: 'lead_id',
      role: 'user',
      content: 'Hello, I would like to know more about the product',
      message_type: 'text',
      debounce: true,
      postback_url: 'https://your-webhook.com/callback'
    })
  });
  ```
</CodeGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Manage Leads" icon="users" href="/en/api-reference/leads/list">
    Complete leads CRUD
  </Card>

  <Card title="Configure Webhooks" icon="webhook" href="/en/api-reference/webhooks/overview">
    Integrate with external systems
  </Card>

  <Card title="Create Cadences" icon="calendar" href="/en/api-reference/cadences/overview">
    Automate message sequences
  </Card>

  <Card title="Custom Fields" icon="sliders" href="/en/api-reference/custom-fields/overview">
    Add custom fields to leads
  </Card>
</CardGroup>
