Category

These endpoints allow you to retrieve, create and update task categories. Our users use task categories to easily identify tasks or filter tasks when creating a report or list. For a full description of the model see the Category model definition.

Create task category

Creates a new task category

The body must contain an object with a single property category which must be a category.

POST
https://api.capsulecrm.com/api/v2/categories
          {
  "category" : {
    "name" : "Billing",
    "colour" : "#444444"
  }
}
        

Response

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

HTTP/1.1 201
Location: https://api.capsulecrm.com/api/v2/categories/1840253
{
  "category" : {
    "id" : 206,
    "name" : "Billing",
    "colour" : "#444444"
  }
}

Headers:

Name Type Description
Location String

The URL that identifies the new category

Delete task category

Removes a category from the capsule account. Any tasks under this category will be retained but will become uncategorized.

DELETE
https://api.capsulecrm.com/api/v2/categories/{categoryId}

Response

Returns HTTP status code 204. Returns an empty body if the case was successfully deleted

HTTP/1.1 204

List task categories

The collection of all the task categories on this Capsule account.

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

Query Parameters

Name Type Description
page Integer

The page of results to return. Default: 1

perPage Integer

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

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property categories which is an array of categories.

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/categories?page=2>; rel="next"
{
  "categories" : [ {
    "id" : 1,
    "name" : "Call",
    "colour" : "#d16c1a"
  }, {
    "id" : 2,
    "name" : "Email",
    "colour" : "#444444"
  }, {
    "id" : 5,
    "name" : "Milestone",
    "colour" : "#d1c21a"
  }, {
    "id" : 6,
    "name" : "Send",
    "colour" : "#444444"
  }, {
    "id" : 205,
    "name" : "Billing",
    "colour" : "#444444"
  } ]
}

Headers:

Name Type Description
Link String

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

Show task category

GET
https://api.capsulecrm.com/api/v2/categories/{categoryId}

Response

Returns HTTP status code 200. The body of the response will contain an object with a single property category which is a category.

HTTP/1.1 200
{
  "category" : {
    "id" : 206,
    "name" : "Billing",
    "colour" : "#444444"
  }
}

Update task category

Allows to rename or change the colour of the task category. The body must contain an object with a single property category which must be a category.

POST
https://api.capsulecrm.com/api/v2/categories/{categoryId}
          {
  "category" : {
    "colour" : "#d1c21a"
  }
}
        

Response

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

HTTP/1.1 200
{
  "category" : {
    "id" : 3,
    "name" : "Contract Renewal",
    "colour" : "#d1c21a"
  }
}