Create

Description

Create a new record type.

Request

HTTP Method: POST

Parameter Description
name The record type name.
team_id ID of team to which the record type belongs.
fields An array of objects describing the custom record fields defined by the user.
editable Optional Whether the records for this record type are editable or not.
ttl_days Optional Records for this record type will be deleted after this number of days.

Fields parameter

The fields parameter is an array of objects representing the custom record fields defined by the user. Each object within this array must include a name property and a result_type property.

The result_type property specifies the data type of the field. Acceptable values for result_type are:

  • TEXT: For text-based fields
  • NUMBER: For numeric fields
  • TIMESTAMP: For date and time fields
  • BOOLEAN: For true/false fields
  • TEXT_ENUM: For text fields with a predefined set of values
  • ARTIFACT: For large text fields

If the result_type is set to TEXT_ENUM, an additional fixed_values property must be included. This property should be an array containing the allowed values for that field.

curl -X POST \
  https://<<META.tenant.domain>>/api/v1/record_types/
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>'
  -d '{
      "name": "Record type name",
      "team_id": "<<META.team.id>>",
      "fields": [{ "name": "Column 1", "result_type": "TEXT" }],
      "editable": true,
      "ttl_days": 3
    }'

Response

A successful request will return a JSON object representing the created record type.

Field description

Parameter Description
id The record type ID.
name The record type name.
team_id ID of team to which the record type belongs.
editable Whether the records for this record type are editable or not.
ttl_days Records for this record type will be deleted after this number of days.
record_fields An array of objects describing the custom record fields defined by the user.
default_record_fields An array of objects describing the default record fields (Timestamp and Story name).

Sample response

{
  "id": 1,
  "name": "Record type 1",
  "editable": false,
  "ttl_days": 3,
  "record_fields": [
    {
      "id": 1,
      "name": "Field 1",
      "result_type": "TEXT",
      "fixed_values": []
    }
  ],
  "default_record_fields": [
    {
      "id": 2,
      "name": "Story name",
      "result_type": "TEXT",
      "fixed_values": []
    },
    {
      "id": 3,
      "name": "Timestamp",
      "result_type": "TIMESTAMP",
      "fixed_values": []
    }
  ]
}
Was this helpful?