Track

Capsule Tracks provide a simple way to define a sequence of tasks for things you do in your business. To create a track you first need a track definition which defines the standard set of tasks that can be applied to cases or opportunities.

For a full description of the models see Track definitions and Tracks

List track definitions

List track definitions with the option to filter for only the track definitions for cases or opportunities.

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

Query Parameters

Name Type Description
type String

List track definitions for cases, opportunities or both. Accepted values are all, kases or opportunities Default: all

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 trackDefinitions which is an array of track definitions.

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/trackdefinitions?page=2>; rel="next"
{
  "trackDefinitions" : [ {
    "id" : 1,
    "description" : "Complaint Process",
    "tag" : null,
    "captureRule" : "CASEFILE",
    "direction" : "START_DATE",
    "createdAt" : "2015-06-04T10:40:20Z",
    "updatedAt" : "2015-06-04T10:40:20Z",
    "taskDefinitions" : [ {
      "id" : 1,
      "description" : "First review",
      "daysAfterRule" : "TRACK_START",
      "daysAfter" : 5,
      "displayOrder" : 1,
      "category" : null,
      "createdAt" : "2015-06-04T10:40:20Z",
      "updatedAt" : "2015-06-04T10:40:20Z"
    }, {
      "id" : 2,
      "description" : "Escalate to Management Team",
      "daysAfterRule" : "LAST_TASK",
      "daysAfter" : 10,
      "displayOrder" : 2,
      "category" : null,
      "createdAt" : "2015-06-04T10:40:20Z",
      "updatedAt" : "2015-06-04T10:40:20Z"
    }, {
      "id" : 3,
      "description" : "Escalate to Regulator",
      "daysAfterRule" : "TRACK_START",
      "daysAfter" : 25,
      "displayOrder" : 3,
      "category" : null,
      "createdAt" : "2015-06-04T10:40:20Z",
      "updatedAt" : "2015-06-04T10:40:20Z"
    } ]
  } ]
}

Headers:

Name Type Description
Link String

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

List tracks

List tracks for a specified case or opportunity. The entity parameter inside the url must be opportunities or kases and defines which tracks to return.

GET
https://api.capsulecrm.com/api/v2/{entity}/{entityId}/tracks

Query Parameters

Name Type Description
embed Array of String

Can be used to specify additional entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are task.

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 tracks which is an array of Tracks.

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/kases/4/tracks?page=2>; rel="next"
{
  "tracks" : [ {
    "id" : 23,
    "tasks" : [ {
      "id" : 80,
      "description" : "First review"
    }, {
      "id" : 81,
      "description" : "Escalate to Management Team"
    }, {
      "id" : 82,
      "description" : "Escalate to Regulator"
    } ],
    "description" : "Complaint Process (Important)",
    "direction" : "START_DATE",
    "trackDateOn" : "2016-01-01"
  } ]
}

Headers:

Name Type Description
Link String

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

Show track

Show track

GET
https://api.capsulecrm.com/api/v2/tracks/{trackId}

Query Parameters

Name Type Description
embed Array of String

Can be used to specify additional entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are task.

Response

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

HTTP/1.1 200
{
  "track" : {
    "id" : 1,
    "tasks" : [ {
      "id" : 2,
      "description" : "First review"
    }, {
      "id" : 3,
      "description" : "Escalate to Management Team"
    }, {
      "id" : 4,
      "description" : "Escalate to Regulator"
    } ],
    "description" : "Complaint Process",
    "direction" : "START_DATE",
    "trackDateOn" : "2015-07-31"
  }
}

Create track

Applies a Track definition to a case or opportunity to create a track.

POST
https://api.capsulecrm.com/api/v2/tracks
          {
  "track" : {
    "description" : "Complaint Process (Important)",
    "trackDateOn" : "2016-01-01",
    "kase" : 4,
    "definition" : 1
  }
}
        

Query Parameters

Name Type Description
embed Array of String

Can be used to specify additional entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are task.

Response

Returns HTTP status code 201. The body of the response will contain the track as it was stored in Capsule. Some of the properties used when applying the track are “write-only” and will not be included in the response.

HTTP/1.1 201
Location: https://api.capsulecrm.com/api/v2/tracks/11587
{
  "track" : {
    "id" : 23,
    "tasks" : [ {
      "id" : 80,
      "description" : "First review"
    }, {
      "id" : 81,
      "description" : "Escalate to Management Team"
    }, {
      "id" : 82,
      "description" : "Escalate to Regulator"
    } ],
    "description" : "Complaint Process (Important)",
    "direction" : "START_DATE",
    "trackDateOn" : "2016-01-01"
  }
}

Headers:

Name Type Description
Location String

The URL that identifies the new track

Update track

Updates basic details about the track - only description and trackDateOn can be modified by this endpoint.

PUT
https://api.capsulecrm.com/api/v2/tracks/{trackId}
          {
  "track" : {
    "description" : "Complaint Process (Important)",
    "trackDateOn" : "2016-01-01"
  }
}
        

Query Parameters

Name Type Description
embed Array of String

Can be used to specify additional entities to fully include in the result. If provided, should be a comma separated list of strings. Accepted values are task.

Response

Returns HTTP status code 200. All good

HTTP/1.1 200
{
  "track" : {
    "id" : 1,
    "tasks" : [ {
      "id" : 2,
      "description" : "First review"
    }, {
      "id" : 3,
      "description" : "Escalate to Management Team"
    }, {
      "id" : 4,
      "description" : "Escalate to Regulator"
    } ],
    "description" : "Complaint Process (Important)",
    "direction" : "START_DATE",
    "trackDateOn" : "2016-01-01"
  }
}

Delete track

Remove track and related tasks from case or opportunity

DELETE
https://api.capsulecrm.com/api/v2/tracks/{trackId}

Response

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

HTTP/1.1 204