# List catalog records

Returns a list of all your Catalog records for a [Catalog relation](https://betterstack.com/docs/uptime/api/list-all-catalog-relations/).

[endpoint]
base_url = "https://incidents.betterstack.com"
path = "/api/v2/catalog/relations/{relation_id}/records"
method = "GET"

[[path_param]]
name = "relation_id"
description = "The ID of the Catalog relation you want to get records for."
required = true
type = "string"

[[query_param]]
name = "page"
description = "The page number to return, starting with `1`."
required = false
type = "integer"

[[query_param]]
name = "per_page"
description = "Number of results per page. Defaults to `50`, maximum `250`."
required = false
type = "integer"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = '''Returns a list of existing Catalog records.'''
body = '''{
  "data": [
    {
      "id": "67",
      "type": "catalog_record",
      "attributes": {
        "attributes": [
          {
            "attribute": { "id": 56, "name": "Team" },
            "values": [
              { "type": "String", "value": "My Team" }
            ]
          },
          {
            "attribute": { "id": 57, "name": "Team Lead" },
            "values": [
              { "type": "Team", "item_id": 123, "name": "SRE" }
            ]
          }
        ]
      }
    },
    {
      "id": "68",
      "type": "catalog_record",
      "attributes": {
        "attributes": [
          {
            "attribute": { "id": 56, "name": "Team" },
            "values": [
              { "type": "String", "value": "Another Team" }
            ]
          },
          {
            "attribute": { "id": 57, "name": "Team Lead" },
            "values": [
              { "type": "Team", "item_id": 124, "name": "Platform" }
            ]
          }
        ]
      }
    }
  ],
  "pagination": {
    "first": "https://incidents.betterstack.com/api/v2/catalog/relations/67/records?page=1",
    "last": "https://incidents.betterstack.com/api/v2/catalog/relations/67/records?page=1",
    "prev": null,
    "next": null
  }
}'''

[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the Catalog record."

[[param]]
name = "type"
type = "string"
description = "Always `catalog_record`."

[[param]]
name = "attributes.attributes"
type = "array of objects"
description = "The record's values, one entry per Catalog attribute that has values."

[[param]]
name = "attributes.attributes[].attribute"
type = "object"
description = "The Catalog attribute the values belong to."

[[param]]
name = "attributes.attributes[].attribute.id"
type = "integer"
description = "The ID of the Catalog attribute."

[[param]]
name = "attributes.attributes[].attribute.name"
type = "string"
description = "The name of the Catalog attribute."

[[param]]
name = "attributes.attributes[].values"
type = "array of objects"
description = "The values of this attribute in the record."

[[param]]
name = "attributes.attributes[].values[].type"
type = "string"
description = "The type of the value: `String`, `User`, `Team`, `Policy`, `Schedule`, `Endpoint`, `Source`, `SlackIntegration`, `LinearIntegration`, `JiraIntegration`, `MicrosoftTeamsWebhook`, `ZapierWebhook`, `NativeWebhook` or `PagerDutyWebhook`."

[[param]]
name = "attributes.attributes[].values[].value"
type = "string"
description = "The value, returned only when `type` is `String`."

[[param]]
name = "attributes.attributes[].values[].item_id"
type = "integer"
description = "The ID of the referenced item, returned when `type` is not `String`."

[[param]]
name = "attributes.attributes[].values[].name"
type = "string or null"
description = "The name of the referenced item, returned when `type` is not `String`, or `null` when the item has no name."

[[param]]
name = "attributes.attributes[].values[].email"
type = "string"
description = "The e-mail of the referenced user, returned only when `type` is `User`."

[[param]]
name = "pagination.first"
type = "string"
description = "The URL of the first page. Read more about [pagination](https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#pagination)."

[[param]]
name = "pagination.last"
type = "string"
description = "The URL of the last page."

[[param]]
name = "pagination.prev"
type = "string or null"
description = "The URL of the previous page, or `null` on the first page."

[[param]]
name = "pagination.next"
type = "string or null"
description = "The URL of the next page, or `null` on the last page."
[/params]

#### Example cURL 

```shell
[label Example]
curl --request GET \
  --url https://incidents.betterstack.com/api/v2/catalog/relations/67/records \
  --header "Authorization: Bearer $TOKEN"
```
