Server endpoints
Call these from your server only. A secret key never belongs in page source.
POST /catalog/sync
Section titled “POST /catalog/sync”Sync products. Idempotent by SKU.
Request body
Section titled “Request body”| Field | Type | Required | Notes |
|---|---|---|---|
products |
array of object | yes | min items 1, max items 1000 |
JSON Schema
{ "type": "object", "properties": { "products": { "minItems": 1, "maxItems": 1000, "type": "array", "items": { "type": "object", "properties": { "sku": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "\\S" }, "name": { "type": "string", "minLength": 1, "maxLength": 300, "pattern": "\\S" }, "category": { "anyOf": [ { "type": "string", "enum": [ "flower", "pre_roll", "vape", "edible", "tincture", "topical", "concentrate", "capsule", "beverage" ] }, { "type": "string", "enum": [ "supplement", "food", "beverage", "topical" ] } ] }, "description": { "type": "string", "maxLength": 20000 }, "url": { "type": "string", "maxLength": 2048, "pattern": "^https:\\/\\/\\S+$" }, "image_url": { "type": "string", "maxLength": 2048, "pattern": "^https:\\/\\/\\S+$" }, "external_id": { "type": "string", "minLength": 1, "maxLength": 256 } }, "required": [ "sku", "name", "category" ], "additionalProperties": false } } }, "required": [ "products" ], "additionalProperties": false}Response
Section titled “Response”| Field | Type | Required | Notes |
|---|---|---|---|
request_id |
string | yes | min length 1, max length 128 |
received |
integer | yes | min 0, max 9007199254740991 |
created |
integer | yes | min 0, max 9007199254740991 |
updated |
integer | yes | min 0, max 9007199254740991 |
unchanged |
integer | yes | min 0, max 9007199254740991 |
JSON Schema
{ "type": "object", "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "received": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "created": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "updated": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "unchanged": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "request_id", "received", "created", "updated", "unchanged" ], "additionalProperties": false}GET /usage
Section titled “GET /usage”Daily conversation counts for a date range.
Query parameters
Section titled “Query parameters”| Field | Type | Required | Notes |
|---|---|---|---|
from |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
to |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
JSON Schema
{ "type": "object", "properties": { "from": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "to": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" } }, "required": [ "from", "to" ], "additionalProperties": false}Response
Section titled “Response”| Field | Type | Required | Notes |
|---|---|---|---|
request_id |
string | yes | min length 1, max length 128 |
from |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
to |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
days |
array of object | yes |
JSON Schema
{ "type": "object", "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "from": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "to": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "days": { "type": "array", "items": { "type": "object", "properties": { "day": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "billable_conversations": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "floor0_sessions": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "test_sessions": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 } }, "required": [ "day", "billable_conversations", "floor0_sessions", "test_sessions" ], "additionalProperties": false } } }, "required": [ "request_id", "from", "to", "days" ], "additionalProperties": false}GET /audit/digests
Section titled “GET /audit/digests”Audit digests for a date range.
Query parameters
Section titled “Query parameters”| Field | Type | Required | Notes |
|---|---|---|---|
from |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
to |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
JSON Schema
{ "type": "object", "properties": { "from": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "to": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" } }, "required": [ "from", "to" ], "additionalProperties": false}Response
Section titled “Response”| Field | Type | Required | Notes |
|---|---|---|---|
request_id |
string | yes | min length 1, max length 128 |
digests |
array of object | yes |
JSON Schema
{ "type": "object", "properties": { "request_id": { "type": "string", "minLength": 1, "maxLength": 128 }, "digests": { "type": "array", "items": { "type": "object", "properties": { "day": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "merkle_root": { "type": "string", "pattern": "^[0-9a-f]{64}$" }, "leaf_count": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }, "global_root": { "anyOf": [ { "type": "string", "pattern": "^[0-9a-f]{64}$" }, { "type": "null" } ] }, "commit_sha": { "anyOf": [ { "type": "string", "pattern": "^([0-9a-f]{40}|[0-9a-f]{64})$" }, { "type": "null" } ] }, "published_at": { "anyOf": [ { "type": "string", "format": "date-time", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$" }, { "type": "null" } ] } }, "required": [ "day", "merkle_root", "leaf_count", "global_root", "commit_sha", "published_at" ], "additionalProperties": false } } }, "required": [ "request_id", "digests" ], "additionalProperties": false}POST /audit/export
Section titled “POST /audit/export”Start an audit export job for a date range.
Request body
Section titled “Request body”| Field | Type | Required | Notes |
|---|---|---|---|
from |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
to |
string (date) | yes | pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$ |
JSON Schema
{ "type": "object", "properties": { "from": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" }, "to": { "type": "string", "format": "date", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$" } }, "required": [ "from", "to" ], "additionalProperties": false}Response
Section titled “Response”Returns a job id. Poll GET /audit/export/:id for the result.