Skip to main content

Complete Task

Mark the lead's currently-open (PENDING) task as complete. You don't need to know the internal task ID — Superfone finds the lead's open task and closes it.

If the lead has no open task, the request returns 400 No open task found for this lead.

Authentication Required

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

HTTP Request

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

Path Parameters

ParameterTypeRequiredDescription
lead_idnumberYesInternal lead ID. Get this from Get Lead.

Request Body

No request body is required. The endpoint takes no parameters beyond :lead_id.

Try it

Loading playground…

Code Examples

curl -X POST https://prod-api.superfone.co.in/superfone/enterprise/api/lead/12345/task/complete \
-H "x-api-key: your_api_key_here"

Success Response

Status Code: 200 OK

Returns the closed task with task_status: "COMPLETE".

{
"data": {
"id": 4567,
"org_id": 42,
"customer_id": 12345,
"title": null,
"type": "FOLLOW_UP_CALL",
"due_date": "2026-05-20T15:00:00.000Z",
"notify_at": "2026-05-20T14:50:00.000Z",
"notify": true,
"task_status": "COMPLETE",
"status": "COMPLETE",
"assignee_user_id": 678,
"created_by": 1,
"updated_by": 1,
"created_at": "2026-05-19T08:30:00.000Z",
"updated_at": "2026-05-19T11:45:00.000Z"
},
"message": "success"
}

Error Responses

StatusMessageWhen it occurs
400lead_id must be a numberURL contains a non-numeric :lead_id
400No open task found for this leadThe lead has no PENDING task. Calling this on a lead whose task is already complete (or never had one) returns this error.
401UnAuthorized, Please Provide Valid API KeyMissing or invalid x-api-key
404Lead not foundlead_id doesn't exist, or belongs to a different account

Which task gets closed?

If the lead has more than one open task (for example, a REMINDER alongside a FOLLOW_UP_CALL), the most recently created open task is closed. In practice you typically have at most one open non-reminder task at a time — Superfone closes prior non-reminder tasks when Create Task is called with another non-reminder type.