Inventory
Query user inventory
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
User ID
Query Parameters
Optional instance ID for user scoping
Query mode: list, value, or aggregate
"list"Filter by item type
Free-text search filter
KB project scope for value/aggregate modes
Comma-separated aggregation expressions (for aggregate mode)
Group-by field for aggregations
Max items per page (default 1000, max 5000)
1000int64Pagination offset
0int64Base64-encoded pagination cursor
JSON-encoded metadata filters
Sort by metadata field
Sort order: asc or desc
"asc"Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/agents/string/users/string/inventory"{
"$schema": "/api/v1/schemas/InventoryReadResponse.json",
"groups": [
{
"group": "string",
"values": {
"property1": null,
"property2": null
}
}
],
"items": [
{
"fact_id": "string",
"gain_loss": 0.1,
"inventory_item_id": "string",
"item_label": "string",
"kb_node_id": "string",
"market_properties": {
"property1": null,
"property2": null
},
"user_properties": {
"property1": null,
"property2": null
}
}
],
"next_cursor": "string",
"total_items": 0,
"totals": {
"property1": null,
"property2": null
}
}{
"$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"
}Add, update, or remove an inventory item
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
User ID
Query Parameters
Optional instance ID for user scoping
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/agents/string/users/string/inventory" \ -H "Content-Type: application/json" \ -d '{ "action": "string", "item_type": "string" }'{
"$schema": "/api/v1/schemas/InventoryWriteResponse.json",
"candidates": [
{
"kb_node_id": "string",
"label": "string",
"properties": {
"property1": null,
"property2": null
}
}
],
"error": "string",
"fact_id": "string",
"inventory_item_id": "string",
"kb_resolution": {
"kb_label": "string",
"kb_node_id": "string",
"kb_properties": {
"property1": null,
"property2": null
},
"resolved": true
},
"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"
}Batch import inventory items
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
User ID
Query Parameters
Optional instance ID for user scoping
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/agents/string/users/string/inventory/batch" \ -H "Content-Type: application/json" \ -d '{ "items": [ { "item_type": "string" } ] }'{
"$schema": "/api/v1/schemas/BatchInventoryResponse.json",
"added": 0,
"error": "string",
"failed": 0,
"status": "string",
"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"
}Create an inventory item (dedicated add endpoint)
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
User ID
Query Parameters
Optional instance ID for user scoping
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/agents/string/users/string/inventory/items" \ -H "Content-Type: application/json" \ -d '{ "item_type": "string" }'{
"$schema": "/api/v1/schemas/InventoryWriteResponse.json",
"candidates": [
{
"kb_node_id": "string",
"label": "string",
"properties": {
"property1": null,
"property2": null
}
}
],
"error": "string",
"fact_id": "string",
"inventory_item_id": "string",
"kb_resolution": {
"kb_label": "string",
"kb_node_id": "string",
"kb_properties": {
"property1": null,
"property2": null
},
"resolved": true
},
"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"
}Delete a specific inventory fact
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
User ID
Inventory fact UUID
Query Parameters
Optional instance ID for user scoping
Response Body
application/json
application/problem+json
curl -X DELETE "https://loading/api/v1/agents/string/users/string/inventory/string"{
"$schema": "/api/v1/schemas/DirectUpdateResponse.json",
"error": "string",
"fact_id": "string",
"inventory_item_id": "string",
"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"
}Update a specific inventory fact
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
User ID
Inventory fact UUID
Query Parameters
Optional instance ID for user scoping
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X PUT "https://loading/api/v1/agents/string/users/string/inventory/string" \ -H "Content-Type: application/json" \ -d '{ "properties": { "property1": null, "property2": null } }'{
"$schema": "/api/v1/schemas/DirectUpdateResponse.json",
"error": "string",
"fact_id": "string",
"inventory_item_id": "string",
"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"
}