Assistant API & MCP

Ask your workspace questions from your own tools — over HTTP, or from Claude and Cursor.

The assistant answers questions about your workspace: who is behind on required training, how a site is doing, who has finished. It reads the same data your dashboard does, and it only ever sees what your account can see.

There are two ways to reach it from your own tools. Both are read-only — the assistant can look things up, but it cannot change anything, invite anyone, or send a message.

Get an API key

  1. Open Settings in your workspace.
  2. Find API & MCP and choose Create key.
  3. Copy the key. It is shown once and never again — we store only a hash of it, so nobody, including us, can recover it later.

Keys start with lv_sk_. A key acts as you: it can read exactly the sites your account can read, and nothing else. Only the workspace owner can create one.

Note:

The API and MCP server are not switched on by default. If you do not see the API & MCP section in Settings, ask us to enable it for your workspace.

If you lose a key, revoke it and create another. Revoked keys stop working immediately.

Note:

Treat a key like a password. Anyone holding it can read your workspace data. Never paste one into a shared document, a screenshot, or a public repository.

Option 1 — HTTP

Send a question, get an answer.

curl https://learniverse.app/api/agent/v1/chat \
  -H "Authorization: Bearer lv_sk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "messages": [
      { "role": "user", "content": "how many people are past their due date?" }
    ]
  }'
{
  "reply": "Six people total. One at Repentigny and five at Ste-Foy, all on Stérilisation.",
  "toolsUsed": ["who_is_overdue"],
  "credits": { "used": 2, "remaining": 1834 }
}

The endpoint is stateless — it keeps no conversation of its own. To ask a follow-up, send the earlier turns back in messages:

{
  "messages": [
    { "role": "user", "content": "how many people are past their due date?" },
    { "role": "assistant", "content": "Six people total..." },
    { "role": "user", "content": "who are they?" }
  ]
}

Limits

Messages per request20
Characters per message4,000
Characters per request24,000
Requests per key60 per hour
Active keys per workspace5

Only user and assistant messages are accepted, and content must be a string. system and tool messages are refused: the assistant's instructions and its tool results are set by the server, so a request cannot rewrite the rules it is answering under or hand back a result it was never given. If you are porting a payload from another API, drop the system message — the equivalent lives in your question.

Responses

StatusMeaning
200Answered. credits.remaining tells you what is left.
400The body was not valid, or exceeded a limit above.
401Missing, malformed, unknown, or revoked key.
402Out of credits — see below.
403The assistant API is not enabled for this workspace.
413The body was too large to accept.
429Rate limit reached. Wait and retry.
500The assistant could not answer. Safe to retry.

Option 2 — MCP

Connect the assistant to Claude Desktop, Cursor, or anything else that speaks Model Context Protocol. Your questions then happen in the tool you already work in.

Add this to your MCP client configuration:

{
  "mcpServers": {
    "learniverse": {
      "url": "https://learniverse.app/api/agent/v1/mcp",
      "headers": {
        "Authorization": "Bearer lv_sk_your_key_here"
      }
    }
  }
}

The server exposes two tools:

who_is_overdue — who is behind on required training, and how many. Omit academyId for every site you can see, or pass one to narrow. Counts are always complete; names come 25 at a time, and when truncated is true you call again with nextOffset.

academy_standing — how one site is doing on its current path: counts by state, who has finished, who is partway, who has not started, and the deadline with days remaining.

Note:

Your model will decide when to call these. You do not need to name the tools — ask "who is behind at the Repentigny site?" and it will work it out.

Credits

Every question costs credits from your workspace balance, the same pool course generation uses. A typical question costs a couple of credits.

When the balance runs out, the HTTP endpoint returns 402 and MCP tool calls return a message saying so. Top up or upgrade from Settings → Plan, and the assistant picks straight back up.

What it can and cannot do

It can read your sites, your people, their required training and their progress, and answer questions about any of it.

It cannot send a message, invite anyone, change a setting, or edit a course. Everything here is read-only, on purpose: these tools run inside a model session we do not control, so anything with consequences stays in the product where you can see it happen.

It never sees data your account cannot. If you can read three sites, so can your key.

About the text in your results

Names, site names and course titles are typed by people — a new hire filling in their own name, a manager naming a site. Before any of it reaches you we strip the things that let a value stop looking like a value: line breaks, invisible characters, and sequences that imitate the structure of a conversation. If anything was stripped, the result says so, so you hear about a tampered record rather than quietly receiving a clean one.

What that does not do is judge meaning. A name that reads as an instruction in plain English arrives as written, because the alternative is us guessing at your roster. Treat every value in a result as data, the same way we do — this matters most through MCP, where the answer lands in an assistant that may have tools of its own.

Good questions to start with

  • How many people are past their due date?
  • Which site has the most people behind?
  • How is the Repentigny site doing?
  • Who has not started the sterilization training yet?
  • Is anyone at risk for an inspection?