Skip to main content

Create Task

Create a new task against a lead. The lead is identified by the :lead_id segment in the URL — use the lead's internal id (returned by Get Lead).

When you create a non-reminder task (FOLLOW_UP_CALL, FIRST_CALL, CALLBACK_REQUEST, SITE_VISIT, BOOKING), any other open non-reminder tasks on the same lead are automatically marked complete — only one non-reminder task is "open" at a time. Reminders are independent and don't get closed by creating other tasks.

Authentication Required

Requires the x-api-key header. See Overview for details.

HTTP Request

POST /enterprise/api/lead/:lead_id/task

Path Parameters

ParameterTypeRequiredDescription
lead_idnumberYesInternal lead ID. Get this from Get Lead.

Request Body

FieldTypeRequiredDescription
typestringYesTask type. One of FOLLOW_UP_CALL, FIRST_CALL, CALLBACK_REQUEST, SITE_VISIT, REMINDER, BOOKING.
due_datestringYesWhen the task is due. ISO 8601 timestamp (e.g. 2026-05-20T15:00:00Z).
notify_atstringNoWhen the assignee should be notified. ISO 8601 timestamp. Must satisfy now < notify_at <= due_date — in the future and at or before the due time. Defaults are derived from due_date and type: REMINDER notifies at due_date, FIRST_CALL notifies immediately, other types notify 10 minutes before due_date.
customer_notestringNoA note to attach to this task. Visible on the lead timeline.

The task is created against the lead and inherits the lead's current assignee — there's no separate assignee field on this API.

Try it

Loading playground…

Code Examples

curl -X POST https://prod-api.superfone.co.in/superfone/enterprise/api/lead/12345/task \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"type": "FOLLOW_UP_CALL",
"due_date": "2026-05-20T15:00:00Z",
"customer_note": "Customer asked about volume discount."
}'

Success Response

Status Code: 200 OK

{
"data": {
"id": 4567,
"org_id": 42,
"customer_id": 12345,
"title": null,
"type": "FOLLOW_UP_CALL",
"type_name": null,
"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"
},
"message": "success"
}

Response Fields

FieldTypeDescription
data.idnumberInternal task ID. Useful for correlating with the dashboard.
data.customer_idnumberThe lead this task belongs to.
data.typestringTask type.
data.task_statusstringPENDING for newly-created tasks.
data.due_datestringISO 8601.
data.notify_atstringISO 8601. When the notification was scheduled to fire.
data.assignee_user_idnumber | nullAssigned team member.
data.created_atstringISO 8601.

Error Responses

StatusMessageWhen it occurs
400lead_id must be a numberURL contains a non-numeric :lead_id
400Request body is emptyThe request body is missing or empty
400type is requiredtype missing from body
400type "<value>" is not available for creation. Allowed: ...type is not in the allowed task-type list. The error response lists every currently-allowed value.
400due_date is requireddue_date missing from body
401UnAuthorized, Please Provide Valid API KeyMissing or invalid x-api-key
404Lead not foundlead_id doesn't exist, or belongs to a different account
404Lead storage is fullYour account has reached its lead storage limit
  • Complete Task — Mark the lead's currently-open task complete
  • List Tasks — Paginated task history for a lead
  • Get Lead — Look up a lead's id by phone