Create Task
POST
/
contacts
/
{contactId}
/
tasks
Create Task
curl --request POST \
--url https://services.leadconnectorhq.com/contacts/{contactId}/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"title": "First Task",
"dueDate": "2020-10-25T11:00:00Z",
"completed": true,
"body": "loram ipsum",
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}
'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'First Task',
dueDate: '2020-10-25T11:00:00Z',
completed: true,
body: JSON.stringify('loram ipsum'),
assignedTo: 'hxHGVRb1YJUscrCB8eXK'
})
};
fetch('https://services.leadconnectorhq.com/contacts/{contactId}/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/contacts/{contactId}/tasks"
payload = {
"title": "First Task",
"dueDate": "2020-10-25T11:00:00Z",
"completed": True,
"body": "loram ipsum",
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"task": {
"id": "lJpzYrWdpkC2hX6t2yue",
"title": "test",
"body": "testing",
"assignedTo": "tesTUcmRxWrjqzJS8EjkxNKting",
"dueDate": "2021-07-08T02:30:00.000Z",
"completed": true,
"contactId": "lJpzYrWdpkC2hX6t2yue"
}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}Authorizations
Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.
Headers
API Version
Available options:
2021-07-28 Path Parameters
Contact Id
Example:
"sx6wyHhbFdRXh302LLNR"
Body
application/json
Response
Successful response
Show child attributes
Show child attributes
Last modified on March 8, 2026
Was this page helpful?
Create Task
curl --request POST \
--url https://services.leadconnectorhq.com/contacts/{contactId}/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Version: <version>' \
--data '
{
"title": "First Task",
"dueDate": "2020-10-25T11:00:00Z",
"completed": true,
"body": "loram ipsum",
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}
'const options = {
method: 'POST',
headers: {
Version: '<version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
title: 'First Task',
dueDate: '2020-10-25T11:00:00Z',
completed: true,
body: JSON.stringify('loram ipsum'),
assignedTo: 'hxHGVRb1YJUscrCB8eXK'
})
};
fetch('https://services.leadconnectorhq.com/contacts/{contactId}/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/contacts/{contactId}/tasks"
payload = {
"title": "First Task",
"dueDate": "2020-10-25T11:00:00Z",
"completed": True,
"body": "loram ipsum",
"assignedTo": "hxHGVRb1YJUscrCB8eXK"
}
headers = {
"Version": "<version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"task": {
"id": "lJpzYrWdpkC2hX6t2yue",
"title": "test",
"body": "testing",
"assignedTo": "tesTUcmRxWrjqzJS8EjkxNKting",
"dueDate": "2021-07-08T02:30:00.000Z",
"completed": true,
"contactId": "lJpzYrWdpkC2hX6t2yue"
}
}{
"statusCode": 400,
"message": "Bad Request"
}{
"statusCode": 401,
"message": "Invalid token: access token is invalid",
"error": "Unauthorized"
}{
"statusCode": 422,
"message": [
"Unprocessable Entity"
],
"error": "Unprocessable Entity"
}