Query Resources by Metadata

Use /metadata/query to find child resources (keys, credentials, DIDs, etc.) that match specific metadata constraints. Constraints follow the Presentation Definition format: each field lists a JSON path and an optional JSON Schema filter.

Query metadata (Credential Store example)

CURL

Endpoint: /v1/{target}/credential-store-service-api/metadata/query | API Reference

Example Request

curl -X 'POST' \
  'https://{orgHost}.enterprise-sandbox.waltid.dev/v1/{target}/credential-store-service-api/metadata/query' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer {yourToken}' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "path": ["$.tags"],
      "filter": {
        "type": "array",
        "contains": {
          "const": "production"
        }
      }
    }
  ]'

Path Parameters

  • orgHost: String – Organization host alias. In sandbox, test resolves to https://test.enterprise-sandbox.waltid.dev.
  • target: resourceIdentifier – Credential Store service you want to search ({organization}.{tenant}.{serviceId}), e.g. test.tenant1.credential-store-1.

Body Parameters

  • constraints: Array – List of Presentation Definition field objects. Each object contains:
    • path: JSON path expressions to inspect (prefixed with $).
    • filter: Optional JSON Schema fragment used to match the metadata value.

Example Response 200 OK

{
  "test.tenant1.credential-store-1.credential-123": {
    "description": "Employee badge",
    "tags": ["production", "badge"]
  }
}
  • Keys are resource targets; values are the matched metadata objects. Empty object indicates no matches.
Last updated on December 3, 2025