List

Description

Retrieve a list of record types.

Request

HTTP Method: GET

Query Parameter Description
team_id ID of team to which the record type belongs.
per_page Optional Set the number of results returned per page. Defaults to 20.
page Optional The page number of results to fetch.
curl -X GET \
  https://<<META.tenant.domain>>/api/v1/record_types?team_id=<<team_id>> \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>'

Response

A successful request will return a JSON Array describing record types in the specified team.

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

{
  "record_types": [
    {
      "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": []
        }
      ]
    },
    {
      "id": 2,
      "name": "Record type 2",
      "editable": false,
      "ttl_days": nil,
      "record_fields": [
        {
          "id": 4,
          "name": "Field 1",
          "result_type": "TEXT",
          "fixed_values": ["Value 1", "Value 2", "Value 3"]
        }
      ],
      "default_record_fields": [
        {
          "id": 5,
          "name": "Story name",
          "result_type": "TEXT",
          "fixed_values": []
        },
        {
          "id": 6,
          "name": "Timestamp",
          "result_type": "TIMESTAMP",
          "fixed_values": []
        }
      ]
    }
  ],
  "meta": {
    "current_page": "https://<<META.tenant.domain>>/api/v1/record_types?per_page=20&page=1",
    "previous_page": null,
    "next_page": null,
    "next_page_number": null,
    "per_page": 20,
    "pages": 1,
    "count": 3
  }
}
Was this helpful?