Skip to main content
The REST API lets your backend integrate directly with Zelinqa. The SDKs and MCP server use the same API. Your backend keeps the identifiers returned by Zelinqa and calls the engine whenever your experience needs a new question.

Responsibilities

  1. Create a session once with POST /v1/sessions.
  2. Call /next with the latest state_version.
  3. Use candidates[0], or select another candidate if your product requires it.
  4. After the answer, call /next again with previous_turn.
  5. Send external information through /events. Its response carries the pending decision recomputed on the updated state: when it has changed, ask its question instead of the earlier one.
  6. Submit the final outcome through /feedback.
If your backend restarts, read the session with GET /v1/sessions/{session_id}. Do not rebuild state from a stale local copy.

Choice answers

When your interface displays choices provided by Zelinqa, return their choice_id values in structured_answer.choice_ids. This avoids unnecessary semantic interpretation and preserves deterministic mapping.

Prefer structured answers

When your application already knows what an answer means, send that interpretation directly:
  • previous_turn.outcome reports whether the question was answered, left unanswered, or explicitly refused;
  • structured_answer.choice_ids sends selections from a closed or semi-open question;
  • client_updates.data sends business data already validated by your system.
The confirmed client_updates value is applied as structured data. Here the question is open: even with a confirmed data value, the person’s actual answer in user_text is required and may be analyzed by the engine. For a closed or semi-open question, choice_ids alone suffice when the person adds no text; that path may avoid model analysis. Never invent an uncertain value.
outcome describes the result of the question, but does not replace user_text for an answered open question or create business data by itself. Also send structured_answer or client_updates when your system knows the information obtained.

HTTP calls with curl

Follow the complete curl example.

API reference

Explore routes, schemas, and response codes.
Call Zelinqa from your backend. Never expose a key in browser JavaScript or a mobile bundle.