Task

For our users, tasks provide a simple way of creating a reminder of something they need to do. For a full description of the model see the Task model definition.

List tasks

The collection of Tasks on the Capsule account. By default the body will contain only the open tasks. If you want to retrieve pending and/or completed tasks use the status query parameter.

GET
https://api.capsulecrm.com/api/v2/tasks

Query Parameters

Name Type Description
page Integer

The page of results to return. Default: 1

perPage Integer

The number of entities to return per page. Value must be between 1 and 100. Default: 50

embed Array of String

Can be used to request additional data that aren’t included in the response by default. If provided, should be a comma separated list of strings. Supported values for this endpoint are party (the party this task is assigned to), opportunity (opportunity this task is on), kase (the project this task is on), owner (the owner of the task) and nextTask (the next task). Read more about embed.

status Array of String

Filter the response based on the status of the task. Must be a comma separated list of strings. Accepted values are open, completed and pending.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property tasks which is an array of Task objects. In the case of an invalid request, an error message will be returned, as described in the errors section.

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/tasks?page=4>; rel="next"
{
  "tasks" : [ {
    "id" : 493,
    "category" : {
      "id" : 47,
      "name" : "Billing",
      "colour" : "#d36c00"
    },
    "description" : "Send quarterly invoice",
    "status" : "OPEN",
    "party" : {
      "id" : 448322,
      "type" : "organisation",
      "name" : "ABC Furniture",
      "pictureURL" : "https://capsulecrm.com/theme/default/images/org_avatar_70.png"
    },
    "owner" : {
      "id" : 1,
      "username" : "owner",
      "name" : "Rupert Ada"
    },
    "createdAt" : "2015-10-26T14:37:52Z",
    "updatedAt" : "2015-10-26T14:37:52Z",
    "dueOn" : "2015-10-01",
    "hasTrack" : false,
    "repeat" : {
      "interval" : 3,
      "frequency" : "MONTHLY",
      "on" : "1"
    }
  } ]
}

Headers:

Name Type Description
Link String

Links to the next and previous pages, encoded as defined in RFC 5988.

Show task

Show a specific task.

GET
https://api.capsulecrm.com/api/v2/tasks/{taskId}

Query Parameters

Name Type Description
embed Array of String

Can be used to request additional data that aren’t included in the response by default. If provided, should be a comma separated list of strings. Supported values for this endpoint are party (the party this task is assigned to), opportunity (opportunity this task is on), kase (the project this task is on), owner (the owner of the task) and nextTask (the next task). Read more about embed.

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property task which is a Task object. In the case of an invalid request, an error message will be returned, as described in the errors section.

HTTP/1.1 200
{
  "task" : {
    "id" : 493,
    "category" : {
      "id" : 47,
      "name" : "Billing",
      "colour" : "#d36c00"
    },
    "description" : "Send quarterly invoice",
    "status" : "OPEN",
    "party" : {
      "id" : 448322,
      "type" : "organisation",
      "name" : "ABC Furniture",
      "pictureURL" : "https://capsulecrm.com/theme/default/images/org_avatar_70.png"
    },
    "owner" : {
      "id" : 1,
      "username" : "owner",
      "name" : "Rupert Ada"
    },
    "createdAt" : "2015-10-26T14:37:52Z",
    "updatedAt" : "2015-10-26T14:37:52Z",
    "dueOn" : "2015-10-01",
    "hasTrack" : false,
    "repeat" : {
      "interval" : 3,
      "frequency" : "MONTHLY",
      "on" : "1"
    }
  }
}

Create task

Creates a new task. The body must contain an object with a single property task which must be a Task object.

POST
https://api.capsulecrm.com/api/v2/tasks
          {
  "task" : {
    "description" : "Email product details",
    "party" : {
      "id" : 11587
    },
    "dueOn" : "2014-05-20",
    "dueTime" : "18:00:48"
  }
}
        

Query Parameters

Name Type Description
embed Array of String

Can be used to request additional data that aren’t included in the response by default. If provided, should be a comma separated list of strings. Supported values for this endpoint are party (the party this task is assigned to), opportunity (opportunity this task is on), kase (the project this task is on), owner (the owner of the task) and nextTask (the next task). Read more about embed.

Response

Returns HTTP status code 201. The body of the response will contain the task as it was stored in Capsule.

HTTP/1.1 201
Location: https://api.capsulecrm.com/api/v2/tasks/530
{
  "task" : {
    "id" : 530,
    "description" : "Email product details",
    "dueTime" : "18:00:00",
    "status" : "OPEN",
    "party" : {
      "id" : 11587,
      "type" : "person",
      "firstName" : "Scott",
      "lastName" : "Spacey",
      "pictureURL" : "https://capsulecrm.com/theme/default/images/person_avatar_70.png"
    },
    "owner" : {
      "id" : 1,
      "username" : "john",
      "name" : "John Spacey"
    },
    "createdAt" : "2015-12-21T13:51:38Z",
    "updatedAt" : "2015-12-21T13:51:38Z",
    "dueOn" : "2014-05-20",
    "hasTrack" : false
  }
}

Headers:

Name Type Description
Location String

The URL that identifies the new task.

Update task

Update the specified task. The body must contain an object with a single property task which must be a Task object. Fields that are not included in the request will remain unchanged.

PUT
https://api.capsulecrm.com/api/v2/tasks/{taskId}
          {
  "task" : {
    "description" : "Email product info",
    "detail" : "Send information about product design and prices"
  }
}
        

Query Parameters

Name Type Description
embed Array of String

Can be used to request additional data that aren’t included in the response by default. If provided, should be a comma separated list of strings. Supported values for this endpoint are party (the party this task is assigned to), opportunity (opportunity this task is on), kase (the project this task is on), owner (the owner of the task) and nextTask (the next task). Read more about embed.

Response

Returns HTTP status code 200. The body will contain the details of the updated task.

HTTP/1.1 200
{
  "task" : {
    "id" : 530,
    "description" : "Email product info",
    "detail" : "Send information about product design and prices",
    "dueTime" : "18:00:00",
    "status" : "OPEN",
    "party" : {
      "id" : 11587,
      "type" : "person",
      "firstName" : "Scott",
      "lastName" : "Spacey",
      "pictureURL" : "https://capsulecrm.com/theme/default/images/person_avatar_70.png"
    },
    "owner" : {
      "id" : 1,
      "username" : "john",
      "name" : "John Spacey"
    },
    "createdAt" : "2015-12-21T13:51:38Z",
    "updatedAt" : "2015-12-21T13:51:38Z",
    "dueOn" : "2014-05-20",
    "hasTrack" : false
  }
}

Delete task

Fully delete the specific task from Capsule.

DELETE
https://api.capsulecrm.com/api/v2/tasks/{taskId}

Response

Returns HTTP status code 204. The response will contain an empty body.

HTTP/1.1 204