The Tasks API provides a simple interface to manage tasks. The API allows you to create, delete and update your tasks. You can retrieve a single task, as well as list of all tasks.

A task can be either floating or related. Floating tasks are only associated with a user, whereas related tasks are associated with one of listed resources:

Parameters

NameRead OnlyTypeDescription
idtruenumberUnique identifier of the task.
creator_idtruenumberUnique identifier of the user who created the task.
owner_idfalsenumberUnique identifier of the user the task is assigned to.
resource_typefalsestringName of the resource type the task is attached to. Possible values: lead, contact, deal
resource_idfalsenumberUnique identifier of the resource the task is attached to.
completedfalsebooleanIndicator of whether the task is completed or not.
completed_attruestringDate and time of the task's completion in UTC (ISO8601 format).
due_datefalsestringDate and time of creation in UTC (ISO8601 format).
overduetruebooleanIndicator for whether the task has passed the due_date or not.
remind_atfalsestringDate and time that we should send you a reminder in UTC (ISO8601 format).
contentfalsestringContent of the task.
created_attruestringDate and time of task creation in UTC (ISO8601 format).
updated_attruestringDate and time of the last update to the task in UTC (ISO8601 format).

Retrieve all tasks

GET /v2/tasks

Returns all tasks available to the user, according to the parameters provided.

If you ask for tasks without any parameter provided Sell API will return you both floating and related tasks. Although you can narrow the search set to either of them via query parameters.

Parameters

NameRequiredTypeInDescription
pagefalsenumberQueryPage number to start from. Page numbering starts at 1 and omitting the page parameter will return the first page.
per_pagefalsenumberQueryNumber of records to return per page. The default limit is 25 and the maximum number that can be returned is 100.
sort_byfalsestringQueryA field to sort by. The default ordering is ascending. If you want to change the sort order to descending, append :desc to the field e.g. sort_by=resource_type:desc. Possible values: resource_type, completed_at, due_date, created_at, updated_at
idsfalsestringQueryComma-separated list of task IDs to be returned in a request.
creator_idfalsenumberQueryUnique identifier of the user. Returns all tasks created by the user.
owner_idfalsenumberQueryUnique identifier of the user. Returns all tasks owned by the user.
qfalsestringQueryA query string to search for. Performs a full text search on the content field.
typefalsestringQueryType of tasks to search for. Possible values: floating, related
resource_typefalsestringQueryName of the resource type to search for. Possible values: lead, contact, deal
resource_idfalsenumberQueryUnique identifier of the resource that you're searching for.
completedfalsebooleanQueryIndicates whether the query will return tasks that are completed or not.
overduefalsebooleanQueryIndicates whether the query will return tasks where the due_date parameter has been passed or not.
remindfalsebooleanQueryIndicates whether the query will return tasks with reminders or without reminders.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/tasks?type=related&resource_type=leads&completed=true \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "items": [    {      "data": {        "id": 1,        "creator_id": 1,        "owner_id": 1,        "resource_type": "lead",        "resource_id": 1,        "completed": true,        "completed_at": "2014-09-29T16:32:56Z",        "due_date": "2014-09-28T16:32:56Z",        "overdue": false,        "remind_at": "2014-09-29T15:32:56Z",        "content": "Contact Tom",        "created_at": "2014-08-27T16:32:56Z",        "updated_at": "2014-08-27T17:32:56Z"      },      "meta": {        "type": "task"      }    }  ],  "meta": {    "type": "collection",    "count": 1,    "links": {      "self": "http://api.getbase.com/v2/tasks.json"    }  }}

Create a task

POST /v2/tasks

Creates a new task. You can create either a floating task or create a related task and associate it with one of the resource types below:

The remind_at date must be set earlier than the due_date attribute. Note that while you can specify different timezones in datetime fields during task creation, this functionality is not supported in the Search API. The Search API does not permit the use of different timezones in tasks.

Parameters

NameRequiredTypeInDescription
contenttruestringBodye.g. Contact Tom
due_datefalsestringBodye.g. 2014-09-27T16:32:56Z
owner_idfalsenumberBodyDefaults to the unique identifier of the user who created the task.
resource_typefalsestringBodye.g. lead
resource_idfalsenumberBodye.g. 1
completedfalsebooleanBodye.g. true
remind_atfalsestringBodye.g. 2014-09-26T15:32:56Z

Allowed for

  • Agents

Using cURL

curl -v -X POST https://api.getbase.com/v2/tasks \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "resource_type": "lead",    "resource_id": 1,    "due_date": "2014-09-27T16:32:56Z",    "remind_at": "2014-09-26T15:32:56Z",    "content": "Contact Tom"  },  "meta": {    "type": "task"  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "resource_type": "lead",    "resource_id": 1,    "completed": true,    "completed_at": "2014-09-29T16:32:56Z",    "due_date": "2014-09-28T16:32:56Z",    "overdue": false,    "remind_at": "2014-09-29T15:32:56Z",    "content": "Contact Tom",    "created_at": "2014-08-27T16:32:56Z",    "updated_at": "2014-08-27T17:32:56Z"  },  "meta": {    "type": "task"  }}

Retrieve a single task

GET /v2/tasks/:id

Returns a single task available to the user according to the unique task ID provided. If the specified task does not exist, this query will return an error.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the task.

Allowed for

  • Agents

Using cURL

curl -v -X GET https://api.getbase.com/v2/tasks/1 \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "resource_type": "lead",    "resource_id": 1,    "completed": true,    "completed_at": "2014-09-29T16:32:56Z",    "due_date": "2014-09-28T16:32:56Z",    "overdue": false,    "remind_at": "2014-09-29T15:32:56Z",    "content": "Contact Tom",    "created_at": "2014-08-27T16:32:56Z",    "updated_at": "2014-08-27T17:32:56Z"  },  "meta": {    "type": "task"  }}

Update a task

PUT /v2/tasks/:id

Updates task information. If the specified task does not exist, this query will return an error.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the task.
contentfalsestringBodye.g. Contact Tom
due_datefalsestringBodye.g. 2014-09-27T16:32:56Z
owner_idfalsenumberBodye.g. 1
resource_typefalsestringBodye.g. lead
resource_idfalsenumberBodye.g. 1
completedfalsebooleanBodytrue
remind_atfalsestringBodye.g. 2014-09-29T15:32:56Z

Allowed for

  • Agents

Using cURL

curl -v -X PUT https://api.getbase.com/v2/tasks/1 \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{  "data": {    "completed": false,    "content": "Contact Tom and Rachel"  }}'

Example response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8Content-Language: en
{  "data": {    "id": 1,    "creator_id": 1,    "owner_id": 1,    "resource_type": "lead",    "resource_id": 1,    "completed": false,    "completed_at": null,    "due_date": "2014-09-28T16:32:56Z",    "overdue": false,    "remind_at": "2014-09-29T15:32:56Z",    "content": "Contact Tom and Rachel",    "created_at": "2014-08-27T16:32:56Z",    "updated_at": "2014-08-27T17:32:56Z"  },  "meta": {    "type": "task"  }}

Delete a task

DELETE /v2/tasks/:id

Delete an existing task. If the specified task does not exist, this query will return an error. This operation cannot be undone.

Parameters

NameRequiredTypeInDescription
idtruenumberQueryUnique identifier of the task.

Allowed for

  • Agents

Using cURL

curl -v -X DELETE https://api.getbase.com/v2/tasks/1 \-H "Authorization: Bearer $ACCESS_TOKEN"

Example response

HTTP/1.1 204 No Content