Custom Field

Custom fields allow you to record information about your contacts, cases or sales opportunities. These endpoints allow to manage the custom fields’ definitions in the Capsule account. For a full description of the model see the Fields definition model description.

To add, remove or update custom field values use the update party, update opportunity or update case endpoints.

Create custom field

Creates a new party, opportunity or case custom field. The type of this field is defined by the entity parameter inside the url which must be parties, opportunities or kases

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

POST
https://api.capsulecrm.com/api/v2/{entity}/fields/definitions
          {
  "definition" : {
    "type" : "List",
    "name" : "Type",
    "options" : [ "Accounting", "Helpdesk", "Mailing" ],
    "tag" : {
      "name" : "Integration Partner"
    }
  }
}
        

Response

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

HTTP/1.1 201
Location: https://api.capsulecrm.com/api/v2/fields/definitions/100

Headers:

Name Type Description
Location String

The URL that identifies the new field

Delete custom field

Removes a custom field from this capsule account. Note that this will remove the field value from any parties, opportunities and cases it was assigned to.

DELETE
https://api.capsulecrm.com/api/v2/{entity}/fields/definitions/{fieldId}

Response

Returns HTTP status code 204. However, Capsule might schedule the deletion for later and return HTTP status 202 Accepted as defined in Long Running Operation section.

HTTP/1.1 204

List custom fields

The collection all of custom on this Capsule account. The entity parameter inside the url must be parties, opportunities or kases and defines which custom fields to return.

GET
https://api.capsulecrm.com/api/v2/{entity}/fields/definitions

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

HTTP/1.1 200
Link: <https://api.capsulecrm.com/api/v2/fields/definitions?page=2>; rel="next"
{
  "definitions" : [ {
    "id" : 45,
    "type" : "text",
    "description" : null,
    "displayOrder" : 1,
    "name" : "Refering Site",
    "tag" : null,
    "captureRule" : null
  }, {
    "id" : 51,
    "type" : "number",
    "description" : null,
    "displayOrder" : 1,
    "name" : "Lead Score",
    "tag" : {
      "id" : 1499,
      "name" : "Lead",
      "dataTag" : true
    },
    "captureRule" : null
  }, {
    "id" : 46,
    "type" : "date",
    "description" : "Birthday Field",
    "displayOrder" : 2,
    "name" : "Date of Birth",
    "tag" : null,
    "captureRule" : "person"
  }, {
    "id" : 47,
    "type" : "list",
    "description" : null,
    "displayOrder" : 3,
    "name" : "Industry Sector",
    "tag" : null,
    "captureRule" : "organisation",
    "options" : [ "Technology", "Insurance", "Financial services", "Retail & consumer" ]
  }, {
    "id" : 48,
    "type" : "boolean",
    "description" : null,
    "displayOrder" : 4,
    "name" : "Local",
    "tag" : null,
    "captureRule" : null
  } ]
}

Headers:

Name Type Description
Link String

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

Show custom field

GET
https://api.capsulecrm.com/api/v2/{entity}/fields/definitions/{fieldId}

Response

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

HTTP/1.1 200
{
  "definition" : {
    "id" : 52,
    "type" : "list",
    "description" : null,
    "displayOrder" : 1,
    "name" : "Type",
    "tag" : {
      "id" : 1501,
      "name" : "Integration Partner",
      "dataTag" : true
    },
    "captureRule" : null,
    "options" : [ "Accounting", "Helpdesk", "Mailing" ]
  }
}

Update custom field

Update the details of a party, opportunity or case field definition. The body must contain an object with a single property definition which must be a field definition.

POST
https://api.capsulecrm.com/api/v2/{entity}/fields/definitions/{fieldId}
          {
  "definition" : {
    "name" : "Integration Type",
    "tag" : {
      "name" : "Integration Partner"
    }
  }
}
        

Response

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

HTTP/1.1 200
{
  "definition" : {
    "id" : 52,
    "type" : "list",
    "description" : null,
    "displayOrder" : 1,
    "name" : "Integration Type",
    "tag" : {
      "id" : 1501,
      "name" : "Integration Partner",
      "dataTag" : true
    },
    "captureRule" : null,
    "options" : [ "Accounting", "Helpdesk", "Mailing" ]
  }
}