1. API
  2. Cases
  3. Fields

Fields: Create

Description

Creates a field on a team.

See the Get Field API to learn more about fields.

Request

HTTP Method: POST

Parameter Description
name The name of the field.
input_type The type of the field. One of string, number, boolean, or timestamp.
team_id The ID of the team where the field should be added.
sensitive Optional A boolean (true or false) indicating whether the sensitive field permission is required to read or write this field.
validation_type Optional The validation type for the field. One of options or regex. Use these only with string inputs.
validation_options Optional Validation options for the field. For options, provide an array of values. For regex, provide a regex pattern string.
group_name Optional The name of the group to assign the field to.

Sample request

curl -X POST \
  https://<tenant-domain>/api/v1/case_inputs/ \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>'
  -d '{
        "name": "Operating system",
        "input_type": "string",
        "team_id": 1,
        "sensitive": false,
        "validation_type": "options",
        "validation_options": {
          "options": [
            "Windows",
            "MacOS",
            "Linux"
          ]
        }
      }'
curl -X POST \
  https://<tenant-domain>/api/v1/case_inputs/ \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>'
  -d '{
        "name": "IP address",
        "input_type": "string",
        "team_id": 1,
        "sensitive": true,
        "validation_type": "regex",
        "validation_options": {
          "regex": "^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}$"
        }
      }'

Response

A successful request will return a JSON object describing the field.

Field description

Parameter Description
id The field ID.
name The name of the field.
input_type The type of the field.
sensitive A boolean (true or false) indicating whether the sensitive field permission is required to read or write this field.
validation_type Validation type of the field.
validation_options Validation options of the field.
team An object containing the ID and name of the team the field belongs to.
team_case_input_group An object containing the name of the group the field belongs to, if any.
created_at An ISO 8601 timestamp representing when the field was created.
updated_at An ISO 8601 timestamp representing when the field was last updated.

Sample response

{
  "id": 21405,
  "name": "Operating system",
  "input_type": "string",
  "sensitive": false,
  "validation_type": "options",
  "validation_options": {
    "options": ["Windows", "MacOS", "Linux"]
  },
  "team": {
    "id": 1,
    "name": "Engineering"
  },
  "created_at": "2022-06-24T08:35:21Z",
  "updated_at": "2022-06-24T08:35:21Z"
}
Was this helpful?