Remove catalog records

Delete records from a catalog relation by their primary attribute values, or send all: true to delete every record. The relation and its attributes stay.

DELETE https://incidents.betterstack.com/api/v4/catalog/relations/{catalog_relation_id}/records/batch
catalog_relation_id string required

The ID of the catalog relation the catalog record belongs to.

team_id string

Team to use, such as t123. Get the ID via List teams. Required when you can access more than one team.

Authorization string required

Bearer $TOKEN

Content-Type string

application/json

records array of objects

Records to delete, up to 100. Give each record by its primary attribute values only. A record is deleted when its primary values match exactly. Send either records or all.

records[].attributes array of objects

The record's primary attribute values. When you leave out a primary attribute, only a record with no value for it matches.

records[].attributes[].attribute object required

A primary attribute, by its ID or name.

records[].attributes[].attribute.id string

The catalog attribute's ID.

records[].attributes[].attribute.name string

The catalog attribute's name.

records[].attributes[].values array of objects required

The record's values for this attribute, in the same form as when you create a record.

records[].attributes[].values[].type string

The value's type, which is String or the type of the referenced item.

records[].attributes[].values[].value string

The text of a String value.

records[].attributes[].values[].item_id string

ID of the referenced item. For a user it's u123 or their e-mail. For a team it's t123, and for any other item it's the item's own ID. Responses return users and teams in this form. Get a user's ID via List team members, and a team's ID via List teams.

records[].attributes[].values[].name string

Referenced item's name.

records[].attributes[].values[].email string

Referenced user's e-mail.

all boolean

Set to true to delete every record in the relation. Send either records or all. Always true.

200

Returns how many records were deleted, and what happened to each record you sent.

200 OK
{
  "meta": {
    "removed_count": 1,
    "rows": [
      {
        "result": "removed",
        "record_ids": [
          "67"
        ]
      }
    ]
  }
}
401

The API token is missing or invalid.

401 Unauthorized
{
  "errors": "Invalid Team API token. How to find your Team API token: https://betterstack.com/docs/uptime/api/getting-started-with-uptime-api/#get-an-incidents-api-token"
}
403

The token is read-only, your role doesn't include Manage on Monitors, heartbeats, integrations, or the token can't be used for this API.

403 Forbidden
{
  "errors": "This API token is read-only and cannot be used for write operations."
}
404

The catalog relation doesn't exist, or the token can't access it. Get the relation ID via List catalog relations.

422

Both records and all were sent, or neither was. The request also fails when records has more than 100 entries, when a record names an unknown attribute, an unknown value or an attribute that isn't primary, or when the relation has no primary attribute.

422 Unprocessable Content
{
  "errors": "Sorry, these attributes have unsupported values",
  "allowed_values": {
    "records": [
      "must be an array of records to remove, or pass `all: true` instead"
    ]
  }
}
meta.removed_count integer

Number of records this request deleted.

meta.rows array of objects

One result per record sent, in the same order. Not returned with all: true.

meta.rows[].result string

The outcome.
Valid values:
removed: The record was deleted.
no_match: No record matches the values.
several_match: The values match more than one record, and none was deleted.

meta.rows[].record_ids array of strings

IDs of the records the values match.

Example cURL

Batch delete catalog records
curl --request DELETE \
  --url https://incidents.betterstack.com/api/v4/catalog/relations/37/records/batch \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
  "all": true
}'