List resources by metadata
LogsGET /metadata
List resources by metadata; key or value is required
Searches the metadata attached to the tenant's records and returns the matching resources with their full metadata, using cursor pagination. At least one of key or value must be given, otherwise the call returns 400; resource_type narrows the search to one kind of record (customer, account, property, meter, connection, invoice, payment, ticket, work_order, incident, tariff or reading_route). Requires the business:metadata:read permission.
Parameters
limitMaximum resources to return (default 20, maximum 100).
afterOpaque cursor returned by the previous page.
keyMetadata key to match; give key, value or both.
valueExact metadata value to match; give key, value or both.
resource_typeRestrict to one resource type
Returns
200 Resources with metadata
Show attributes
dataShow child attributes
resource_typeresource_idmetadata
has_morenext_cursor
Errors 400
Permissions business:metadata:read · Roles: admin, customer_service, owner
curl -X GET "$BUSINESS_API/metadata" \
-H "Authorization: Bearer sk_test_..."
# No matching CLI command; use cURL or direct HTTP.
const res = await fetch("$BUSINESS_API/metadata", {
method: "GET",
headers: {
Authorization: "Bearer sk_test_..."
}
});
const data = await res.json();
import requests
res = requests.get(
"$BUSINESS_API/metadata",
headers={
"Authorization": "Bearer sk_test_..."
}
)
data = res.json()
req, _ := http.NewRequest("GET", "$BUSINESS_API/metadata", nil)
req.Header.Set("Authorization", "Bearer sk_test_...")
resp, err := http.DefaultClient.Do(req)
{
"data": [
{
"resource_type": "resource type",
"resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
"metadata": {
"key": "value"
}
}
],
"has_more": true,
"next_cursor": "next cursor"
}