# Get metadata record

Returns one metadata record: a key and all its values on one resource.

[endpoint]
base_url = "https://incidents.betterstack.com"
path = "/api/v4/metadata/{metadata_id}"
method = "GET"

[[path_param]]
name = "metadata_id"
description = "The `id` of the metadata record, from [List metadata](https://betterstack.com/docs/uptime/api/list-all-existing-metadata/). It stands for all values of that key on that resource."
required = true
type = "string"

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

[responses]
[[response]]
status = 200
description = '''Returns the metadata record.'''
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" }
      }
    }
  }
}'''

[[response]]
status = 404
description = '''No metadata record with this ID exists in your team.'''
body = '''{
  "errors": "Resource type Metadata with id = 25 was not found"
}'''
[/responses]

[params]
title = "Response attributes"

[[param]]
name = "id"
type = "string"
description = "The ID of the metadata record, which is the ID of the first of its values."

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

[[param]]
name = "attributes.key"
type = "string"
description = "The metadata key."

[[param]]
name = "attributes.values"
type = "array of objects"
description = "All values the resource has under this key."

[[param]]
name = "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`. `Endpoint` is a monitor and `Schedule` an on-call calendar."

[[param]]
name = "attributes.values[].value"
type = "string"
description = "The text of a `String` value."

[[param]]
name = "attributes.values[].item_id"
type = "integer or string"
description = "The ID of the item a value of any other type references. A `Team` is returned as a string like `t123`."

[[param]]
name = "attributes.values[].name"
type = "string or null"
description = "The name of the referenced item."

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

[[param]]
name = "attributes.team_name"
type = "string"
description = "The team the metadata belongs to."

[[param]]
name = "attributes.owner_id"
type = "string"
description = "The ID of the resource the metadata belongs to."

[[param]]
name = "attributes.owner_type"
type = "string"
description = "The type of the resource: `Monitor`, `Heartbeat`, `Incident`, `WebhookIntegration`, `EmailIntegration`, `IncomingWebhook`, `AmazonSnsIntegration`, or `CallRouting`."

[[param]]
name = "relationships.owner"
type = "object"
description = "The same resource as a relationship, kept for backward compatibility. Use `owner_id` and `owner_type` instead."
[/params]

#### Example cURL

```shell
[label Example]
curl --request GET \
  --url https://incidents.betterstack.com/api/v4/metadata/25 \
  --header "Authorization: Bearer $TOKEN"
```
