# Lead

Manage leads in your Tomba account.

## Usage

```bash
tomba lead list
tomba lead get --id <lead_id>
tomba lead create --email "<email>" --list-id <list_id>
tomba lead update --id <lead_id> --first-name "John"
tomba lead delete --id <lead_id>
```

## Examples

### List Leads

```bash
tomba lead list
tomba lead list --page 2 --limit 20
tomba lead list --domain "stripe.com"
tomba lead list --json
```

### Get Lead

```bash
tomba lead get --id 123
```

### Create Lead

```bash
tomba lead create --email "user@example.com" --list-id 1
tomba lead create --email "user@example.com" --list-id 1 --first-name "John" --last-name "Doe"
```

### Update Lead

```bash
tomba lead update --id 123 --first-name "Jane" --position "CTO"
```

### Delete Lead

```bash
tomba lead delete --id 123
```

## HTTP call

```bash
# List leads
curl --request GET \
  --url 'http://127.0.0.1:3001/leads'

# Create lead
curl --request POST \
  --url 'http://127.0.0.1:3001/leads' \
  --header 'Content-Type: application/json' \
  --data '{"email": "user@example.com", "list_id": 1}'

# Update lead
curl --request PUT \
  --url 'http://127.0.0.1:3001/leads/123' \
  --header 'Content-Type: application/json' \
  --data '{"first_name": "Jane"}'

# Delete lead
curl --request DELETE \
  --url 'http://127.0.0.1:3001/leads/123'
```
