List Lexi Tasks
curl --request GET \
--url https://api.example.com/v1/lexi/tasksimport requests
url = "https://api.example.com/v1/lexi/tasks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/lexi/tasks', 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/lexi/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/lexi/tasks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/lexi/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/lexi/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"tasks": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"description": "<string>",
"created_at": "<string>",
"metadata": {}
}
]
}
}Lexi AI
List Lexi Tasks
Retrieve pending approval tasks from Lexi AI
GET
/
v1
/
lexi
/
tasks
List Lexi Tasks
curl --request GET \
--url https://api.example.com/v1/lexi/tasksimport requests
url = "https://api.example.com/v1/lexi/tasks"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/v1/lexi/tasks', 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/lexi/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/lexi/tasks"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/v1/lexi/tasks")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/lexi/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"tasks": [
{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"description": "<string>",
"created_at": "<string>",
"metadata": {}
}
]
}
}Request
Headers
Authorization: Bearer wbk_your_api_key_here
Query Parameters
string
default:"pending"
Filter by task status:
pending, approved, dismissed, completed, failedResponse
object
Show properties
Show properties
array
Array of task objects
Show Task object
Show Task object
curl https://data.leadlex.com/functions/v1/api-gateway/v1/lexi/tasks \
-H "Authorization: Bearer wbk_your_api_key_here"
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
headers = {"Authorization": f"Bearer {API_KEY}"}
response = requests.get(f"{BASE_URL}/v1/lexi/tasks", headers=headers)
tasks = response.json()["data"]["tasks"]
for task in tasks:
print(f"{task['type']}: {task['description']}")
const response = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/lexi/tasks',
{
headers: { 'Authorization': 'Bearer wbk_your_api_key_here' }
}
);
const { data } = await response.json();
data.tasks.forEach(task => {
console.log(`${task.type}: ${task.description}`);
});
Example Response
{
"data": {
"tasks": [
{
"id": "task-uuid-1",
"type": "prospect_search",
"status": "pending",
"description": "Search for 20 CEOs at law firms in New York",
"created_at": "2026-02-24T16:00:00Z",
"metadata": {
"query": {
"person_titles": ["CEO"],
"organization_industries": ["Legal"],
"person_locations": ["New York"]
},
"per_page": 20
}
},
{
"id": "task-uuid-2",
"type": "campaign_start",
"status": "pending",
"description": "Start campaign 'Q2 Outreach' for 150 contacts",
"created_at": "2026-02-24T15:30:00Z",
"metadata": {
"campaign_id": "campaign-uuid",
"contact_count": 150
}
}
]
}
}
Filter by Status
Get Only Pending Tasks
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/lexi/tasks?status=pending" \
-H "Authorization: Bearer wbk_your_api_key_here"
Get Approved Tasks
curl "https://data.leadlex.com/functions/v1/api-gateway/v1/lexi/tasks?status=approved" \
-H "Authorization: Bearer wbk_your_api_key_here"
Task Types
| Type | Description |
|---|---|
prospect_search | Search for prospects and save to CRM |
campaign_start | Launch an outreach campaign |
contact_update | Bulk update contacts |
list_operation | Create/modify lists |
Task Statuses
| Status | Description |
|---|---|
pending | Awaiting your approval |
approved | Approved, executing now |
completed | Successfully executed |
dismissed | You dismissed the task |
failed | Execution failed |
Polling for Tasks
Poll this endpoint periodically to check for new tasks requiring approval. Alternatively, use webhooks when available.
import time
while True:
response = requests.get(f"{BASE_URL}/v1/lexi/tasks", headers=headers)
tasks = response.json()["data"]["tasks"]
if tasks:
print(f"Found {len(tasks)} pending tasks")
for task in tasks:
print(f" - {task['description']}")
# Auto-approve or notify user
time.sleep(60) # Check every minute
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid API key |
| 403 | insufficient_permissions | Missing lexi permission |
| 429 | rate_limited | Rate limit exceeded |