Reply to a shopper as the store
Authorizations
A secret API key. Publishable keys cannot reach this API. A key may carry an expiry, and an expired key is refused exactly like an unknown one, with a 401 that names no reason; check the key's expires_at in the dashboard rather than inferring it from a response. When a merchant rolls a key's secret they choose a grace window of up to 3 days, and for its duration BOTH the new secret and the one it replaced authenticate, so an integration moves over on its own deploy schedule instead of at the instant the button is pressed. Move before the window closes: after it, the old secret is refused. Nothing else about this contract moves with a roll. The key keeps its id and its scopes, so the only thing an integration updates is the credential itself.
Headers
A unique key per logical write. Replaying a request with the same key returns the first response byte for byte instead of applying the write twice.
Path Parameters
Body
THIS REACHES A REAL PERSON. A website conversation's reply is polled by the storefront widget; a WhatsApp or Instagram one is pushed to the shopper on that platform. Send an Idempotency-Key and mean it: a duplicate is visible in somebody's phone. IT DOES NOT TAKE THE CONVERSATION OVER. Posting while the assistant is still answering is legal and is sometimes what a merchant wants, so nothing here flips handoff_state. Set it with the PUT above first if you mean the assistant to stop. role is refused by name. A staff reply is always stored in the assistant slot so the shopper's widget renders it as a message from the store, and writing a user turn would put words in the shopper's mouth inside the merchant's own record.
The message text. Required and refused when blank: an empty reply is delivered to the shopper as an empty message rather than ignored.
The teammate this reply is from, by store user id, or null for an unattributed one. Optional, and null is the honest default for an automation: an api key is not a person. Name a real author when you are relaying one, because a shopper's star rating attributes to whoever is named here, and attributing a human's answer to the assistant folds it into the assistant's average. The id is checked against this store's roster.
Response
Created
