Metadata API

List, create, update, and delete metadata using a simple HTTP API.

Do you need help with the integration?

Let us know at [email protected].

Obtaining an API token

Please, see Obtaining an API token.

get
Listing all existing metadata

https://betteruptime.com/api/v2/metadata
List all metadata with an option to filter metadata by owner.
Request
Response
Request
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Query Parameters
owner_id
optional
string
Return metadata with a certain owner.
owner_type
optional
string
Return metadata with a certain owner type (Monitor, Heartbeat, Incident, WebhookIntegration, EmailIntegration).
Response
200: OK
Returns list of existing incidents
{
"data": [
{
"id": "25",
"type": "metadata",
"attributes": {
"key": "KEY_1",
"value": "value-1"
},
"relationships": {
"owner": {
"data": {
"id": "2",
"type": "Monitor"
}
}
}
},
{
"id": "23",
"type": "metadata",
"attributes": {
"key": "KEY_2",
"value": null
},
"relationships": {
"owner": {
"data": {
"id": "30579",
"type": "webhook_integration"
}
}
}
}
],
"pagination": {
"first": "https://betteruptime.com/api/v2/metadata?page=1",
"last": "https://betteruptime.com/api/v2/metadata?page=4",
"prev": null,
"next": "https://betteruptime.com/api/v2/metadata?page=2"
}
}
Example cURL
Example cURL
curl --request GET \
--url "https://betteruptime.com/api/v2/metadata" \
--header 'authorization: Bearer YOUR_API_TOKEN'

get
Getting a single metadata

https://betteruptime.com/api/v2/metadata/:metadata_id
Returns a single metadata record.
Request
Response
Request
Path Parameters
metadata_id
required
string
The ID of the metadata record you want to get
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Response
200: OK
Returns a single incident
{
"data": {
"id": "123456789",
"type": "metadata",
"attributes": {
"key": "KEY_1",
"value": "value-1"
},
"relationships": {
"owner": {
"data": {
"id": "2",
"type": "Monitor"
}
}
}
}
}
Example cURL
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/metadata/123456789 \
--header 'Authorization: Bearer YOUR_API_TOKEN'

post
Creating a new metadata record

https://betteruptime.com/api/v2/metadata
This will create a new metadata.
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Authentication token to track down who is emptying our stocks.
Form Data Parameters
owner_id
required
string
The ID of the owner
owner_type
required
string
The type of the owner record - accepted values areMonitor, Heartbeat, Incident, WebhookIntegration, and EmailIntegration
key
required
string
Metadata key
value
optional
string
Metadata value (optional)
Response
201: Created
The metadata was successfully created.
{
"data": {
"id": "25",
"type": "metadata",
"attributes": {
"key": "KEY_1",
"value": "value-1"
},
"relationships": {
"owner": {
"data": {
"id": "2",
"type": "Monitor"
}
}
}
}
}
403: Forbidden
Authentication failed
Example cURL
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/metadata \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"key": "KEY_1", "value": "value-1", "owner_id": "2", "owner_type": "Monitor"}'

patch
Updating a metadata record

https://betteruptime.com/api/v2/metadata/:metadata_id
This will update an existing metadata.
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authentication
required
string
Authentication token to track down who is emptying our stocks.
Form Data Parameters
owner_id
optional
string
The ID of the owner
owner_type
optional
string
The type of the owner record - accepted values areMonitor, Heartbeat, Incident, WebhookIntegration, and EmailIntegration
key
optional
string
Metadata key
value
optional
string
Metadata value (optional)
Response
200: OK
The metadata was successfully updated.
{
"data": {
"id": "123456789",
"type": "metadata",
"attributes": {
"key": "KEY_3",
"value": "value-4"
},
"relationships": {
"owner": {
"data": {
"id": "2",
"type": "Monitor"
}
}
}
}
}
404: Not Found
Metadata was not found.
Example cURL
Example cURL
curl --request GET \
--url https://betteruptime.com/api/v2/metadata/123456789 \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"key": "KEY_3", "value": "value-4"}'

delete
Deleting an existing metadata

https://betteruptime.com/api/v2/metadata/:metadata_id
Request
Response
Request
Path Parameters
metadata_id
required
string
The ID of the metadata you want to delete
Headers
Authorization
required
string
Bearer YOUR_API_TOKEN
Response
204: No Content
Returns an empty response
Example cURL
Example cURL
curl --request DELETE \
--url https://betteruptime.com/api/v2/metadata/123456 \
--header 'Authorization: Bearer YOUR_API_TOKEN'