Docs/Contacts API/Create Contact
POST/contacts

Create Contact

Create a new contact in your Dalil AI workspace. Optionally trigger AI enrichment to automatically fill in missing fields.

Last updated April 20, 20263 min read
POSThttps://api.usedalil.ai/v1/contacts
curl -X POST "https://api.usedalil.ai/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key": "value"}'

Creates a new contact. At minimum, provide either email or linkedin_url. Dalil AI can enrich the contact automatically if you pass enrich: true.

Request Body

FieldTypeRequiredDescription
emailstringConditional*Contact's email address
linkedin_urlstringConditional*LinkedIn profile URL
first_namestringNoFirst name
last_namestringNoLast name
titlestringNoJob title
companystringNoCompany name
phonestringNoPhone number
tagsstring[]NoArray of tag names to apply
owner_idstringNoAssign to a specific user (defaults to API key owner)
enrichbooleanNoTrigger AI enrichment (default: false)
custom_fieldsobjectNoAny key-value pairs for custom fields

*At least one of email or linkedin_url is required.

Request

curl -X POST https://api.usedalil.ai/v1/contacts \
  -H "Authorization: Bearer dalil_sk_live_xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "sarah@acmecorp.com",
    "first_name": "Sarah",
    "last_name": "Chen",
    "title": "VP of Sales",
    "company": "Acme Corp",
    "tags": ["outbound-q2", "series-b"],
    "enrich": true
  }'

Response

{
  "data": {
    "id": "cnt_01HXY8Z9A0B1C2D3E4F5G6H7J",
    "email": "sarah@acmecorp.com",
    "first_name": "Sarah",
    "last_name": "Chen",
    "title": "VP of Sales",
    "company": "Acme Corp",
    "linkedin_url": "https://linkedin.com/in/sarahchen",
    "phone": "+1 555 000 1234",
    "score": null,
    "tags": ["outbound-q2", "series-b"],
    "enrichment_status": "pending",
    "created_at": "2026-04-20T12:00:00Z",
    "updated_at": "2026-04-20T12:00:00Z"
  }
}
ℹ️

When enrich: true, the contact is created immediately and enrichment happens asynchronously. The enrichment_status field will change from pending to complete (or failed) within 30 seconds. Use webhooks to be notified when enrichment completes.

Handling Duplicates

By default, if a contact with the same email already exists, the API returns a 409 Conflict error. To merge instead:

{
  "email": "sarah@acmecorp.com",
  "on_conflict": "merge"
}

With "on_conflict": "merge", existing fields are preserved and only new fields are updated.

Code Examples

JavaScript

import Dalil from '@dalilai/sdk';

const client = new Dalil({ apiKey: process.env.DALIL_API_KEY });

const contact = await client.contacts.create({
  email: 'sarah@acmecorp.com',
  firstName: 'Sarah',
  lastName: 'Chen',
  title: 'VP of Sales',
  company: 'Acme Corp',
  tags: ['outbound-q2'],
  enrich: true,
});

console.log('Created:', contact.id);

Python

import dalilai

client = dalilai.Client(api_key=os.environ["DALIL_API_KEY"])

contact = client.contacts.create(
    email="sarah@acmecorp.com",
    first_name="Sarah",
    last_name="Chen",
    title="VP of Sales",
    company="Acme Corp",
    tags=["outbound-q2"],
    enrich=True,
)

print(f"Created: {contact.id}")

Error Responses

CodeMessageDescription
400 Bad Requestemail_or_linkedin_requiredNeither email nor LinkedIn URL provided
409 Conflictcontact_already_existsContact with this email exists; use on_conflict
422 Unprocessable Entityinvalid_emailEmail format is invalid