Update

Description

Update an existing record type. You can update the record type name, editable status, TTL settings, and fields.

Request

HTTP Method: PUT

Parameter Description
record_type_id The ID of the record type to update.
name Optional The record type name.
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 Optional An array of objects describing the record fields. If omitted, existing fields are preserved unchanged.
field_ids_to_delete Optional An array of field IDs to delete. Use this to explicitly remove fields from the record type.

Fields parameter

The fields parameter is an array of objects representing the record fields. When provided, fields included in the array are created or updated. Fields not included in the array are preserved unchanged. If the fields parameter is omitted, not provided, or set to null, all existing fields remain unchanged. Providing an empty array ([]) will also preserve all existing fields.

To update an existing field, include its id along with the properties to change. To add a new field, omit the id and provide at least a name and result_type.

To delete fields, use the field_ids_to_delete parameter with an array of field IDs to remove.

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. The result_type can only be changed between TEXT and TEXT_ENUM - other data type changes are not allowed.

# Update only the record type name
curl -X PUT \
  https://<<META.tenant.domain>>/api/v1/record_types/<<record_type_id>> \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
  -d '{
      "name": "Updated record type name"
    }'

# Update fields
curl -X PUT \
  https://<<META.tenant.domain>>/api/v1/record_types/<<record_type_id>> \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
  -d '{
      "name": "Updated record type name",
      "editable": true,
      "ttl_days": 7,
      "fields": [
        {
          "id": 1,
          "name": "Updated Column Name",
          "result_type": "TEXT_ENUM",
          "fixed_values": ["Option A", "Option B", "Option C"]
        },
        {
          "name": "New Column",
          "result_type": "NUMBER"
        }
      ],
      "field_ids_to_delete": [2, 5]
    }'

Response

A successful request will return a JSON object representing the updated 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": "Updated record type name",
  "editable": true,
  "ttl_days": 7,
  "team_id": 123,
  "record_fields": [
    {
      "id": 1,
      "name": "Updated Column Name",
      "result_type": "TEXT_ENUM",
      "fixed_values": ["Option A", "Option B", "Option C"]
    },
    {
      "id": 4,
      "name": "New Column",
      "result_type": "NUMBER",
      "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?