New — Sohay now answers WooCommerce product, policy & cart questions. See how →

The REST API surface

Four route groups under one namespace, each gated on a capability — and how to see the real list on your own site.

Everything Sohay exposes lives under the sohaychat/v1 namespace.

The route groups

Base Purpose Reachable by
conversations The public chat surface Visitors, including anonymous
admin The Conversations inbox Capability-gated
kb/sync Knowledge Base syncing sohaychat_manage_kb
kb/training-data Knowledge Base management sohaychat_manage_kb

Plus an auth route that mints short-lived guest tokens, with its own rate limit tuned separately from chat throughput.

Knowledge Base articles are not in that list. They are a normal custom post type with REST enabled, so they are at wp/v2/sohaychat_kb along with every other post type.

Seeing the real list

Rather than trusting a table in an article, ask your own site:

wp rest namespace list

Or fetch the namespace index at /wp-json/sohaychat/v1 in a browser, which returns every registered route with its methods and arguments. That is authoritative for the version you are actually running.

Authentication and capabilities

The public chat routes accept anonymous visitors — that is the point; your site’s visitors are not logged in. They are protected by nonces, guest tokens, and rate limiting rather than by authentication.

Everything else is capability-gated, using the same five capabilities that gate the admin screens. There is no separate API permission model to learn: if somebody can reach the Conversations screen, they can reach the conversations routes, and not otherwise.

The rate limits are worth knowing about before you script against these. See Daily token caps and rate limits — a script that ignores them looks exactly like abuse.

The chat route streams

The main chat route returns Server-Sent Events, not JSON. A client that waits for a complete response body will wait for the whole answer and lose the streaming entirely.

If it arrives truncated or all-at-once, that is usually buffering somewhere in front of your server rather than the endpoint. See Answers cut off behind a CDN or proxy.

Payload caps

Request and response sizes are capped, and the caps are filterable. They exist so an oversized payload fails cleanly rather than exhausting memory. If you are sending something legitimately large, raise the cap deliberately rather than working around the error.

A note on stability

Hook names are public API and do not change between releases. REST routes have not been given that promise in the same terms — the namespace is versioned for a reason.

For anything long-lived, prefer the hooks. They are the supported extension surface; the routes exist to serve Sohay’s own interfaces.

Where to go next

Capabilities and the implies graph for what gates what.

Mithun B.
Mithun B.

More articles by Mithun B..

View all posts

Give your website an assistant that answers from your content

Grounded answers, a team inbox, and store-aware tools — free on WordPress.org.

Add Sohay — Free

Free plugin · You bring your OpenAI key · Works with any theme