# Batch update catalog records

Allows replacing **all** Catalog records for a given relation at once.
This is a destructive operation and will remove all existing records for the relation before creating new ones.

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

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

[[body_param]]
name = "[]"
description = "Array of records to be created. Each individual records follows the format for [creating a single Catalog record](https://betterstack.com/docs/uptime/api/create-catalog-record/)."
required = true
type = "array"

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

[[header]]
name = "Content_Type"
description = "application/json"
required = false
type = "string"
[/endpoint]

[responses]
[[response]]
status = 201
description = '''Returns empty body'''
body = ''''''

[/responses]

#### Example cURL 

```shell
[label Example]
curl -X "PUT" "https://uptime.betterstack.com/api/v2/catalog/relations/37/records/batch" \
     -H "Authorization: Bearer $TOKEN" \
     -H 'Content-Type: application/json; charset=utf-8' \
     -d $'[
    {
      "attributes": [
        {
          "attribute": { "id": "56", "name": "Team" },
          "values": [
            { "type": "String", "value": "My Team" }
          ]
        },
        {
          "attribute": { "id": "57", "name": "Team Lead" },
          "values": [
            { "type": "Team", "item_id": "123" }
          ]
        }
      ]
    },
    {
      "attributes": [
        {
          "attribute": { "id": "56", "name": "Team" },
          "values": [
            { "type": "String", "value": "Another Team" }
          ]
        },
        {
          "attribute": { "id": "57", "name": "Team Lead" },
          "values": [
            { "type": "Team", "item_id": "124" }
          ]
        }
      ]
    }
  ]'
```

[info]
#### Looking for the details of a specific parameter?
Explore [the list of all Catalog record API parameters](https://betterstack.com/docs/uptime/api/catalog-record-response-params/)
[/info]