All URIs are relative to https://api.keap.com/crm, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createTask() | POST /rest/v2/tasks | Create a Task |
| createTaskCustomField() | POST /rest/v2/tasks/model/customFields | Create a Custom Field |
| deleteTask() | DELETE /rest/v2/tasks/{task_id} | Delete a Task |
| deleteTaskCustomField() | DELETE /rest/v2/tasks/model/customFields/{custom_field_id} | Delete a Custom Field |
| getTask() | GET /rest/v2/tasks/{task_id} | Retrieve a Task |
| listTasks() | GET /rest/v2/tasks | List Tasks |
| retrieveTaskModel() | GET /rest/v2/tasks/model | Retrieve Task Model |
| updateTask() | PATCH /rest/v2/tasks/{task_id} | Update a Task |
| updateTaskCustomField() | PATCH /rest/v2/tasks/model/customFields/{custom_field_id} | Update a Task's Custom Field |
createTask($create_task_request): \Keap\Core\V2\Model\TaskCreate a Task
Creates a new task as the authenticated user. This endpoint does not currently support setting Custom Field values.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_task_request = new \Keap\Core\V2\Model\CreateTaskRequest(); // \Keap\Core\V2\Model\CreateTaskRequest
try {
$result = $apiInstance->createTask($create_task_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->createTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_task_request | \Keap\Core\V2\Model\CreateTaskRequest |
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createTaskCustomField($create_custom_field_request): \Keap\Core\V2\Model\CreateCustomFieldResponseCreate a Custom Field
Creates a custom field of the specified type and options to the Task object
Note: Custom Fields for Tasks, Classic Appointments and Notes are combined.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$create_custom_field_request = new \Keap\Core\V2\Model\CreateCustomFieldRequest(); // \Keap\Core\V2\Model\CreateCustomFieldRequest
try {
$result = $apiInstance->createTaskCustomField($create_custom_field_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->createTaskCustomField: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| create_custom_field_request | \Keap\Core\V2\Model\CreateCustomFieldRequest |
\Keap\Core\V2\Model\CreateCustomFieldResponse
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTask($task_id)Delete a Task
Deletes a single task
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$task_id = 'task_id_example'; // string
try {
$apiInstance->deleteTask($task_id);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->deleteTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| task_id | string |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTaskCustomField($custom_field_id)Delete a Custom Field
Deletes a Custom Field from the Task object
Note: Custom Fields for Tasks, Classic Appointments and Notes are combined.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$custom_field_id = 'custom_field_id_example'; // string
try {
$apiInstance->deleteTaskCustomField($custom_field_id);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->deleteTaskCustomField: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| custom_field_id | string |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getTask($task_id): \Keap\Core\V2\Model\TaskRetrieve a Task
Retrieves a single task
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$task_id = 'task_id_example'; // string
try {
$result = $apiInstance->getTask($task_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->getTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| task_id | string |
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listTasks($filter, $order_by, $page_size, $page_token): \Keap\Core\V2\Model\ListTasksResponseList Tasks
Retrieves a list of tasks based on the provided filter. Tasks which are not assigned to a User may be queried with user_id==UNASSIGNED.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$filter = 'filter_example'; // string | Filter to apply, allowed fields are: - (String) `contact_id` - (String) `has_due_date` - (String) `is_completed` - (String) `user_id` - (String) `task_ids` - (String) `since_time` - (String) `until_time` You will need to apply the `==` operator to check the equality of one of the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=contact_id%3D%3D123` - `filter=has_due_date%3D%3Dtrue` - `filter=is_completed%3D%3Dtrue` - `filter=user_id%3D%3D321` - `filter=task_ids%3D%3D1,2,3` - `filter=since_time%3D%3D2025-04-16T20:33:02.321Z;` - `filter=until_time%3D%3D2025-08-16T20:33:02.321Z;`
$order_by = 'order_by_example'; // string | Attribute and direction to order items. One of the following fields: - `id` - `create_time` - `due_time` One of the following directions: - `asc` - `desc`
$page_size = 0; // int | Total number of items to return per page
$page_token = 'page_token_example'; // string | Page token
try {
$result = $apiInstance->listTasks($filter, $order_by, $page_size, $page_token);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->listTasks: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| filter | string | Filter to apply, allowed fields are: - (String) `contact_id` - (String) `has_due_date` - (String) `is_completed` - (String) `user_id` - (String) `task_ids` - (String) `since_time` - (String) `until_time` You will need to apply the `==` operator to check the equality of one of the filters with your searched word, in the encoded form `%3D%3D`. For the filters listed above, here are some examples: - `filter=contact_id%3D%3D123` - `filter=has_due_date%3D%3Dtrue` - `filter=is_completed%3D%3Dtrue` - `filter=user_id%3D%3D321` - `filter=task_ids%3D%3D1,2,3` - `filter=since_time%3D%3D2025-04-16T20:33:02.321Z;` - `filter=until_time%3D%3D2025-08-16T20:33:02.321Z;` | [optional] |
| order_by | string | Attribute and direction to order items. One of the following fields: - `id` - `create_time` - `due_time` One of the following directions: - `asc` - `desc` | [optional] |
| page_size | int | Total number of items to return per page | [optional] |
| page_token | string | Page token | [optional] |
\Keap\Core\V2\Model\ListTasksResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
retrieveTaskModel(): \Keap\Core\V2\Model\ObjectModelRetrieve Task Model
Get the custom fields for the Task object
Note: Custom Fields for Tasks, Classic Appointments and Notes are combined.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->retrieveTaskModel();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->retrieveTaskModel: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\Keap\Core\V2\Model\ObjectModel
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateTask($task_id, $create_update_task_request, $update_mask): \Keap\Core\V2\Model\UpdateTaskResponseUpdate a Task
Updates a task with only the values provided in the request. This endpoint does not currently support updating Custom Field values.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$task_id = 'task_id_example'; // string
$create_update_task_request = new \Keap\Core\V2\Model\CreateUpdateTaskRequest(); // \Keap\Core\V2\Model\CreateUpdateTaskRequest
$update_mask = NULL; // mixed | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped.
try {
$result = $apiInstance->updateTask($task_id, $create_update_task_request, $update_mask);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->updateTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| task_id | string | ||
| create_update_task_request | \Keap\Core\V2\Model\CreateUpdateTaskRequest | ||
| update_mask | mixed | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped. | [optional] |
\Keap\Core\V2\Model\UpdateTaskResponse
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateTaskCustomField($custom_field_id, $update_custom_field_meta_data_request, $update_mask): \Keap\Core\V2\Model\CustomFieldMetaDataUpdate a Task's Custom Field
Updates a custom field of the specified type and options to the Task object.
Note: Custom Fields for Tasks, Classic Appointments and Notes are combined.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: oauth2
$config = Keap\Core\V2\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Keap\Core\V2\Api\TaskApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$custom_field_id = 'custom_field_id_example'; // string
$update_custom_field_meta_data_request = new \Keap\Core\V2\Model\UpdateCustomFieldMetaDataRequest(); // \Keap\Core\V2\Model\UpdateCustomFieldMetaDataRequest
$update_mask = NULL; // mixed | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped.
try {
$result = $apiInstance->updateTaskCustomField($custom_field_id, $update_custom_field_meta_data_request, $update_mask);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TaskApi->updateTaskCustomField: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| custom_field_id | string | ||
| update_custom_field_meta_data_request | \Keap\Core\V2\Model\UpdateCustomFieldMetaDataRequest | ||
| update_mask | mixed | An optional list of properties to be updated. If set, only the provided properties will be updated and others will be skipped. | [optional] |
\Keap\Core\V2\Model\CustomFieldMetaData
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]