Create Lead
Create a new lead in your workspace
POST https://api.orwel.io/api/v1/leads
Request Body
visitor_idstringbodyAssociated visitor ID (UUID)
codestringbodyLead code or identifier
sourcestringbodySource of the lead (e.g., "website", "referral", "campaign")
propertiesobjectbodyCustom properties as key-value pairs
locationobjectbodyLocation data (city, country, etc.)
identity_idstringbodyAssociated identity ID (UUID)
session_idstringbodyAssociated session ID (UUID)
company_idstringbodyAssociated company ID (UUID)
Request
curl -X POST "https://api.orwel.io/api/v1/leads" \
-H "Authorization: Bearer orwel_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"visitor_id": "660e8400-e29b-41d4-a716-446655440001",
"code": "lead_002",
"source": "website",
"properties": {
"industry": "fintech",
"company_size": "100-500"
},
"location": {
"city": "New York",
"country": "USA"
}
}'const response = await fetch('https://api.orwel.io/api/v1/leads', {
method: 'POST',
headers: {
'Authorization': 'Bearer orwel_sk_YOUR_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
visitor_id: '660e8400-e29b-41d4-a716-446655440001',
code: 'lead_002',
source: 'website',
properties: {
industry: 'fintech',
company_size: '100-500'
},
location: {
city: 'New York',
country: 'USA'
}
})
});
const data = await response.json();import requests
import json
headers = {
'Authorization': 'Bearer orwel_sk_YOUR_KEY',
'Content-Type': 'application/json'
}
payload = {
'visitor_id': '660e8400-e29b-41d4-a716-446655440001',
'code': 'lead_002',
'source': 'website',
'properties': {
'industry': 'fintech',
'company_size': '100-500'
},
'location': {
'city': 'New York',
'country': 'USA'
}
}
response = requests.post(
'https://api.orwel.io/api/v1/leads',
headers=headers,
data=json.dumps(payload)
)
data = response.json()Response
{
"data": {
"id": "bb0e8400-e29b-41d4-a716-446655440006",
"visitor_id": "660e8400-e29b-41d4-a716-446655440001",
"workspace_id": "770e8400-e29b-41d4-a716-446655440002",
"code": "lead_002",
"source": "website",
"created_at": "2025-01-15T14:30:00Z",
"updated_at": "2025-01-15T14:30:00Z",
"properties": {
"industry": "fintech",
"company_size": "100-500"
},
"location": {
"city": "New York",
"country": "USA"
},
"identity_id": null,
"session_id": null,
"summary": null,
"company_id": null
}
}