Create

Description

Create a new record type.

Request

HTTP Method: POST

Parameter Description
name The record type name.
description Optional A short description of the record type.
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.
retention_column_name Optional The timestamp column used to determine record age for TTL expiry. Accepted values are CREATED_AT (default) and UPDATED_AT. With UPDATED_AT, a record's age resets each time it's updated, so only records that haven't been updated within ttl_days are deleted. Has no effect unless ttl_days is set.
on_limit_reached Optional Behavior when the record type reaches its per-type record limit. Accepted values are REJECT (default; block new writes) and EVICT_OLDEST (delete the oldest record to make room for the new one).
max_records_limit Optional Custom per-record-type record limit. Must be a positive integer no greater than the tenant ceiling. If omitted, the tenant default applies.

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",
      "description": "Optional description of the record type",
      "team_id": "<<META.team.id>>",
      "fields": [{ "name": "Column 1", "result_type": "TEXT" }],
      "editable": true,
      "ttl_days": 3,
      "retention_column_name": "UPDATED_AT",
      "on_limit_reached": "EVICT_OLDEST",
      "max_records_limit": 5000
    }'

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.
description A short description of the record type, or null if not set.
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.
retention_column_name The timestamp column used to determine record age for TTL expiry. One of CREATED_AT or UPDATED_AT. With UPDATED_AT, a record's age resets each time it's updated.
on_limit_reached Behavior when the record type reaches its per-type record limit. One of REJECT (block new writes) or EVICT_OLDEST (delete the oldest record to make room).
max_records_limit Custom per-record-type record limit, or null if no custom limit is set (in which case the tenant default applies).
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",
  "description": "Optional description of the record type",
  "editable": false,
  "ttl_days": 3,
  "retention_column_name": "UPDATED_AT",
  "on_limit_reached": "EVICT_OLDEST",
  "max_records_limit": 5000,
  "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?