Create Activity
curl --request POST \
--url https://api.example.com/v1/activities \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"title": "<string>",
"description": "<string>",
"contact_id": "<string>",
"deal_id": "<string>",
"entity_type": "<string>",
"entity_id": "<string>",
"entity_name": "<string>",
"metadata": {}
}
'import requests
url = "https://api.example.com/v1/activities"
payload = {
"type": "<string>",
"title": "<string>",
"description": "<string>",
"contact_id": "<string>",
"deal_id": "<string>",
"entity_type": "<string>",
"entity_id": "<string>",
"entity_name": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
title: '<string>',
description: '<string>',
contact_id: '<string>',
deal_id: '<string>',
entity_type: '<string>',
entity_id: '<string>',
entity_name: '<string>',
metadata: {}
})
};
fetch('https://api.example.com/v1/activities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'title' => '<string>',
'description' => '<string>',
'contact_id' => '<string>',
'deal_id' => '<string>',
'entity_type' => '<string>',
'entity_id' => '<string>',
'entity_name' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/activities"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_name\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/activities")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_name\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_name\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"activity": {
"id": "<string>",
"type": "<string>",
"title": "<string>",
"description": "<string>",
"contact_id": "<string>",
"deal_id": "<string>",
"entity_type": "<string>",
"entity_id": "<string>",
"entity_name": "<string>",
"metadata": {},
"created_by_user_id": "<string>",
"created_date": "<string>"
}
}
}Activities
Create Activity
Log a new activity (call, email, meeting, note, AI action) against a contact or deal
POST
/
v1
/
activities
Create Activity
curl --request POST \
--url https://api.example.com/v1/activities \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"title": "<string>",
"description": "<string>",
"contact_id": "<string>",
"deal_id": "<string>",
"entity_type": "<string>",
"entity_id": "<string>",
"entity_name": "<string>",
"metadata": {}
}
'import requests
url = "https://api.example.com/v1/activities"
payload = {
"type": "<string>",
"title": "<string>",
"description": "<string>",
"contact_id": "<string>",
"deal_id": "<string>",
"entity_type": "<string>",
"entity_id": "<string>",
"entity_name": "<string>",
"metadata": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
type: '<string>',
title: '<string>',
description: '<string>',
contact_id: '<string>',
deal_id: '<string>',
entity_type: '<string>',
entity_id: '<string>',
entity_name: '<string>',
metadata: {}
})
};
fetch('https://api.example.com/v1/activities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'type' => '<string>',
'title' => '<string>',
'description' => '<string>',
'contact_id' => '<string>',
'deal_id' => '<string>',
'entity_type' => '<string>',
'entity_id' => '<string>',
'entity_name' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/activities"
payload := strings.NewReader("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_name\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/activities")
.header("Content-Type", "application/json")
.body("{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_name\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"type\": \"<string>\",\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"contact_id\": \"<string>\",\n \"deal_id\": \"<string>\",\n \"entity_type\": \"<string>\",\n \"entity_id\": \"<string>\",\n \"entity_name\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"activity": {
"id": "<string>",
"type": "<string>",
"title": "<string>",
"description": "<string>",
"contact_id": "<string>",
"deal_id": "<string>",
"entity_type": "<string>",
"entity_id": "<string>",
"entity_name": "<string>",
"metadata": {},
"created_by_user_id": "<string>",
"created_date": "<string>"
}
}
}Use this endpoint to record any user or agent action — a call, a sent email, a meeting, a handwritten note — so it appears on the contact and deal timeline.
Request
Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
Requires an API key with the
activities:write permission. Fires the activity.created webhook event.Body Parameters
string
required
Activity type (e.g.,
call, email, email_sent, email_replied, meeting, note, task_completed, ai_action). Free-form — custom types are allowed.string
Short human-readable title (max 500 chars)
string
Full description or body (markdown supported)
string
UUID of the related contact
string
UUID of the related deal
string
Polymorphic entity type (e.g.,
campaign, task, list) when the activity relates to something other than a contact or dealstring
UUID of the polymorphic entity
string
Human-readable name of the entity (for timeline display)
object
Arbitrary structured JSON for type-specific data (call duration, email subject, attendees, etc.). Max 8 KB serialized.
Response
object
Show properties
Show properties
object
Show Activity object
Show Activity object
string
Newly created activity UUID
string
Activity type
string
Title
string
Description
string
Contact UUID (nullable)
string
Deal UUID (nullable)
string
Polymorphic entity type
string
Polymorphic entity UUID
string
Entity display name
object
Structured data
string
UUID of the creating user
string
ISO 8601 timestamp
curl -X POST https://data.leadlex.com/functions/v1/api-gateway/v1/activities \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"type": "call",
"title": "Discovery call with Jane",
"description": "Discussed Q2 outsourcing plans; next step is proposal.",
"contact_id": "123e4567-e89b-12d3-a456-426614174000",
"deal_id": "3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a",
"metadata": {"duration_minutes": 32, "direction": "outbound"}
}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
response = requests.post(
f"{BASE_URL}/v1/activities",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={
"type": "call",
"title": "Discovery call with Jane",
"description": "Discussed Q2 outsourcing plans; next step is proposal.",
"contact_id": "123e4567-e89b-12d3-a456-426614174000",
"deal_id": "3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a",
"metadata": {"duration_minutes": 32, "direction": "outbound"},
},
)
await fetch('https://data.leadlex.com/functions/v1/api-gateway/v1/activities', {
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({
type: 'call',
title: 'Discovery call with Jane',
description: 'Discussed Q2 outsourcing plans; next step is proposal.',
contact_id: '123e4567-e89b-12d3-a456-426614174000',
deal_id: '3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a',
metadata: { duration_minutes: 32, direction: 'outbound' },
}),
});
Example Response
{
"data": {
"activity": {
"id": "act_7f3c4d2a-1b8e-4a9c-9d6f-2e5b8c7a1f3d",
"type": "call",
"title": "Discovery call with Jane",
"description": "Discussed Q2 outsourcing plans; next step is proposal.",
"contact_id": "123e4567-e89b-12d3-a456-426614174000",
"deal_id": "3f8e1d2c-4b5a-6d7e-8f9a-0b1c2d3e4f5a",
"entity_type": null,
"entity_id": null,
"entity_name": null,
"metadata": { "duration_minutes": 32, "direction": "outbound" },
"created_by_user_id": "9a8b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d",
"created_date": "2026-04-17T14:23:05Z"
}
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 400 | missing_required_field | type is missing |
| 400 | metadata_too_large | Serialized metadata exceeds 8 KB |
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing activities:write permission |
| 404 | contact_not_found | Referenced contact_id does not exist |
| 404 | deal_not_found | Referenced deal_id does not exist |
| 429 | rate_limited | Rate limit exceeded |