Create

Description

Create a case input on a team.

Request

HTTP Method: POST

Parameter Description
name The name of the case input.
input_type The type of the case input. One of string, number, boolean, timestamp.
team_id ID of team to which the case input should be added.
validation_type Optional Validation type of the case input. One of options, regex. options and regex are only valid when used with string inputs.
validation_options Optional Validation options of the case input. For options type, an array of options. For regex type, a string representing the regex.

Sample request

curl -X POST \
  https://<<META.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,
        "validation_type": "options",
        "validation_options": {
          "options": [
            "Windows",
            "MacOS",
            "Linux"
          ]
        }
      }'
curl -X POST \
  https://<<META.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,
        "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 case input..

Field description

Parameter Description
id The case input ID.
name The name of the case input.
input_type The type of the case input.
validation_type Validation type of the case input.
validation_options Validation options of the case input.
team An object containing the ID and name of the team the case input belongs to.
created_at ISO 8601 Timestamp representing creation date and time of the case input.
updated_at ISO 8601 Timestamp representing last updated date and time of the case input.

Sample response

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