Add or Update Task

post
Add or Update Task which belongs contact, company, opportunity and lead

[PlatformAddress]/api/1.0/crm?action=addOrUpdateTask
Request
Response
Request
Path Parameters
id
optional
integer
The unique id of the task
venueId
optional
integer
The unique id of the venue to which the task belongs. Required when assigning the task to opportunity. The api will throw an error for invalid leadId
leadId
optional
integer
The unique id of the opportunity/lead to which the new task belongs
contactId
optional
integer
The unique id of the contact to which the new task belongs
companyId
optional
integer
The unique id of the company to which the new task belongs
name
optional
string
The name of the task. Required when id is missing.
endDatetime
optional
string
The due date and time of the task. Format is Y-m-d H:i:s and must be in UTC timezone. Required when id is missing.
priority
optional
string
The priority of the task low, medium or high.
assignedUserId
optional
integer
The unique id of the user to which the task will be assigned
status
optional
integer
The status of the task
description
optional
string
The description of the task
Response
200: OK
{
"success": true,
"id": 755
}

Task Status

Id

Name

0

Not Started

1

In Progress

2

On Hold

3

Cancelled

4

Completed

Example Request

Add Task

{
"name": "Test Task API",
"endDatetime": "2021-11-01 17:00:00",
"status": 1,
"assignedUserId": 1,
"leadId": 2665
}

Update Task

{
"id": 3269,
"venueId": 1,
"name": "Test Task API",
"endDatetime": "2021-11-01 17:00:00",
"status": 1,
"assignedUserId": 1,
"contactId": 45219,
"companyId": 854
}

Returns

Property

Description

success

Whether or not the task was added/updated

id

The unique id of the task

Throws

Code

Description

Specific Code: 24389

The lead/opportunity does not exist

Specific Code: 24390

The contact does not exist

Specific Code: 24391

The company does not exist

Specific Code: 24392

The task does not exist

Specific Code: 24393

An error has occurred

Specific Code: 24394

The request contains invalid data. The data was validated but there was some other error. See additional messages

Specific Code: 24395

The request contains invalid data

Specific Code: 24396

The task can only belongs to either contact, company or opportunity/lead

Task can only belongs to either company, contact or lead. When companyId and contactId both provided the contactId will be added to company as company contact and task will be be associated with company.