Skip to main content

Grounding

Batch-check live availability for a set of items

POST
/projects/{projectId}/grounding/availability
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/grounding/availability" \  -H "Content-Type: application/json" \  -d '{    "availability": {},    "item_ids": [      "string"    ]  }'
{
  "$schema": "/api/v1/schemas/GroundingAvailabilityOutputBody.json",
  "items": [
    {
      "$schema": "/api/v1/schemas/ResultItem.json",
      "availability": {
        "as_of": "2019-08-24T14:15:22Z",
        "next_open_slots": [
          "2019-08-24T14:15:22Z"
        ],
        "status": "string"
      },
      "item": {
        "attributes": {
          "property1": null,
          "property2": null
        },
        "currency": "string",
        "description": "string",
        "external_ref": "string",
        "is_demo": true,
        "item_id": "string",
        "item_type": "string",
        "name": "string",
        "price": 0.1,
        "price_unit": "string",
        "price_updated_at": "2019-08-24T14:15:22Z",
        "status": "string",
        "updated_at": "2019-08-24T14:15:22Z"
      },
      "kb_snippets": [
        "string"
      ]
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Get one item with live availability

GET
/projects/{projectId}/grounding/items/{itemId}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

itemId*string

Catalog item UUID

Query Parameters

from?string

RFC3339 or YYYY-MM-DD

to?string

RFC3339 or YYYY-MM-DD

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/grounding/items/string"
{
  "$schema": "/api/v1/schemas/ResultItem.json",
  "availability": {
    "as_of": "2019-08-24T14:15:22Z",
    "next_open_slots": [
      "2019-08-24T14:15:22Z"
    ],
    "status": "string"
  },
  "item": {
    "attributes": {
      "property1": null,
      "property2": null
    },
    "currency": "string",
    "description": "string",
    "external_ref": "string",
    "is_demo": true,
    "item_id": "string",
    "item_type": "string",
    "name": "string",
    "price": 0.1,
    "price_unit": "string",
    "price_updated_at": "2019-08-24T14:15:22Z",
    "status": "string",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "kb_snippets": [
    "string"
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Query live inventory: hybrid KB search + structured catalog filters + availability

POST
/projects/{projectId}/grounding/query
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/problem+json

curl -X POST "https://loading/api/v1/projects/string/grounding/query" \  -H "Content-Type: application/json" \  -d '{}'
{
  "$schema": "/api/v1/schemas/QueryResponse.json",
  "as_of": "2019-08-24T14:15:22Z",
  "freshness": {
    "is_demo": true,
    "item_count": 0,
    "last_verified_at": "2019-08-24T14:15:22Z",
    "source_id": "string",
    "source_label": "string",
    "stale_after": "2019-08-24T14:15:22Z",
    "status": "string"
  },
  "items": [
    {
      "$schema": "/api/v1/schemas/ResultItem.json",
      "availability": {
        "as_of": "2019-08-24T14:15:22Z",
        "next_open_slots": [
          "2019-08-24T14:15:22Z"
        ],
        "status": "string"
      },
      "item": {
        "attributes": {
          "property1": null,
          "property2": null
        },
        "currency": "string",
        "description": "string",
        "external_ref": "string",
        "is_demo": true,
        "item_id": "string",
        "item_type": "string",
        "name": "string",
        "price": 0.1,
        "price_unit": "string",
        "price_updated_at": "2019-08-24T14:15:22Z",
        "status": "string",
        "updated_at": "2019-08-24T14:15:22Z"
      },
      "kb_snippets": [
        "string"
      ]
    }
  ],
  "knowledge": [
    {
      "content": "string",
      "label": "string",
      "node_id": "string",
      "score": 0.1
    }
  ],
  "retrieved_at": "2019-08-24T14:15:22Z"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List the active release's browser-safe structured catalog

GET
/projects/{projectId}/runtime-catalog/items
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

Query Parameters

limit?integer
Formatint64
Range1 <= value <= 100
offset?integer
Formatint64
Range0 <= value
q?string

Bounded search over published record fields

Lengthlength <= 160
filters?string

JSON object of published filter key/value pairs

Lengthlength <= 4096

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/runtime-catalog/items"
{
  "$schema": "/api/v1/schemas/RuntimeCatalogListResponse.json",
  "as_of": "2019-08-24T14:15:22Z",
  "facets": [
    {
      "key": "string",
      "label": "string",
      "options": [
        {
          "count": 0,
          "label": "string",
          "value": "string"
        }
      ],
      "truncated": true
    }
  ],
  "freshness": {
    "is_demo": true,
    "item_count": 0,
    "last_verified_at": "2019-08-24T14:15:22Z",
    "source_id": "string",
    "source_label": "string",
    "stale_after": "2019-08-24T14:15:22Z",
    "status": "string"
  },
  "items": [
    {
      "attributes": {
        "property1": null,
        "property2": null
      },
      "currency": "string",
      "description": "string",
      "external_ref": "string",
      "is_demo": true,
      "item_id": "string",
      "item_type": "string",
      "name": "string",
      "price": 0.1,
      "price_unit": "string",
      "price_updated_at": "2019-08-24T14:15:22Z",
      "status": "string",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "limit": 0,
  "next_offset": 0,
  "offset": 0,
  "retrieved_at": "2019-08-24T14:15:22Z",
  "total": 0
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

Get a browser-safe item from the active structured catalog

GET
/projects/{projectId}/runtime-catalog/items/{itemId}
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

itemId*string

Catalog item UUID

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/runtime-catalog/items/string"
{
  "$schema": "/api/v1/schemas/RuntimeCatalogDetailResponse.json",
  "availability": {
    "as_of": "2019-08-24T14:15:22Z",
    "next_open_slots": [
      "2019-08-24T14:15:22Z"
    ],
    "status": "string"
  },
  "freshness": {
    "is_demo": true,
    "item_count": 0,
    "last_verified_at": "2019-08-24T14:15:22Z",
    "source_id": "string",
    "source_label": "string",
    "stale_after": "2019-08-24T14:15:22Z",
    "status": "string"
  },
  "item": {
    "attributes": {
      "property1": null,
      "property2": null
    },
    "currency": "string",
    "description": "string",
    "external_ref": "string",
    "is_demo": true,
    "item_id": "string",
    "item_type": "string",
    "name": "string",
    "price": 0.1,
    "price_unit": "string",
    "price_updated_at": "2019-08-24T14:15:22Z",
    "status": "string",
    "updated_at": "2019-08-24T14:15:22Z"
  },
  "retrieved_at": "2019-08-24T14:15:22Z"
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}

List browser-safe slots for a published structured catalog item

GET
/projects/{projectId}/runtime-catalog/items/{itemId}/slots
AuthorizationBearer <token>

API key issued to a Sonzai project. Format: Bearer sk_....

In: header

Path Parameters

projectId*string

Project UUID

itemId*string

Catalog item UUID

Query Parameters

from?string

RFC3339 or YYYY-MM-DD

to?string

RFC3339 or YYYY-MM-DD

Response Body

application/json

application/problem+json

curl -X GET "https://loading/api/v1/projects/string/runtime-catalog/items/string/slots"
{
  "$schema": "/api/v1/schemas/RuntimeCatalogSlotsResponse.json",
  "as_of": "2019-08-24T14:15:22Z",
  "freshness": {
    "is_demo": true,
    "item_count": 0,
    "last_verified_at": "2019-08-24T14:15:22Z",
    "source_id": "string",
    "source_label": "string",
    "stale_after": "2019-08-24T14:15:22Z",
    "status": "string"
  },
  "retrieved_at": "2019-08-24T14:15:22Z",
  "slots": [
    {
      "booked_count": 0,
      "capacity": 0,
      "ends_at": "2019-08-24T14:15:22Z",
      "item_id": "string",
      "slot_id": "string",
      "starts_at": "2019-08-24T14:15:22Z",
      "status": "string"
    }
  ]
}
{
  "$schema": "/api/v1/schemas/ErrorModel.json",
  "detail": "Property foo is required but is missing.",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com/error-log/abc123",
  "status": 400,
  "title": "Bad Request",
  "type": "https://example.com/errors/example"
}