PT EN

Metadados

URL base: $BUSINESS_API

O objecto

resource_typestring · opcional
resource_idstring · opcional
metadataobject · opcional
Operações
O objecto
{
  "resource_type": "resource type",
  "resource_id": "res_2iAXhMsJzmqPnY6X5cMTJ6OBTSG",
  "metadata": {
    "key": "value"
  }
}

Procurar registos por metadados

Registos

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.

Parâmetros

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

keystring · consulta · opcional

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

valuestring · consulta · opcional

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

resource_typestring · consulta · opcional

Restrict to one resource type

Devolve

200 Resources with metadata

Mostrar atributos
dataarray of MetadataEntry · opcional
Mostrar atributos filhos
resource_typestring · opcional
resource_idstring · opcional
metadataobject · opcional
has_moreboolean · opcional
next_cursorstring · opcional

Erros 400

Permissões business:metadata:read · Funções: admin, customer_service, owner

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