List Tasks
Paginated task history for a single lead — both open (PENDING) and completed (COMPLETE) tasks, sorted by creation date (newest first).
Authentication Required
Requires the x-api-key header. See Overview for details.
HTTP Request
GET /enterprise/api/lead/:lead_id/task
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
lead_id | number | Yes | Internal lead ID. Get this from Get Lead. |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | number | No | 1 | Page number — starts at 1, not 0 |
page_size | number | No | 20 | Items per page. Maximum is 20 — larger values return 400. |
Try it
Loading playground…
Code Examples
- cURL
- JavaScript
- Python
curl -X GET "https://prod-api.superfone.co.in/superfone/enterprise/api/lead/12345/task?page=1&page_size=20" \
-H "x-api-key: your_api_key_here"
const leadId = 12345;
const url = new URL(
`https://prod-api.superfone.co.in/superfone/enterprise/api/lead/${leadId}/task`
);
url.searchParams.set('page', '1');
url.searchParams.set('page_size', '20');
const response = await fetch(url, {
method: 'GET',
headers: { 'x-api-key': process.env.SF_API_KEY }
});
const result = await response.json();
console.log(result.data);
import os
import requests
lead_id = 12345
response = requests.get(
f'https://prod-api.superfone.co.in/superfone/enterprise/api/lead/{lead_id}/task',
headers={'x-api-key': os.environ['SF_API_KEY']},
params={'page': 1, 'page_size': 20}
)
print(response.json()['data'])
Success Response
Status Code: 200 OK
{
"data": {
"rows": [
{
"id": 4567,
"org_id": 42,
"customer_id": 12345,
"title": "Follow up on pricing",
"type": "FOLLOW_UP_CALL",
"due_date": "2026-05-20T15:00:00.000Z",
"notify_at": "2026-05-20T14:50:00.000Z",
"notify": true,
"task_status": "PENDING",
"status": "ACTIVE",
"assignee_user_id": 678,
"created_by": 1,
"updated_by": null,
"created_at": "2026-05-19T08:30:00.000Z",
"updated_at": "2026-05-19T08:30:00.000Z"
},
{
"id": 4521,
"org_id": 42,
"customer_id": 12345,
"title": "Initial intro call",
"type": "FIRST_CALL",
"due_date": "2026-05-15T10:00:00.000Z",
"notify_at": "2026-05-15T10:00:00.000Z",
"notify": true,
"task_status": "COMPLETE",
"status": "COMPLETE",
"assignee_user_id": 678,
"created_by": 678,
"updated_by": 678,
"created_at": "2026-05-14T09:00:00.000Z",
"updated_at": "2026-05-15T10:30:00.000Z"
}
],
"total_pages": 1,
"current_page": 1,
"page_size": 20,
"total_items": 2
},
"message": "success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
data.rows[].id | number | Internal task ID |
data.rows[].customer_id | number | The lead this task belongs to |
data.rows[].title | string | null | Task title |
data.rows[].type | string | Task type (FOLLOW_UP_CALL, FIRST_CALL, REMINDER, etc.) |
data.rows[].due_date | string | ISO 8601 |
data.rows[].notify_at | string | ISO 8601 |
data.rows[].notify | boolean | Whether assignee notifications are enabled |
data.rows[].task_status | string | PENDING or COMPLETE |
data.rows[].assignee_user_id | number | null | Assigned team member |
data.rows[].created_at | string | ISO 8601 |
data.rows[].updated_at | string | ISO 8601 |
data.total_pages | number | Total pages available |
data.current_page | number | Page number returned |
data.page_size | number | Items per page |
data.total_items | number | Total matching tasks across all pages |
Error Responses
| Status | Message | When it occurs |
|---|---|---|
400 | lead_id must be a number | URL contains a non-numeric :lead_id |
400 | page_size must be a positive integer | page_size query param is missing a valid number (e.g. page_size=abc or page_size=0) |
400 | page_size cannot exceed 20 | page_size query param is greater than 20. Use 20 or smaller. |
401 | UnAuthorized, Please Provide Valid API Key | Missing or invalid x-api-key |
404 | Lead not found | lead_id doesn't exist, or belongs to a different account |
Related Endpoints
- Create Task — Add a new task
- Complete Task — Mark the lead's currently-open task complete