Update metadata record

Changes a metadata record's values, renames its key, or moves it to another resource. Send only what you want to change.

PATCH https://incidents.betterstack.com/api/v4/metadata/{metadata_id}

URL parameters

metadata_id
required string

Headers

Authorization
required string
Content-Type
required string

Body parameters

values
array of objects
key
string
owner_id
string
owner_type
string
200

Response body

{
  "data": {
    "id": "25",
    "type": "metadata",
    "attributes": {
      "key": "Owner",
      "values": [
        {
          "type": "Team",
          "item_id": "t123",
          "name": "Platform team"
        }
      ],
      "team_name": "Testing",
      "owner_id": "2",
      "owner_type": "Monitor"
    },
    "relationships": {
      "owner": {
        "data": {
          "id": "2",
          "type": "monitor"
        }
      }
    }
  }
}
204
404

Response body

{
  "errors": "Resource type Metadata with id = 25 was not found"
}
422

Response body

{
  "errors": {
    "values": [
      "Values for Owner must be unique"
    ]
  }
}

Example cURL

Replace values Rename the key
curl --request PATCH \
  --url https://incidents.betterstack.com/api/v4/metadata/25 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "values": [{ "type": "Team", "item_id": "t123" }]
  }'
curl --request PATCH \
  --url https://incidents.betterstack.com/api/v4/metadata/25 \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/json" \
  --data '{
    "key": "Service owner"
  }'