Metadata

Base URL: $BUSINESS_API

The object

resource_typestring · optional
resource_idstring · optional
metadataobject · optional
Endpoints
The object
{
  "resource_type": "resource type",
  "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
  "metadata": {
    "key": "value"
  }
}

List resources by metadata

Logs

GET /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

limitinteger · query · optional

Maximum resources to return (default 20, maximum 100).

afterstring · query · optional

Opaque cursor returned by the previous page.

keystring · query · optional

Metadata key to match; give key, value or both.

valuestring · query · optional

Exact metadata value to match; give key, value or both.

resource_typestring · query · optional

Restrict to one resource type

Returns

200 Resources with metadata

Show attributes
dataarray of MetadataEntry · optional
Show child attributes
resource_typestring · optional
resource_idstring · optional
metadataobject · optional
has_moreboolean · optional
next_cursorstring · optional

Errors 400

Permissions business:metadata:read · Roles: admin, customer_service, owner

curl -X GET "$BUSINESS_API/metadata" \
  -H "Authorization: Bearer sk_test_..."
Response 200
{
  "data": [
    {
      "resource_type": "resource type",
      "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
      "metadata": {
        "key": "value"
      }
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}