Skip to main content
This guide walks you through setting up API access and making your first requests.

1. Get your API key

1

Open settings

Go to Settings > API in your Leonar dashboard.
2

Create a key

Click Create API key, give it a name, and select the scopes you need. For this quickstart, select the read_only bundle.
3

Copy the key

Copy the key starting with leo_. You won’t be able to see it again.

2. Make your first request

curl -X GET "https://app.leonar.app/api/v1/contacts?limit=5" \
  -H "Authorization: Bearer leo_your_api_key"

3. Create a contact

curl -X POST "https://app.leonar.app/api/v1/contacts" \
  -H "Authorization: Bearer leo_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Sophie",
    "last_name": "Martin",
    "title": "Senior Developer",
    "current_company": "Doctolib",
    "emails": [{"email": "sophie@example.com", "type": "work"}]
  }'

4. Search contacts

Use the search endpoint for full-text search across contacts:
curl -X POST "https://app.leonar.app/api/v1/contacts/search" \
  -H "Authorization: Bearer leo_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "developer python",
    "location": "Paris",
    "limit": 20
  }'

5. Read custom field definitions

Before writing custom_data, fetch the workspace definitions to discover valid keys:
curl -X GET "https://app.leonar.app/api/v1/contacts/custom-fields" \
  -H "Authorization: Bearer leo_your_api_key"

6. Update custom fields safely

custom_data updates are merged into the existing object:
curl -X PUT "https://app.leonar.app/api/v1/contacts/contact-uuid" \
  -H "Authorization: Bearer leo_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "custom_data": {
      "industry_code": "A12",
      "vip": true
    }
  }'
Send null to remove a non-required custom field key.

Next steps