Kinellect
Integration guide · API v1 · Connector contract v1

Introduction

Kinellect is a coaching service for fitness and rehabilitation products. Your application keeps its users, content, subscriptions and user interface. Kinellect adds a coach on top: it holds conversations with your users, builds validated workout drafts from your exercise catalog, decides what a user should do today (workout, rest or mobility), reacts to completed workouts, and remembers coaching preferences.

Kinellect is generic. It contains no knowledge of any particular client. Everything specific to your product arrives through your configuration, the context you send about each user, and the connector endpoints you implement.

The two directions of integration

Integrating means building two things:

  1. Calls from your backend to the Kinellect API. You activate a configuration, register users, send their context, start conversations, and request workouts and daily plans.
  2. A connector that Kinellect calls. A small HTTPS service on your side that answers questions about your content and a user's current situation, and performs actions you allow, such as saving a workout. Without a server, you can upload your exercise catalog instead, with fewer features.
flowchart LR
  subgraph You["Your platform"]
    App["Your app / backend"]
    Conn["Your connector (HTTPS)"]
    DB[("Your users, catalog,<br/>schedules, history")]
  end
  subgraph K["Kinellect"]
    API["Kinellect API /v1"]
    W["Durable workers"]
  end
  App -- "Bearer API token" --> API
  API --> W
  W -- "Bearer connector secret" --> Conn
  Conn --> DB

Your backend calls Kinellect with an API token that Kinellect issues to you. Kinellect calls your connector with a connector secret that you issue to Kinellect. The two credentials are independent.

Who owns what

Kinellect owns You own
Coaching conversations and their history User identity, accounts and authentication
Coach memory (what the coach remembers about each user) Subscriptions, entitlements and billing
Workout drafts it generates and daily decisions Your exercise and workout catalog
Safety validation of everything it proposes Accepted workouts, schedules and workout history
Durable processing, retries and usage accounting Your user interface and notifications

Kinellect never writes to your systems directly. When a user accepts a workout, Kinellect asks your connector to save it, and your connector decides.

Important properties

  • Asynchronous by design. Anything that involves a model or your connector runs as a durable Operation. You receive 202 Accepted with an Operation reference and poll it to a terminal state. There are no webhooks in v1.
  • Idempotent writes. Every write takes an Idempotency-Key. Retrying the same request with the same key is always safe and returns the original result.
  • Strict contracts. Unknown fields are rejected, and so are values outside documented limits. Connector responses must contain exactly the documented keys.
  • Tenant isolation. Each client works inside its own tenant environment. References that belong to another tenant behave exactly like references that do not exist.
  • Truthful output. Kinellect renders user-facing text from verified sources and recorded outcomes. It never tells a user that something happened unless your connector confirmed it.

What this documentation contains

  • Onboarding walks through the steps from zero to a working integration.
  • Core concepts and API conventions cover the ideas and rules every endpoint shares.
  • Quickstart is one complete request sequence you can run with curl.
  • The capability guides cover conversation, workout drafts, daily plans, workout acceptance and workout completion.
  • Build your connector specifies what your HTTPS service must implement.
  • Using these docs with an LLM explains how to hand this material to a coding assistant.
  • The API reference holds both OpenAPI 3.1 specifications: the Kinellect API you call, and the Connector API you implement.

Onboarding

These steps take you from nothing to a working integration. Steps 1 and 3 need the Kinellect team; the rest you do yourself.

1. Receive your environment and API token

The Kinellect team creates a tenant environment for you and issues an API token. You receive:

  • the base URL of the Kinellect API, https://api.kinellect.com, used as KINELLECT_BASE_URL throughout these docs;
  • an API token. It is shown once, so store it in your secret manager immediately;
  • the scopes attached to the token (see Authentication and scopes).

Tell the team which capabilities you will use, so the token carries matching scopes. A full integration needs all eight: configuration:write, context:write, conversation:write, conversation:read, workout:write, workout:read, coaching:write and coaching:read. Each :read scope is what lets you poll that capability's Operations. Add configuration:read if you will read your stored configuration versions, for example to edit the active one or to roll back (see Client profile). Add memory:read and memory:write if you will show or delete what the coach remembers (see Coach memory).

Tokens stay valid until they are revoked, and each one can be revoked on its own. Ask for a new token rather than sharing one between systems. Kinellect cannot show a token again after issuing it; if you lose it, ask for a new one and have the old one revoked.

2. Build your connector

Build the HTTPS service described in Build your connector. Implement only the endpoints for the capabilities you plan to enable. For example, a conversation-only integration with exercise lookups needs capabilities, context/resolve, content/exercises/search and content/exercises/resolve.

Your connector must be reachable over public HTTPS before step 4, because activation calls it.

If you don't run a server, you can upload your exercise catalog instead. Kinellect then serves exercise search and lookup itself. Kinellect also confirms saves itself (workout.save), and your app stores the saved workout. Other capabilities that act on your side, or read your workouts or user context, are not available.

3. Register your connector with Kinellect

Send the Kinellect team:

  • your connector base URL (HTTPS);
  • a connector secret: a long random bearer token that Kinellect will send in Authorization: Bearer ... on every connector call. Share it through a secure channel, never by email.

Kinellect stores the secret in its managed secret store and returns a connector registration reference (connector_registration_ref, a UUID). You cannot change the URL or secret through the API; ask the Kinellect team to register a new one when they change.

With an uploaded catalog, ask instead for an uploaded-catalog registration. You send no URL or secret, and you receive a connector_registration_ref in the same way.

4. Activate your first client configuration

Decide which capabilities to enable and which policies apply, then call:

PUT /v1/client-configurations/1/activate

Activation checks your choices, calls your connector's capabilities endpoint (with an uploaded-catalog registration, Kinellect answers this check itself), and stores configuration version 1 as immutable. With an uploaded catalog, upload it first: until a catalog exists, activation answers 422 exercise_catalog_not_uploaded. To change anything later, activate version 2, then 3, and so on. See Client configuration for the fields and Client profile for reading, checking and rolling back versions.

5. Register each user

Kinellect calls your users Subjects. You register a user by creating their first Conversation Thread with your own user identifier:

POST /v1/threads
{"external_subject_ref": "your-user-8841", "main": true}

The response contains subject_ref, Kinellect's UUID for that user. Store the mapping from your user id to subject_ref:

  • every other endpoint identifies the user by subject_ref;
  • your connector receives subject_ref, not your user id.

Repeating the call with the same external_subject_ref always yields the same subject_ref.

external_subject_ref is visible only to Kinellect and your integration. Use an opaque, stable identifier, not an email address or name.

6. Keep each user's context current

Send the facts Kinellect needs about the user (goal, experience, available days, equipment, safety constraints, recovery) as an immutable, versioned Subject context. Push it with PUT /v1/subjects/{subject_ref}/context/{context_version} whenever those facts change. You can also let Kinellect pull it from your connector's context/resolve endpoint. See Subject context.

7. Use the capabilities

With configuration and context in place you can:

Go-live checklist

  • The API token lives in a secret manager and is never shipped to mobile or web clients. All Kinellect calls come from your backend.
  • Every write sends a fresh Idempotency-Key, and retries reuse the original key.
  • Your code handles every Operation state: completed, failed, cancelled and expired.
  • You honour 429 and its Retry-After header.
  • Your connector returns exactly the documented keys and answers within 2 seconds.
  • Your connector verifies the bearer secret and the X-Kinellect-Tenant header on every call.
  • You store the mapping between your user ids and subject_ref.
  • Context is pushed, or resolvable through the connector, before you request daily plans or workout drafts.

Core concepts

Tenant environment

A tenant environment is your isolated space in Kinellect. Your API token, connector registration, configurations, users, conversations and Operations all belong to it. Nothing crosses between tenant environments. A reference from another tenant behaves exactly like one that does not exist, so it returns 404.

Client configuration

A client configuration describes how Kinellect coaches for your product: who you are, which capabilities are on, which actions are allowed, and the limits that apply. Each configuration version is immutable. You activate version 1, then 2, and so on. The newest activated version is current. Client profile covers how to read, check, change and roll back versions.

Each Operation records the configuration version it was admitted under, and results report the versions they used. For example, a daily plan decision includes configuration_version and context_version. Some work rechecks currentness before acting: workout acceptance, for instance, verifies again that the configuration and context still allow the action before your connector is called.

Field Purpose
client_description, product_description Plain-language description of your company and product, used to frame coaching (up to 2000 bytes each).
coaching_domain Short domain label, for example fitness coaching or knee rehabilitation.
tone supportive, direct or neutral. Sets the coach's voice in conversation replies (see Coach voice).
terminology Up to 20 terms your product uses, for example session instead of workout.
enabled_capabilities What Kinellect may do (see the table below).
safety_policy Currently always fitness_coach_safety_v1.
action_policy Whether Kinellect may execute actions (see Action policy).
connector_registration_ref The registration you received during onboarding.
workout_generation_policy Structural limits for generated workouts. Required when workout.generate is enabled.
daily_decision_policy Rules for daily plans. Required exactly when daily.decide is enabled.
operation_admission_policies Request-rate and concurrency limits per capability.
operation_usage_policies Token and estimated-cost ceilings per capability.
coaching_profile Optional. Who the coach refers users to, topics it should not discuss, and up to 10 short guidance lines (see Coaching profile).

Capabilities

Capabilities switch features on. Some need your connector, and those must also appear in your connector's capabilities response or activation fails. With an uploaded exercise catalog, Kinellect itself provides exercise.search, exercise.resolve, both prescription types and workout.save, and every other capability marked "Yes" is unavailable.

Capability What it enables Needs your connector
conversation.respond Coaching conversations. No
context.resolve Kinellect may pull a user's context from you when none is current. Yes
exercise.search Search your exercise catalog. Yes
exercise.resolve Look up exercises by reference and verify them. Yes
workout.search Find existing workouts in your catalog. Yes
workout.resolve Load and verify an existing workout. Yes
workout.prescription.count Repetition-based prescriptions (for example 3 sets of 10). Yes
workout.prescription.time Time-based prescriptions (for example 3 sets of 30 seconds). Yes
workout.generate Generate workout drafts. No, but requires the bundle below
workout.warmup.generate Add warm-up sections to generated workouts. No, requires workout.generate
workout.cooldown.generate Add cool-down sections to generated workouts. No, requires workout.generate
daily.decide Daily plans: workout, rest or mobility. Depends on the daily policy
daily.coach_note A short coach-written note on each daily plan, saying why today is this kind of day. Needs daily.decide. See Coach note. No
daily.mobility_session On a mobility day, a generated mobility session. Needs daily.decide, a daily policy that enables mobility, and a workout source policy that generates. See Mobility sessions. No
workout.save Save an accepted workout to the user's library. Yes
workout.save_and_schedule Save and schedule an accepted workout atomically. Yes
workout.save_and_replace Save an accepted workout in place of the workout scheduled on a day. With workout.change under auto_execute, it lets the coach change today's workout in chat. See Changing today's workout in chat. Yes
preference.propose The coach may propose a preference change. No
preference.update The coach may update a preference in your system. Yes
schedule.move In chat, the coach may move today's workout to tomorrow when the user asks. See Schedule changes in chat. Yes
schedule.cancel In chat, the coach may cancel today's workout and make today a rest day when the user asks. Yes
profile.goal.update In chat, the coach may change the user's goal in your system when the user asks. See Profile changes in chat. Yes
profile.note.add In chat, the coach may add a note to the user's notes in your system when the user asks. Yes
profile.sessions_per_week.update In chat, the coach may change how many sessions a week the user plans to train when the user asks. Yes
exercise_limitation.write In chat, the coach may record that the user wants to avoid a specific exercise, and lift that limit again. Needs exercise.search. See Exercise limits set in chat. No
daily_plan.read In chat, the coach may read today's daily plan that Kinellect stored for the user. Needs daily.decide. See Plans and workout history in chat. No
training_history.read In chat, the coach may read the user's recent completed workouts, one workout in detail (with exercise.resolve) and their progress on one exercise. No
workout.change In chat, the coach may change the workout the user has now (harder, easier, shorter or longer), which you send as current_workout with the Turn, or build a new one. Needs the same configuration as workouts prepared in chat. See Changing the user's workout in chat. No
memory.preference.write The coach may remember a preference the user stated explicitly (the four coaching preference slots), during the Turn or in the background. Also lets conversations read memory back. No
memory.compile Background memory for the topics beyond coaching preferences: statements from conversations and the weekly review. Also lets conversations read memory back. See Coach memory. No
goal.plan Your app sends a user's goal in their own words, the coach proposes a ladder of milestones, and the user approves it in your app. See Goals. No
goal.progress Reported workouts move the user along their active goal's ladder, and the coach may ask the user to confirm a milestone. Needs goal.plan and exercise.resolve. See Progress from reported workouts. No
workout.review After each finished workout, the coach decides whether the next session your app planned stays as it is or changes, with a one-line reason and a changed workout the user can save. Needs workout.generate and its generation policy. See Review after a workout. Yes, unless you use an uploaded exercise catalog
week.plan Your app asks the coach to plan the open days of the user's week as training, mobility or rest days, with minutes for each session and a reason for each day. Today's daily plan follows it, and your app can move, resize or skip future days. Needs daily.decide. See Week plan. No

Activation rejects incomplete combinations with 422:

  • Existing workouts: workout.search or workout.resolve requires workout.search, workout.resolve, exercise.resolve and at least one prescription type.
  • Generated workouts: workout.generate requires exercise.search, exercise.resolve, at least one prescription type and a workout_generation_policy. The policy's maximum_total_count_repetitions must be set exactly when count prescriptions are enabled, and maximum_total_timed_work_seconds exactly when time prescriptions are enabled.
  • Warm-up and cool-down sections require workout.generate.

Action policy

action_policy controls whether Kinellect may carry out actions on your side, such as updating a preference or saving a workout:

Value Behaviour
auto_execute Actions run when requested. Workout acceptance still needs your explicit acceptance request.
confirmation_required Actions run only with explicit user approval, for example approval: "explicit_user_approval" on a workout acceptance.
professional_review_required Kinellect does not execute actions. Use this when a professional must review first.
proposal_only Kinellect may propose but never executes.
rejected No actions.

Subjects

A Subject is one of your users as Kinellect sees them. Kinellect knows only the opaque external_subject_ref you chose and the subject_ref UUID it assigned. You create a Subject implicitly with your first POST /v1/threads for that external_subject_ref. An external_subject_ref must not start with erased_v1_: Kinellect reserves that prefix and answers 422.

Deleting and reactivating a Subject

Call DELETE /v1/subjects/{subject_ref} with an Idempotency-Key when a user leaves your product. It needs the context:write scope and returns 200. Deleting:

  • places a tombstone on the Subject, which blocks accidental re-registration. The tombstone keeps the creation and deletion times and a keyed one-way digest of your external_subject_ref, not the value itself. The digest is only used to recognise the same external_subject_ref again;
  • cancels the Subject's queued and running Operations;
  • erases the Subject's coaching data in the same request: conversations, coach memory, context, workout drafts, daily plans, workout acceptances and completions, and Operations with their results. Only the minimal tombstone and the records needed to answer retried delete requests remain;
  • makes every new request about that Subject fail with 409 and detail subject_deleted. This includes new Threads for the same external_subject_ref, Turns, context updates, workout requests and completion events. Check detail rather than the status alone, because other conflicts also return 409.

Deleting an already deleted Subject also returns 200. Retrying with the same Idempotency-Key returns the original outcome. After deletion, polling one of the Subject's Operations returns 404, and retrying any earlier request for that Subject returns 409 subject_deleted.

To bring a returning user back, call POST /v1/subjects/{subject_ref}/reactivate with an Idempotency-Key. It also needs context:write and returns 200. Reactivating a Subject that is not deleted returns 422.

Erased data can remain in Kinellect's encrypted database backups until those backups expire. The backup retention period will be confirmed when the production environment is provisioned. Reactivating a Subject does not restore erased data.

Subject context

Subject context is your authoritative description of a user at a point in time: goal, experience level, available days, equipment, safety constraints, recovery and, optionally, recent activity for daily plans. Each version is immutable and has a validity window:

  • a version is current while effective_at <= now < valid_through;
  • versions for one Subject must increase, and later versions must not move backwards in time;
  • when no version is current, Kinellect asks your connector (context/resolve) if context.resolve is enabled. Otherwise, work that needs context fails with subject_context_unavailable.

Keep valid_through realistic. A window that is too long lets Kinellect coach from stale facts. A window that is too short causes avoidable connector calls or failures.

Safety constraints are free-text identifiers (for example avoid-overhead-loading) matched against the safety_identifiers your connector returns for each exercise. Exercise constraints are typed: a hard_exclusion never appears in a proposal, a soft_avoidance is avoided when an alternative exists, and a lifted constraint no longer applies.

Coaching mode

A context version can tell Kinellect that the user is new to the coach or is coming back after a long break. Add the optional coaching_mode field to the snapshot you send with PUT /v1/subjects/{subject_ref}/context/{context_version}:

coaching_mode Meaning
standard The default, also when you leave the field out.
onboarding The user is new to the coach. Generated workouts are short intro workouts.
returning The user is returning after a long break. Generated workouts are moderate welcome-back workouts.

You decide when a mode starts and ends. Kinellect never works it out from its own data or from what the user writes, and it has no trial or subscription logic. To end a mode, send a new context version with standard.

What Kinellect guarantees in a mode:

  • A generated workout, other than one the user asked for in chat with their own limit (see below) or a draft requested with target_duration_minutes (see Workout drafts), never completes with an estimated duration above 720 seconds (12 minutes) in onboarding or 1200 seconds (20 minutes) in returning, or above your own maximum if that is lower. It still passes your volume, equipment and constraint validation.
  • A daily plan that selects a workout records the mode: its reason_codes include onboarding_mode or returning_mode. That also holds when the workout is replaced by the workout_content_unavailable rest fallback. Rest and mobility decisions made for other reasons do not carry the mode code, so a missing code does not mean the mode was ignored.

What it does not guarantee: moderate intensity relative to the user's history, staying within the user's stated level, or a welcoming tone. Those are guidance to the model only.

Things to know before you send a mode:

  • The duration ceiling applies only to generated workouts. With workout_source_policy existing_only, the user keeps getting your verified library workouts with the mode reason and no length limit. With existing_preferred, Kinellect generates a workout while a mode is set.
  • In a mode, a daily plan plans a workout also on a day that is not one of the user's preferred training days. A context blocker, unavailable recovery information, rest-only or mobility-only recovery, an unavailable day, a workout already completed today, a met weekly target and disabled workouts keep their usual outcome.
  • A workout the user asks for in chat with their own limit replaces the mode default. A request for a number of minutes uses that limit instead of 12 or 20, so it can be longer. A request that only leaves out exercises has no mode duration ceiling at all.
  • Kinellect must be able to estimate durations. When your policy has no duration interval and an exercise lacks count_duration_seconds_per_repetition, generation in a mode cannot be verified (duration_unverifiable). When your minimum duration is above the mode's ceiling, generation stops before any connector or model call (duration_out_of_range). A workout draft then fails with error_code draft_validation_failed and that code in validation_codes. A daily plan does not show these codes: it completes as rest with workout_content_unavailable when your rest_fallback_codes include it, and otherwise fails with error_code workout_content_unavailable.
  • A context that Kinellect resolves through your connector carries standard until you send the mode again.
  • Changing the mode in a new context version makes a saved daily plan poll as context_changed. Nothing is regenerated on its own.

Conversation Threads and Turns

A Thread is one conversation with one Subject. Mark a user's primary conversation with main: true. You send a user message as a Turn. Kinellect answers asynchronously, and the answer arrives as the result of an Operation.

Operations

Every request that involves a model or your connector creates a durable Operation. The request returns 202 Accepted at once with an operation_ref. You poll the Operation until it reaches a terminal state.

stateDiagram-v2
  [*] --> queued
  queued --> running: a worker claims it
  queued --> cancelled: deadline passed before it ran
  running --> completed: result stored
  running --> failed: safe failure (error_code)
  completed --> expired: retention period ended
  failed --> expired
  cancelled --> expired
State Meaning What to do
queued Accepted and waiting for a worker. Keep polling.
running A worker is processing it. Keep polling.
completed Finished. result holds the outcome. Use the result.
failed Finished without a result. error_code says why. Show a safe message. Some endpoints also return fallback_text.
cancelled Stopped before it produced a result. Treat as failed.
expired The Operation outlived its retention period, so the result is gone. Do not rely on old Operations; store what you need when it completes.

Terminal results never change. Polling a completed Operation again returns the same document.

Progress stage

Chat and workout draft Operations also carry stage: a code saying what a running Operation is doing, so you can show more than a spinner. It is null while queued and once the Operation is finished.

Operation stage while running
Chat Turn (GET /v1/operations/{operation_ref}) looking_up_exercises or looking_up_workouts while the coach searches or resolves through your connector; thinking for everything else (model calls, including the one repair, other tool calls such as reads and actions, and writing the reply).
Workout draft (GET /v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}) looking_up_exercises while Kinellect searches and resolves your catalog; writing_workout while the model writes the first draft; revising_workout while it writes the one repair after the first draft was rejected. null while running before the exercise search starts, and again after a retry starts a new attempt.
  • stage is display-only. Map it to your own wording, treat a code you don't recognise like null (a generic wait), and never base app logic on it. New codes may be added.
  • The codes never carry model or user text.
  • A lookup can finish within one poll interval, so you may never see some stages.
  • It does not make anything faster.

Admission and usage limits

Each capability can carry two kinds of limit, set in the client configuration:

  • Admission policies (operation_admission_policies) limit how many Operations of a capability start within a rolling window (request_window_seconds, request maximums) and how many run at once (active maximums). A soft maximum is recorded for monitoring. A hard maximum rejects new requests with 429 when hard_enforcement_enabled is true.
  • Usage policies (operation_usage_policies) cap estimated tokens and cost, per Operation and per UTC day. Kinellect reserves an estimate before each model call, and a finished call then counts at the usage the provider reported (see Sizing usage limits). When a hard ceiling would be exceeded, Kinellect makes no model call and the Operation ends in a failed state. The exact error_code depends on the capability.

With hard_enforcement_enabled: false a policy only observes. A capability without a usage policy is observed but never capped. Ask the Kinellect team for recommended starting values.

Sizing usage limits

Before each model call Kinellect reserves an estimate: one token for every counted byte of the request, plus the largest reply the model may write. A model call that finishes in one attempt with known usage then counts at the usage the model provider reported, which is far lower; real input is about one token per 5 bytes. A call whose usage is unknown, that needed a retry, or that was interrupted keeps its whole reservation. The per-Operation and daily totals both count this way. One conversation Turn makes up to five model calls (the coach may use a tool up to three times and may be asked to correct its output once), and a Turn must fit the per-Operation maximum while its next call is reserved.

Measured peaks for one conversation Turn, with six recent Turns of history and long coach replies:

Turn Tokens at its peak
One model call about 28,000 to 44,000
Four model calls about 55,000 to 91,000
Five model calls about 63,000 to 105,000

The highest figures apply with every optional chat capability enabled. Long user messages raise them: a Thread whose recent user messages are all near the 16,000-byte maximum can need about 296,000 tokens for a five-call Turn.

  • Set operation_token_maximum for conversation.respond to at least the figure for your capabilities. "The schedule and limit actions" below means any of schedule.move, schedule.cancel and exercise_limitation.write; "the chat reads" means daily_plan.read and training_history.read.
  • Without workout.change: 80,000 with none of them; 90,000 with the schedule and limit actions and no chat read, or with daily_plan.read alone; 100,000 with training_history.read alone, with both chat reads, or one chat read together with the schedule and limit actions; 110,000 with both chat reads together with the schedule and limit actions.
  • With workout.change: 100,000 with none of them; 120,000 with training_history.read together with the schedule and limit actions; 110,000 with any other combination, including daily_plan.read alone.
  • With workout.save_and_replace under auto_execute as well: 110,000 with none of them; 130,000 with training_history.read; 120,000 otherwise.
  • With any of the profile capabilities (profile.goal.update, profile.note.add, profile.sessions_per_week.update) under auto_execute: 90,000 with no other optional chat tools, and 140,000 with every capability and all three profile capabilities, with or without goal.plan, goal.progress, workout.review, week.plan, daily.coach_note and daily.mobility_session; for any other combination, 20,000 more than the figure above for the same capabilities without a profile capability.

goal.plan, goal.progress, workout.review, week.plan, daily.coach_note and daily.mobility_session add only their names to every chat call, at most 191 tokens on a five-call Turn with all six, and they move no tier.

For Threads with very long user messages, 370,000 admits six recent 16,000-byte messages with every capability; it is not a guaranteed worst case. A higher value keeps working. Set the cost maximum to at least the token maximum times the per-token estimate price, which the Kinellect team gives you. The quickstart values assume 5 microunits per token. - Size the daily maximums from your real usage, because a finished call counts at what it used, but keep each daily maximum at least as high as that capability's per-Operation maximum (tokens and cost). Otherwise the day's first long call can be refused. Agree the values with the Kinellect team. - When a ceiling is too low, the Turn fails with error_code: provider_unavailable and the user sees the safe fallback text. From your side this looks the same as a provider outage, so check your ceilings first when chats start failing as they get longer.

API conventions

These rules apply to every endpoint of the Kinellect API.

Base URL and versioning

All paths start with /v1. The base URL for your environment is issued during onboarding. The v1 contract changes only in backward-compatible ways, such as new optional fields or new endpoints. A breaking change would ship as a new major version with a new path prefix.

Because requests reject unknown fields (see below), a new optional request field is something you opt into. Build response parsing to ignore fields you do not recognise, so that new response fields never break you.

Authentication and scopes

Send your API token on every request:

Authorization: Bearer <your API token>

A missing or invalid token returns 401. A valid token without the required scope returns 403. A valid token also gets 403, with detail: client_paused, while Kinellect has paused your integration (see When your integration is paused).

Scope Endpoints
configuration:write PUT /v1/client-configurations/{configuration_version}/activate, POST /v1/client-configurations/{configuration_version}/validate
configuration:read GET /v1/client-configurations, GET /v1/client-configurations/active, GET /v1/client-configurations/{configuration_version}
context:write PUT /v1/subjects/{subject_ref}/context/{context_version}, DELETE /v1/subjects/{subject_ref}, POST /v1/subjects/{subject_ref}/reactivate
conversation:write POST /v1/threads, POST /v1/threads/{thread_ref}/turns
conversation:read GET /v1/operations/{operation_ref}, GET /v1/subjects/{subject_ref}/threads, GET /v1/threads/{thread_ref}/turns
workout:write POST /v1/workout-drafts, POST /v1/workout-acceptances, POST /v1/events
workout:read GET /v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}, .../workout-acceptance-operations/{operation_ref}, .../workout-completion-operations/{operation_ref}
coaching:write POST /v1/daily-plans
coaching:read GET /v1/subjects/{subject_ref}/daily-plan-operations/{operation_ref}
memory:read GET /v1/subjects/{subject_ref}/memory
memory:write DELETE /v1/subjects/{subject_ref}/memory/{topic}/{slot}

Call Kinellect only from your backend. Never ship the API token to a browser or mobile app.

Requests and responses

  • Bodies are JSON (Content-Type: application/json) with snake_case field names.
  • Unknown fields are rejected with 422. Send only documented fields.
  • String limits are UTF-8 byte lengths, not character counts. A 200-byte limit fits fewer than 200 characters of non-Latin text. NUL characters are never allowed.
  • References issued by Kinellect (subject_ref, thread_ref, operation_ref and so on) are UUIDs. Treat them as opaque strings.

Idempotency

Every POST and PUT requires an Idempotency-Key header of 1 to 200 characters. A missing key returns 400.

  • Generate a new key, such as a UUID, for each distinct request.
  • Reuse the same key only to retry that exact request, for example after a timeout.
  • Same key, same request: Kinellect returns the original result and creates nothing new. Configuration activation and context writes answer 201 when new and 200 with "replayed": true on replay. Thread creation answers 201 either way. Endpoints that start an Operation answer 202 with the original Operation.
  • Same key, different request: 409 Conflict. The original is never overwritten.

Persist the key with your outgoing request before sending it, so a retry after a crash reuses it.

Asynchronous Operations

Endpoints that involve a model or your connector return 202 Accepted with an Operation document. Subject-scoped endpoints also return a Location header pointing at the Operation to poll.

Created by Poll with
POST /v1/threads/{thread_ref}/turns GET /v1/operations/{operation_ref}
POST /v1/workout-drafts GET /v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}
POST /v1/daily-plans GET /v1/subjects/{subject_ref}/daily-plan-operations/{operation_ref}
POST /v1/workout-acceptances GET /v1/subjects/{subject_ref}/workout-acceptance-operations/{operation_ref}
POST /v1/events GET /v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}

Poll with backoff: start after about 1 second, increase the delay, cap it at a few seconds, and stop at a terminal state (completed, failed, cancelled or expired). Poll responses carry Cache-Control: no-store. Polling is read-only and never re-runs work.

Some endpoints refuse to start work while related work is still active. For example, a Thread accepts a new Turn only after its previous Turn has finished. Turns, workout drafts and daily plans answer 409 in that situation. Wait for the active Operation to finish, then send a new request with a new key.

Errors

Error bodies use RFC 9457 Problem Details (application/problem+json):

{
  "type": "about:blank",
  "title": "Too Many Requests",
  "status": 429,
  "detail": "operation_request_limit_exceeded"
}
Status Meaning What to do
400 Missing or invalid Idempotency-Key. Fix the request.
401 Missing or invalid API token. Check the token. Do not retry blindly.
403 The token lacks the required scope, or, when detail is client_paused, Kinellect has paused your integration. For a missing scope, request it from Kinellect. For client_paused, stop sending requests and contact Kinellect. The pause does not revoke your token, so do not rotate it.
404 Unknown reference, or one that belongs to another tenant. The two cases are indistinguishable by design. Check the reference.
409 The user (Subject) was deleted, when detail is subject_deleted. The user already has a main Thread, when detail is main_thread_exists (only on POST /v1/threads). Otherwise an idempotency conflict, version conflict, or an Operation already active. For subject_deleted, stop sending requests for this user, or reactivate the user first. For main_thread_exists, use the thread_ref and subject_ref in the body. Otherwise do not retry with the same key; resolve the conflict.
422 Invalid or unknown field, value out of range, or a configuration or policy that does not allow the request. Fix the request.
429 An admission limit was reached. detail is operation_request_limit_exceeded or operation_concurrency_limit_exceeded. Wait Retry-After seconds (1 to 300), then retry with the same Idempotency-Key.
503 A dependency was unavailable. For example, your connector did not answer during configuration activation. Retry later with the same key.

When your integration is paused

Kinellect can pause one client's integration, for example at your request, to stop runaway cost, or during maintenance. While paused:

  • every authenticated request returns 403 with detail: client_paused. Read detail: a missing scope is also a 403, and the two need different handling;
  • this includes polling and DELETE /v1/subjects/{subject_ref}. If a user's data must be erased while you are paused, contact Kinellect so the integration can be resumed first;
  • Operations that were queued or running are cancelled. Polling them also returns 403 while paused. After Kinellect resumes your integration, they read cancelled with error_code: operation_cancelled;
  • the pause does not revoke your API tokens. Do not rotate or request new ones. A token that reaches its end date during the pause still expires and returns 401.

When Kinellect resumes your integration, the same tokens work again. Cancelled work is not restarted:

  • to redo a conversation Turn, workout draft or daily plan, send the request again with a new Idempotency-Key. Reusing the old key never restarts the work: it returns the cancelled Operation, or for a daily plan a 409 or 422 if your context, configuration or the user's local date changed during the pause;
  • a workout the coach prepared in chat has no request of yours to resend. Send a new conversation Turn asking for it again;
  • a cancelled workout acceptance does not prove that nothing was saved: it may have reached your connector before the pause. Check your own records for the workout before you send the acceptance again with a new Idempotency-Key;
  • a cancelled workout completion is final for its event_ref and activity_revision. Resending the same event, even with a new key, returns the cancelled Operation, and reusing that revision with another event_ref returns 409. To have that feedback processed, send a new event_ref for the same activity_ref with a higher activity_revision.

Failures that happen after 202 never become HTTP errors. The Operation ends in failed with a machine-readable error_code, documented per capability in the reference.

Time and dates

  • Timestamps are ISO 8601 / RFC 3339. Send UTC (Z), and expect UTC back.
  • local_date is a calendar date (YYYY-MM-DD) in the user's time zone. Impossible dates are rejected.
  • time_zone is an IANA name such as Europe/Oslo or UTC. Numeric offsets and abbreviations like CET are rejected.

Quickstart

This walkthrough activates a configuration, registers one user, stores their context, sends a message and reads the coach's reply. It assumes you finished onboarding steps 1 to 3 and have these values:

export KINELLECT_BASE_URL="https://api.kinellect.com"
export KINELLECT_TOKEN="<your API token>"                      # needs configuration:write, context:write, conversation:write, conversation:read
export CONNECTOR_REGISTRATION_REF="<connector registration UUID>"

Every write below uses uuidgen for a fresh Idempotency-Key. In your code, generate the key once per logical request and keep it for retries.

1. Activate configuration version 1

Save this as activate.json. It enables conversation, context resolution, exercise lookups and repetition-based workout generation. It also sets a request-rate limit and a daily usage ceiling for conversations.

{
  "client_description": "Northwind Physio runs outpatient physiotherapy clinics and a home-exercise app for its patients.",
  "product_description": "Patients follow home exercise programmes prescribed by their physiotherapist and log each session in the app.",
  "coaching_domain": "musculoskeletal rehabilitation",
  "tone": "supportive",
  "terminology": ["session", "programme"],
  "enabled_capabilities": [
    "conversation.respond",
    "context.resolve",
    "exercise.search",
    "exercise.resolve",
    "workout.prescription.count",
    "workout.generate",
    "memory.preference.write"
  ],
  "safety_policy": "fitness_coach_safety_v1",
  "action_policy": "confirmation_required",
  "connector_registration_ref": "3b7e1c52-9a0d-4e1f-8b6a-2f4c9d1e7a30",
  "workout_generation_policy": {
    "maximum_supersets": 4,
    "maximum_exercises_per_superset": 3,
    "maximum_total_exercises": 8,
    "minimum_rest_before_seconds": 0,
    "maximum_rest_before_seconds": 120,
    "minimum_rest_between_cycles_seconds": 30,
    "maximum_rest_between_cycles_seconds": 180,
    "maximum_total_sets": 24,
    "maximum_total_count_repetitions": 300,
    "maximum_total_timed_work_seconds": null,
    "minimum_estimated_duration_seconds": 600,
    "maximum_estimated_duration_seconds": 2700
  },
  "daily_decision_policy": null,
  "operation_admission_policies": [
    {
      "policy_version": 1,
      "capability": "conversation.respond",
      "request_window_seconds": 60,
      "soft_request_maximum": 20,
      "hard_request_maximum": 30,
      "soft_active_maximum": 5,
      "hard_active_maximum": 10,
      "hard_enforcement_enabled": true
    }
  ],
  "operation_usage_policies": [
    {
      "policy_version": 1,
      "capability": "conversation.respond",
      "operation_token_maximum": 280000,
      "operation_estimated_cost_microunits_maximum": 1400000,
      "daily_token_maximum": 50000000,
      "daily_estimated_cost_microunits_maximum": 250000000,
      "hard_enforcement_enabled": true
    }
  ]
}

Replace connector_registration_ref with your own value, then send it:

curl -sS -X PUT "$KINELLECT_BASE_URL/v1/client-configurations/1/activate" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data @activate.json

201 Created:

{
  "configuration_ref": "f0a1b2c3-d4e5-4f60-8172-8394a5b6c7d8",
  "configuration_version": 1,
  "enabled_capabilities": [
    "conversation.respond",
    "context.resolve",
    "exercise.search",
    "exercise.resolve",
    "workout.prescription.count",
    "workout.generate",
    "memory.preference.write"
  ],
  "action_policy": "confirmation_required",
  "activated_at": "2026-09-25T09:00:00Z",
  "replayed": false
}

The usage ceilings above are starting values. Estimated cost is in microunits (millionths of the price currency), so 250000000 means 250.00. A model call is admitted against an estimate made before the call and then counts at the usage the provider reported: see Sizing usage limits. Agree real values with the Kinellect team.

2. Register a user by creating their main Thread

curl -sS -X POST "$KINELLECT_BASE_URL/v1/threads" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data '{"external_subject_ref": "patient-8841", "main": true}'

201 Created. Store subject_ref against your user patient-8841. If the user already has a main Thread, the same request answers 409 with detail main_thread_exists and both refs in the body (see Conversation):

{
  "thread_ref": "0d9c8b7a-6f5e-4d3c-9b2a-1f0e9d8c7b6a",
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "main": true,
  "created_at": "2026-09-25T09:01:00Z"
}

3. Store the user's context (version 1)

Save as context.json:

{
  "effective_at": "2026-09-25T00:00:00Z",
  "valid_through": "2026-10-02T00:00:00Z",
  "time_zone": "Europe/Oslo",
  "local_date": "2026-09-25",
  "primary_goal": "Return to pain-free running after a left knee injury",
  "experience": "beginner",
  "desired_sessions_per_week": 3,
  "available_days": ["monday", "wednesday", "friday"],
  "unit_system": "metric",
  "equipment_refs": ["resistance-band", "step"],
  "safety_constraints": ["avoid-deep-knee-flexion"],
  "exercise_constraints": [
    {
      "constraint_ref": "pt-note-2026-09-20",
      "target": {"type": "exercise_ref", "value": "jump-squat"},
      "effect": "hard_exclusion",
      "state": "active"
    }
  ],
  "completed_workouts": 6,
  "mobility_summary": "Knee flexion limited to about 100 degrees",
  "recovery_summary": "Mild swelling after long walks, otherwise recovering well",
  "blocker": null
}
SUBJECT_REF="7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10"
curl -sS -X PUT "$KINELLECT_BASE_URL/v1/subjects/$SUBJECT_REF/context/1" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data @context.json

201 Created:

{
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "context_ref": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
  "context_version": 1,
  "effective_at": "2026-09-25T00:00:00Z",
  "created_at": "2026-09-25T09:02:00Z",
  "replayed": false
}

4. Send a message

THREAD_REF="0d9c8b7a-6f5e-4d3c-9b2a-1f0e9d8c7b6a"
curl -sS -X POST "$KINELLECT_BASE_URL/v1/threads/$THREAD_REF/turns" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data '{"message": "My knee felt stiff after yesterday. Should I still do my session today?"}'

202 Accepted with a queued Operation:

{
  "operation_ref": "e4d3c2b1-a09f-4e8d-9c7b-6a5f4e3d2c1b",
  "state": "queued",
  "stage": null,
  "result": null,
  "error_code": null,
  "error_message": null,
  "fallback_text": null,
  "created_at": "2026-09-25T09:03:00Z",
  "finished_at": null,
  "action_receipts": []
}

5. Poll for the reply

OPERATION_REF="e4d3c2b1-a09f-4e8d-9c7b-6a5f4e3d2c1b"
curl -sS "$KINELLECT_BASE_URL/v1/operations/$OPERATION_REF" \
  -H "Authorization: Bearer $KINELLECT_TOKEN"

Repeat with backoff until state is terminal. A completed Operation carries the coach's Turn in result:

{
  "operation_ref": "e4d3c2b1-a09f-4e8d-9c7b-6a5f4e3d2c1b",
  "state": "completed",
  "stage": null,
  "result": {
    "turn_ref": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
    "sequence": 2,
    "role": "assistant",
    "message": "Some stiffness the day after is common. Keep today's session easy and stop if it gets worse.",
    "coach_text": "Some stiffness the day after is common. Keep today's session easy and stop if it gets worse.",
    "fixed_lines": [],
    "created_at": "2026-09-25T09:03:07Z",
    "assistant_schema_version": "conversation_grounding_v1"
  },
  "error_code": null,
  "error_message": null,
  "fallback_text": null,
  "created_at": "2026-09-25T09:03:00Z",
  "finished_at": "2026-09-25T09:03:07Z",
  "action_receipts": []
}

Show result.message to the user. If the Operation failed, show fallback_text when present, otherwise your own safe message.

Next steps

Client profile

Your client profile is the client configuration you activate: who you are, which capabilities are on, your limits, and an optional coaching profile that adapts the coach to your product. You manage all of it through the API: read what is stored, check a change before it goes live, activate it as a new version, and go back to an older version.

Versions are immutable. You never edit a version in place: every change, including a rollback, is a new version with a higher number.

Task Call Scope
List versions GET /v1/client-configurations configuration:read
Read the active version GET /v1/client-configurations/active configuration:read
Read one version GET /v1/client-configurations/{configuration_version} configuration:read
Check a change POST /v1/client-configurations/{configuration_version}/validate configuration:write
Activate a version PUT /v1/client-configurations/{configuration_version}/activate configuration:write

configuration:read is a separate scope, and a token's scopes cannot change after it is issued. Ask the Kinellect team for a new token that includes it, switch to the new token, then have the old one revoked.

Coaching profile

coaching_profile is an optional object in the activation body. It has three fields, all optional.

{
  "referral_target": "physiotherapist",
  "avoided_topics": ["pain_and_symptoms"],
  "guidance_lines": [
    "Say session, not workout.",
    "Encourage users to follow the plan from their physiotherapist."
  ]
}

If you leave coaching_profile out, or send only its defaults, the coach behaves exactly as it does without a profile.

Referral target

When the coach declines an unsafe request, the user sees a fixed sentence written by Kinellect. referral_target chooses who that sentence refers the user to. It changes nothing else.

referral_target Sentence
appropriate_professional (default) I cannot safely help with that request. Please consult an appropriate professional.
physiotherapist I cannot safely help with that request. Please consult a physiotherapist.
doctor I cannot safely help with that request. Please consult a doctor.
coach I cannot safely help with that request. Please consult your coach.

Avoided topics

avoided_topics lists subjects your product does not want the coach to discuss. When a user asks about one in a conversation, the model is instructed to decline with the sentence above instead of answering. Kinellect does not filter by keywords, so this is best effort: do not rely on it as your only control for a topic you are not allowed to discuss.

Topic Use it when
nutrition_and_diet Diet advice is outside your product.
weight_and_body_composition You do not want the coach to discuss weight loss or body composition.
medication_and_supplements These questions belong to a clinician.
pain_and_symptoms Pain and symptom questions should go to the treating professional.
mental_health These questions need a professional referral.

The list is closed: you choose from these five. Each topic may appear once.

Avoided topics apply to conversations. They do not filter generated workouts or daily plans.

Guidance lines

guidance_lines are short instructions in your own words, for example about vocabulary or emphasis.

  • At most 10 lines, each at most 200 bytes of UTF-8.
  • Each line must be unique and must contain visible text.
  • No control characters, line breaks, or invisible formatting characters such as zero-width or text-direction marks.

Guidance lines are used in conversations and whenever Kinellect generates a workout, including a workout generated for a daily plan. They do not affect the rule-based daily decision itself (whether the user trains, rests or does mobility), and they are never stored in coach memory.

Guidance ranks below every Kinellect rule. A line cannot change the safety policy, the actions the coach may take, the tools it may use, or the fixed sentences users see, because code enforces those. The model is also told to ignore any line that asks it to change its role, reveal its instructions, skip a refusal or weaken safety. Use guidance for style and focus, not for rules that must always hold: the model treats it as a preference, and Kinellect does not guarantee that every reply follows every line.

The safety policy remains fitness_coach_safety_v1 for every client.

Coach voice

The coach writes its conversation replies in its own words. Four parts of your configuration shape how it sounds. None of them needs a new field: an existing configuration already has a voice.

Setting Effect on the coach's replies
tone supportive: warm and encouraging, acknowledges effort. direct: brief and to the point, leads with the answer. neutral: calm and factual, without praise.
terminology Your terms are preferred, for example "session" instead of "workout".
client_description, product_description, coaching_domain Tell the coach what your product is, so it stays within it. It is instructed not to describe features your configuration does not mention.
coaching_profile.guidance_lines Free-form wishes in your own words: shorter replies, no emoji, a name for the coach, a casual style.

All of this shapes style only. Every setting ranks below Kinellect's own rules:

  • refusals, action outcomes and workout-check lines are fixed sentences. They are the same for every tone. Only the refusal of an unsafe request names your referral target;
  • none of these four settings can change the safety policy, what the coach is allowed to do, or which tools it may use. The safety policy is always fitness_coach_safety_v1. Actions and tools come only from enabled_capabilities and action_policy.

Voice applies to conversation replies. A daily plan's reason_text and a completed workout's reaction are still fixed sentences. tone and terminology are also given to workout generation, which writes the draft title.

Hear the voice before going live

validate checks a configuration but calls no model, so it cannot show you how the coach sounds. To hear the voice, you can ask the Kinellect team for a separate tenant environment connected to your staging connector. Activate the candidate configuration there and chat with a test user. To go live, activate the same settings in production with your production connector_registration_ref and the next production version number. Chats in that environment use the real model and count against its own limits.

Read your configuration

GET /v1/client-configurations returns your 50 newest versions, newest first. Older versions stay readable by number.

{
  "versions": [
    {
      "configuration_ref": "0b6f2c9e-5d1a-4c7b-9e3f-8a2d4c6e1f05",
      "configuration_version": 3,
      "activated_at": "2026-10-02T14:05:11.000000+00:00",
      "superseded_at": null
    },
    {
      "configuration_ref": "f0a1b2c3-d4e5-4f60-8172-8394a5b6c7d8",
      "configuration_version": 2,
      "activated_at": "2026-09-28T09:30:00.000000+00:00",
      "superseded_at": "2026-10-02T14:05:11.000000+00:00"
    }
  ]
}

superseded_at is null only for the active version.

GET /v1/client-configurations/active and GET /v1/client-configurations/{configuration_version} return one version:

{
  "version": {
    "configuration_ref": "0b6f2c9e-5d1a-4c7b-9e3f-8a2d4c6e1f05",
    "configuration_version": 3,
    "activated_at": "2026-10-02T14:05:11.000000+00:00",
    "superseded_at": null
  },
  "document": { "...": "the activation body of this version" }
}

document has exactly the shape of the activation body, so you can change it and send it back. avoided_topics are returned in alphabetical order. It always includes coaching_profile, with the defaults if you never set one. It contains your connector_registration_ref, never your connector URL or secret.

Both return 404 with detail: configuration_not_found when the version does not exist, or when nothing has been activated yet. Responses are never cached (Cache-Control: no-store).

Change your configuration

  1. Read the active version.
  2. Change the fields you want in document.
  3. Validate it as the next version number.
  4. Activate it as that version, with a new Idempotency-Key.

The version number must be higher than the active one. Numbers do not have to be consecutive.

Check a change first

POST /v1/client-configurations/{configuration_version}/validate takes the same body as activation and runs every activation check, including the capability check: a call to your connector's capabilities endpoint, or Kinellect's own answer for an uploaded catalog. It stores nothing and needs no Idempotency-Key.

  • 204: the document would be accepted as this version.
  • 409, 422 or 503: the errors activation would return for a new version (see Errors).
  • 400: the body is not valid JSON.

Validate does not look up earlier activations. A version number that is already stored returns 409 configuration_version_not_newer, never configuration_version_conflict and never a replay.

A 204 does not reserve the version. Activation runs the checks again.

Roll back

A rollback is two calls:

  1. GET /v1/client-configurations/{configuration_version} for the version you want back.
  2. PUT /v1/client-configurations/{next_version}/activate with that document unchanged, where next_version is higher than the active version.

The older content becomes the new active version. Activation runs every check again, including the capability check.

Use a new Idempotency-Key for a rollback. If you reuse the key that originally activated that content, Kinellect replays the original response and activates nothing. You can tell from the response: 200 with replayed: true, or a configuration_version different from the one in your path, means no new version was activated.

Configuration errors

Rejections from these endpoints are Problem Details with a stable code in detail. Branch on detail, not on the status alone.

{
  "type": "about:blank",
  "title": "An error occurred",
  "status": 409,
  "detail": "configuration_version_not_newer"
}
Status detail Meaning
404 configuration_not_found No such version for your tenant, or nothing activated yet.
409 configuration_version_not_newer The version number is not higher than the active version.
409 configuration_version_conflict This version number or Idempotency-Key was already used with different content.
422 configuration_version_out_of_range On validate or activate, the version number is above 2147483647. Reading such a version returns 404 configuration_not_found.
422 connector_registration_unavailable The connector_registration_ref is not a registration of your tenant.
422 connector_contract_version_mismatch Your connector reports a contract version other than the registered one.
422 connector_capability_unavailable You enabled a capability your connector does not advertise.
422 exercise_catalog_not_uploaded The configuration names an uploaded-catalog registration, and this tenant environment hasn't uploaded an exercise catalog yet. Each environment needs its own upload.
422 workout_capability_bundle_incomplete Existing-workout lookups are only partly enabled, or a prescription capability is enabled without workout.generate and without the lookups. Lookups need workout.search, workout.resolve and exercise.resolve together, plus workout.prescription.count or workout.prescription.time.
422 workout_section_requires_generation workout.warmup.generate or workout.cooldown.generate is enabled without workout.generate.
422 workout_generation_policy_requires_generation workout_generation_policy was sent without workout.generate.
422 workout_generation_bundle_incomplete workout.generate is enabled without exercise.search, exercise.resolve, a prescription capability or workout_generation_policy.
422 workout_generation_volume_policy_incompatible maximum_total_count_repetitions must be set exactly when workout.prescription.count is enabled, and maximum_total_timed_work_seconds exactly when workout.prescription.time is enabled.
422 daily_policy_incompatible daily_decision_policy must be present exactly when daily.decide is enabled, and must fit the other enabled capabilities.
422 goal_progress_bundle_incomplete goal.progress is enabled without goal.plan or exercise.resolve.
422 workout_review_requires_generation workout.review is enabled without workout.generate and its generation policy.
422 week_plan_requires_daily_decide week.plan is enabled without daily.decide.
422 operation_policy_capability_duplicate A capability appears twice in the admission or usage policies.
503 connector_capability_discovery_unavailable Your connector's capabilities endpoint failed or did not answer within 10 seconds. Retry.

A 422 comes in three forms:

  • A rejection carries one of the codes above with type: about:blank.
  • A field that fails validation returns a validation problem (type: https://symfony.com/errors/validation) with a violations list. An error anywhere in coaching_profile, for example a referral_target outside the list or an eleventh guidance line, is reported on coaching_profile, and the message names the rule.
  • An unknown field returns a plain 422 with detail: Unprocessable Content and no violations list.

A version number of 0, with a leading zero, or longer than 10 digits does not match any route and returns a plain 404.

Conversation

Requires conversation.respond. A conversation is a Thread of Turns between one user and the coach.

Flow

  1. POST /v1/threads with external_subject_ref (and main: true for the user's primary conversation). This also registers the user the first time.
  2. POST /v1/threads/{thread_ref}/turns with the user's message (up to 16000 bytes). You receive 202 and an Operation.
  3. Poll GET /v1/operations/{operation_ref} until the state is terminal.
  4. Show result.message from a completed Operation.

While preparing a reply, the coach can use up to three tool steps, such as reading the current workout, searching exercises and starting a change. Its model calls and tools can take up to about 60 seconds, so keep polling until the Operation is terminal.

A user has one main Thread. If you send main: true again for a user who already has one, with an Idempotency-Key that has not created a Thread for this user, Kinellect answers 409 with detail main_thread_exists and nothing is created. The body carries the existing main Thread's thread_ref and the user's subject_ref:

{
  "type": "about:blank",
  "title": "An error occurred",
  "status": 409,
  "detail": "main_thread_exists",
  "thread_ref": "0d9c8b7a-6f5e-4d3c-9b2a-1f0e9d8c7b6a",
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10"
}

So if you lose the refs, you can find them again with the same request. Repeating the request with the key that created the main Thread still answers 201 with that Thread.

A Thread processes one Turn at a time. Sending another Turn while the previous one is still running returns 409.

What a reply contains

The coach writes its replies in its own words, in English: answers, explanations, encouragement and questions back to the user. Your client configuration shapes how it sounds.

Some parts of a reply are never written by the model. Kinellect adds them as fixed sentences:

  • Refusals. When the coach declines a request, coach_text is one fixed sentence (see Referral target). Fixed lines for any action or failed workout check earlier in the Turn still follow it in message.
  • Action outcomes. When the coach did something, for example remembered a preference, a fixed sentence states the result.
  • Workout checks. When the coach checked one of your existing workouts for the user, a fixed sentence states a failed check, or a verified recommendation.

A completed Operation's result carries the reply in three fields:

Field Content
message The full reply to show. It always starts with coach_text. Kinellect's fixed lines follow after a blank line, each separated by a blank line.
coach_text The coach's own words, or the fixed refusal sentence. At most 1500 characters. null for replies stored before coach-written replies existed.
fixed_lines Every sentence Kinellect added after coach_text, in order, each as {"kind", "text"}. An empty list when nothing was added. null for replies stored before this field existed.

If you show one text bubble, show message. If you want to style Kinellect's fixed lines differently, show coach_text as the coach's message and each fixed_lines text as a Kinellect line. Always show every fixed_lines text, or show message: do not show coach_text alone, because the fixed lines are the only reliable statement of what was saved, prepared or checked. When fixed_lines is null, show message as one block.

Each fixed line has a kind:

kind Meaning
action_outcome The result of an action the coach took or proposed.
workout_check_failed An existing workout could not be recommended.
workout_recommendation A verified existing workout is recommended.

Each text is exactly the line shown in message when the reply was written. message is coach_text, then, when fixed_lines is not empty, a blank line and the fixed_lines texts separated by blank lines. A refusal sentence stays in coach_text and is not listed in fixed_lines. For what was saved, proposed or prepared, keep reading action_receipts: fixed_lines is for display.

Things to rely on, and things not to:

  • The coach changes nothing in your system through its words. Changes happen only through actions, and every action has a receipt with a fixed outcome text.
  • Do not read meaning out of the coach's prose. Whether something was saved, proposed or prepared is in action_receipts, never in the wording.
  • A recommendation of an existing workout does not yet tell you which workout is meant. Do not infer one from the text.
  • The coach is instructed not to imply actions, invent numbers or discuss avoided topics. Free-written text cannot be guaranteed sentence by sentence, so build your screens from action_receipts, never from the wording.

Read history

You do not need to store every reply yourself. Two read-only calls return what was said, for example to rebuild the conversation screen after a reinstall or on a second device. Both need conversation:read and never call the model or your connector. Successful and 404 responses carry Cache-Control: no-store.

Use the subject_ref Kinellect returned from POST /v1/threads, never your own external_subject_ref.

Call Returns
GET /v1/subjects/{subject_ref}/threads The user's Threads, newest first, each exactly as POST /v1/threads returned it. main marks the primary Thread.
GET /v1/threads/{thread_ref}/turns One item per user Turn, newest first: turn_ref, sequence, the user's message, created_at, operation, and reply_rating.

operation is exactly what GET /v1/operations/{operation_ref} returns for that Turn:

  • completed: result.message is the coach reply and result.coach_text the coach's own part (null for Turns stored before coach-written replies);
  • failed, cancelled or expired: error_code (one of the failure codes for failed, operation_cancelled or operation_expired), and fallback_text when Kinellect wrote a safe reply;
  • queued or running: result is null. Poll the Operation, or read the first page again later.

action_receipts lists every action the coach took or proposed during the Turn, in any state. A Turn whose reply failed can still carry a receipt for an action that really happened.

reply_rating is the user's current rating of the coach reply in operation.result: positive, negative or null (see Rate a reply). It is always present, and null when the reply is unrated, the rating was cleared, or the Operation has no completed reply.

Nothing internal is returned: no prompts, model or provider names, tool arguments, memory text or usage.

Paging

Both lists return at most limit items (1 to 50, default 20) and next_before. To read older items, send next_before back as before. next_before is null when nothing older exists. The order is stable, so older pages never repeat or skip an item. To see new Threads or Turns, or the latest state of a queued or running Turn, read the first page again without before.

An unknown subject_ref or thread_ref, or one from another tenant, returns 404, and so does a before that is not an item of the same list. An invalid limit or before, or any query parameter other than limit and before, returns 422 with a list of violations.

Deleted users

  • The thread list of a deleted user returns 409 with detail: subject_deleted.
  • Deletion erases the user's Threads, so their turns return 404.
  • After reactivation the user starts with an empty thread list. Nothing is restored.

Rate a reply

Let the user mark a coach reply as helpful or not, for example with thumbs up and down:

curl -sS -X PUT "$KINELLECT_BASE_URL/v1/turns/$REPLY_TURN_REF/rating" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"rating": "positive"}'
  • It needs the conversation:write scope and an Idempotency-Key.
  • turn_ref is the coach reply's turn_ref, the one in operation.result of a completed conversation Operation. It is not the turn_ref of the user's message.
  • The body is exactly {"rating": ...} with "positive", "negative" or null. positive or negative sets the rating and replaces an earlier one. An explicit null clears it. The key is required: a body without it, such as {}, is refused with 422.
  • Success is 200 with a JSON null body.

The current rating comes back as reply_rating on each item of GET /v1/threads/{thread_ref}/turns. Polling an Operation does not return it. Rating never calls the model or your connector, and it does not change the reply, the Operation or the coach's memory. Ratings are erased when the user is deleted.

Status Meaning
400 The body is not valid JSON, or the Idempotency-Key is missing.
404 The reply cannot be rated: the reference is unknown or belongs to another client, the reply was erased with its user, it is a user Turn, or it is the fallback text of a failed Operation.
409 The Idempotency-Key was already used for another rating or another reply of the same user. With detail: subject_deleted, the user was deleted while the request ran.
422 The rating key is missing, has another value, or the body has an unknown field.

Sending the same key and body again returns 200 and changes nothing. Sending a rating the reply already has, with a new key, also changes nothing you can see.

What the coach uses

For each Turn the coach uses your current configuration, the user's current context (resolved through your connector when none is current), the user's remembered coaching preferences, recent Turns in the Thread, and only the capabilities you enabled. With exercise.search and exercise.resolve it can look up exercises in your catalog. With daily_plan.read and training_history.read it can read the user's plan for today and their completed workouts that Kinellect stored. It cannot reach anything else: no arbitrary web access, no database access, no other users.

Action receipts

When the coach takes or proposes an action during a Turn, the Operation lists it in action_receipts:

tool Meaning
propose_preference_update The coach suggested a preference change for the user to confirm.
update_preferences The coach asked your connector to update a preference (preference.update).
remember_explicit_preference The coach remembered a preference the user stated explicitly (memory.preference.write).
prepare_workout_draft The coach tried to prepare a new or changed workout the user asked for in chat; outcome says whether preparation started (see Workouts prepared in chat).
move_today_workout The coach asked your connector to move today's workout to tomorrow (schedule.move; see Schedule changes in chat).
cancel_today_workout The coach asked your connector to cancel today's workout (schedule.cancel).
record_exercise_limitation The coach recorded that the user wants to avoid an exercise (exercise_limitation.write; see Exercise limits set in chat).
lift_exercise_limitation The coach lifted a limit the user had set in chat.
update_profile The coach asked your connector to change the user's goal, add a note, or change their sessions per week (see Profile changes in chat).

Each receipt has an outcome (succeeded, failed, proposed or unconfirmed), a safe_code, and an outcome_text that you may show to the user. The text is written by Kinellect code, never by the model, so it only claims what actually happened. For a completed Operation, the action's line also appears in result.message and in result.fixed_lines after the coach's own text. When the Operation failed after an action, fallback_text does not mention it: show outcome_text from action_receipts yourself. unconfirmed means the result is uncertain: the action may or may not have taken effect on your side.

This tool remembers four kinds of preference: preferred_session_length, training_days, equipment_preference and coaching_tone. Background memory covers more, and you can read and delete all of it: see Coach memory.

Workouts prepared in chat

When a user asks the coach for a shorter workout ("make it 20 minutes") or one without certain exercises ("no push-ups"), the coach can prepare a new workout for them to review and save. Nothing in the user's plan changes until you save it on their behalf.

The coach offers this only when your configuration has all of these:

  • workout.generate with a workout_generation_policy;
  • workout.save or workout.save_and_schedule;
  • action_policy of auto_execute or confirmation_required.

To leave out an exercise, the coach must first find it in your catalog during the same Turn, so your configuration needs exercise.search or exercise.resolve. Without either, a request to leave out an exercise ends with workout_exclusion_unverified, unless its time limit is already refused with workout_duration_unfit.

What you receive

When the coach uses this action, the Turn's Operation completes as usual without waiting for the workout to be generated. Its reply is the coach's own text followed by Kinellect's fixed outcome line, and it has one action receipt:

Receipt Meaning What to do
outcome: proposed, safe_code: workout_draft_requested Preparation started. receipt_ref is the operation_ref of a standard workout draft Operation. Poll the draft, show it, offer Save.
outcome: failed, safe_code: workout_duration_unfit The requested time is below your policy's minimum duration. Show the reply. Nothing was prepared.
outcome: failed, safe_code: workout_exclusion_unverified The exercise to leave out was not found in your catalog during this Turn. Show the reply. Nothing was prepared.
outcome: failed, safe_code: workout_draft_unavailable The draft could not be started, for example because your workout-generation request or usage limit was reached. Show the reply. The user can try again later.

For a failed receipt, receipt_ref identifies only the receipt.

The same receipt appears on that Turn's operation.action_receipts when you read the Thread's history, so you can find the draft again from its receipt_ref.

The fixed outcome line says what was requested. With a time limit it is "I started preparing a new workout of at most 20 minutes. Check its estimated duration before you save it; nothing in your plan changes unless you save it." Without one it is "I started preparing a new workout without the exercises you asked to leave out. Nothing in your plan changes unless you save it." When the user asked for both, the line mentions only the time limit. The reply does not contain the workout.

Show and save the workout

  1. Poll GET /v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref} with the receipt_ref, exactly as for a draft you requested yourself. This needs workout:read.
  2. When it completes, show the draft with its estimated_duration_seconds. Kinellect computes that figure and has already checked it against the requested limit and your policy.
  3. When the user approves, call POST /v1/workout-acceptances (needs workout:write and an Idempotency-Key) as described in workout acceptance: source_kind: standalone_generated, source_operation_ref set to the receipt_ref, source_ref set to the draft's draft_ref, plus the chosen action, local_date and time_zone. Send approval: explicit_user_approval when your action_policy is confirmation_required.

The draft counts against the same request limits and usage ceilings as POST /v1/workout-drafts. The coach prepares at most one workout per Turn.

If the draft fails

Generation runs after the chat reply, so a failure appears on the draft Operation, not as a second chat message. The usual draft failures apply. draft_validation_failed with the validation code exercise_excluded means the generated workout still contained an exercise the user left out, even after one repair attempt. If leaving exercises out removes every candidate, the error is empty_candidate_set. duration_out_of_range means no workout fit the time limit or, for a change of focus only, the kept length.

What it does not do

  • It does not edit, move or remove a workout that already exists in your app. It prepares a new one.
  • If the user asks for a shorter workout without saying how long, the coach is instructed to ask how long it should be instead of choosing a number. The user's answer is a new Turn, and a workout is prepared only if that Turn returns a workout_draft_requested receipt.
  • Whether the coach uses this action for a given message is the model's decision. Build your screen from the receipt, never from the wording of the reply.
  • The time limit is between 10 and 180 minutes, and at most five exercises can be left out.

Changing the user's workout in chat

With workout.change as well, the coach can change the workout the user has now ("make it harder", "make it shorter") or build a new one ("build my program"). Send the user's current workout with the Turn:

  • POST /v1/threads/{thread_ref}/turns accepts an optional current_workout in the same shape as base_workout (see Changing a workout). Kinellect stores it with the Turn and does not return it in the Thread history. Without workout.change, or where the coach cannot prepare workouts, a Turn with current_workout answers 422 and nothing is created. current_workout is part of the Idempotency-Key fingerprint, so reusing a key with a different one answers 409.
  • The coach can read that workout (its exercises and Kinellect's estimate of its length) and prepare a changed version: harder or easier, a length it chooses from 5 to 180 minutes, a different focus (such as "more upper body"), or a mix of these. A request without a number, such as "make it longer", is left to the coach, which picks a sensible length or asks. A new workout carries a length limit or left-out exercises only when the user stated them, as described above.
  • When the Turn carries current_workout, the coach decides whether the person wants that workout changed or a new one. A change always starts from the workout you sent, also for a change of focus only, so its completed draft carries base_changes; a new workout has none. Which one it prepares is the model's decision, so build your screen from whether the completed draft has base_changes, not from the request. If the coach tries to change a workout your Turn did not carry, Kinellect asks it once to correct the call; if it cannot, the Operation fails with provider_invalid_response.
  • A change that names no length (a difficulty, a different focus, or both) keeps the length of the workout you sent when the user's coaching mode is standard: Kinellect measures that workout as read_current_workout reports it, rounded to whole minutes, and uses it as the target length. If that length is under 5 or over 180 minutes, its band does not fit your duration policy, or the workout cannot be measured, there is no target, and the workout coach is only asked to stay near its length within your policy. To measure it, Kinellect sends your connector one exercise resolve request for the sent workout's exercises before the draft starts. When no proposal fits that band after one repair, the draft fails with draft_validation_failed and duration_out_of_range. A length the coach names always wins. In onboarding or returning mode there is no kept target, and that mode's duration ceiling applies.
  • A change of the current workout, or a new workout prepared this way (also for today's workout), can name up to three exercises the coach found with an exercise search or lookup in the same reply, for example for "more upper body". When your catalog answer returns them and they suit the user, they join the exercises the workout coach can choose from, marked as found for the person's request so it looks at them first; whether it uses them is its choice, and the draft is validated as before. If the coach names an exercise it did not find, Kinellect asks it once to correct the call; if it cannot, the Operation fails with provider_invalid_response. On a new workout they can go together with a length limit and left-out exercises, but one exercise cannot be both found and left out.
  • With every change, the person's words that the coach quotes from the Turn as the request become the draft's requested_change (cut to at most their first 500 UTF-8 bytes). A new workout passes the same words to the coach, but its draft has no requested_change.
  • What stays, what is harder or easier and the length the coach chooses are the coach's choice; Kinellect does not check them. The changed draft is a draft with base_workout, so it passes the same validation, lands in the length band when it has a target length (see Changing a workout), and its completed draft Operation carries base_changes.
  • You show and save it exactly as above. Nothing in the user's plan changes unless you save it.

Additional receipts and fixed lines:

Receipt Fixed line
proposed / workout_draft_requested, changing the current workout "I started preparing a changed version of the workout you have now. Nothing in your plan changes unless you save it."
proposed / workout_draft_requested, a new workout "I started preparing a new workout. Nothing in your plan changes unless you save it."
failed / workout_base_unavailable "I could not see your current workout, so I did not prepare a changed one. Your plan is unchanged." The Turn carried no current_workout; nothing was created. Rare: it appears only for a call recovered after a retry.
failed / workout_duration_unfit, changing the current workout "I cannot make your current workout that length here, so I did not change it. Your plan is unchanged."
failed / workout_draft_unavailable, changing the current workout "I cannot prepare a changed version of your workout right now. Please try again later. Your plan is unchanged."

With workout.change, the last two bullets under "What it does not do" above apply only to new workouts requested with a time limit or left-out exercises. Enabling it raises the size of each chat request; see Sizing usage limits.

Changing today's workout in chat

With workout.save_and_replace as well (your connector declares it, and action_policy is auto_execute), the coach can change or replace today's workout when the person asks. To change the workout the person has now, your Turn must carry current_workout; without it, the coach can still prepare a new workout for today, which goes through the same swap. The coach replies right away; today's workout stays as it is until your app swaps the new one in.

  • The receipt is change_today_workout with outcome proposed and safe_code today_workout_change_started. receipt_ref is the workout draft's operation_ref, and local_date is the day it is meant for: the day the message was accepted, in the user's context time zone.
  • When the Turn carries current_workout, the coach decides whether the person wants that workout changed or a new one, as in Changing the user's workout in chat: a change starts from the workout you sent (also for a change of focus only), keeps its length under the same rule, and carries base_changes; a new workout for today has none. Build your screen from whether the completed draft has base_changes, not from the request. If the coach tries to change a workout your Turn did not carry, Kinellect asks it once to correct the call; if it cannot, the Operation fails with provider_invalid_response.
  • If it could not start, the outcome is failed with the same safe_code values as a draft prepared in chat (workout_base_unavailable, workout_duration_unfit, workout_exclusion_unverified, workout_draft_unavailable). Nothing was created.

Your backend then:

  1. Polls GET /v1/subjects/{subject_ref}/workout-draft-operations/{receipt_ref}. You may show the prepared workout, but do not offer a separate Save for it while the swap can still happen.
  2. When the draft completes, calls POST /v1/workout-acceptances once, with its own Idempotency-Key: source_kind standalone_generated, source_operation_ref = receipt_ref, source_ref = the draft's draft_ref, action save_and_replace, local_date from the receipt, time_zone = the user's context time zone, and approval null.

What your app can show:

  • The draft failed, was cancelled or expired: the draft's error_code.
  • The acceptance answers 422: source_noncurrent (the user's context or your configuration version changed after the draft completed, or time_zone differs from the context zone; send again with the context zone if that was the cause), capability_unavailable, action_denied, approval_required or source_unavailable.
  • The acceptance Operation: confirmed with the new workout_ref and schedule_ref; conflict with schedule_conflict (that day had a started, completed or second workout, or your connector could not be sure; nothing changed in the schedule) or command_conflict; rejected with action_rejected; failed with connector_unconfirmed (check your schedule), source_noncurrent (the last check before sending refused it, for example because of a limit the person set in chat after the draft), execution_deadline_exceeded or execution_attempts_exhausted; cancelled or expired.
  • After a refused swap you may offer the draft as an ordinary save, except after source_noncurrent. That save may create a second copy if your connector kept the new workout unscheduled.

Schedule changes in chat

When the user asks in chat to skip today, the coach can change the schedule in your system: move today's workout to tomorrow, or cancel it and make today a rest day. You own the schedule. Kinellect only asks your connector, and reports what your connector answered.

The coach is offered these actions only when all of this holds:

  • schedule.move or schedule.cancel is in enabled_capabilities, and your connector advertises it. Each capability turns on its own action.
  • action_policy is auto_execute. Under any other policy the coach replies without changing anything, and there is no proposal for the user to confirm.

A clear request is carried out at once. When the user does not say whether to keep the workout for tomorrow or drop it, the coach asks. One schedule change can happen per Turn.

What you receive

The Operation lists the action in action_receipts. For a completed Operation, the fixed line also appears in result.message and in result.fixed_lines as an action_outcome. When the Operation failed, result is null: show outcome_text from action_receipts yourself.

Your connector answered Receipt outcome safe_code Fixed line
applied (move) succeeded succeeded "Today's workout was moved to tomorrow, and today is now a rest day."
applied (cancel) succeeded succeeded "Today's workout was cancelled, and today is now a rest day."
no_workout_today failed no_workout_today "There is no workout scheduled for today, so your schedule is unchanged."
tomorrow_occupied (move only) failed tomorrow_occupied "Tomorrow already has a workout, so today's workout was not moved. Your schedule is unchanged."
action_rejected failed action_rejected "The app did not accept this schedule change. Your schedule is unchanged."
No usable answer: repeated failures until the Operation reached its time or attempt limit, a refused 4xx, a 200 Kinellect cannot accept, or command_conflict unconfirmed schedule_change_unconfirmed "I could not confirm this schedule change with the app. Check your schedule before you train."

unconfirmed means the change may or may not have happened on your side. Build your screen from the receipt, never from the coach's wording, and refresh the schedule you show after any succeeded or unconfirmed receipt.

What it does not do

  • It never replaces a workout. When tomorrow already has one, your connector answers tomorrow_occupied and nothing changes.
  • It only knows today and tomorrow. Other dates are out of reach.
  • Enabling it raises the size of each chat request, so set operation_token_maximum for conversation.respond to at least 90,000, or the figure for your capabilities (see Sizing usage limits).

Profile changes in chat

When the user asks in chat, the coach can change their goal, add a note to their notes, or change how many sessions a week they plan to train, in your system. You own the profile. Kinellect only asks your connector, and reports what your connector answered.

The coach is offered this action only when all of this holds:

  • At least one of profile.goal.update, profile.note.add and profile.sessions_per_week.update is in enabled_capabilities, and your connector advertises it. Each capability turns on one field, so enable only the fields you can store: the coach is never offered, and never sends, a field your configuration did not enable when the coach made the call.
  • action_policy is auto_execute.

One call can carry every enabled change together, and it counts as the Turn's one action. The coach writes the goal and the note from the user's words; whether to change anything is its decision.

  • Goal: 1 to 1000 bytes. You may keep it in the user's words or fold it into your own goal description, so the primary_goal you send in a later context may read differently. Kinellect does not compare them.
  • Note: 1 to 500 bytes, added to the user's notes. It never replaces or clears them; Kinellect cannot see your notes. If you fold notes into a short summary, such as mobility_summary, short additions keep it useful.
  • Sessions per week: 0 to 14, the same field you send in the context as desired_sessions_per_week. It does not change which days the user trains; that is training_days through preference.update, which you can enable separately.

After applying any change, send a new context version; until then the coach reads the earlier context.

What you receive

The Operation lists the action in action_receipts with tool update_profile. For a completed Operation, the fixed line also appears in result.message and in result.fixed_lines as one action_outcome.

Your connector answered Receipt outcome safe_code Fixed line
applied succeeded succeeded One line with one sentence per field sent, in this order, separated by a space: "Your goal was changed in the app.", "A note was added to your notes in the app.", "The number of sessions you plan to train each week was changed in the app."
action_rejected failed action_rejected "The app did not accept this profile change, so nothing in your profile changed."
No usable answer, a refused request, or command_conflict unconfirmed profile_update_unconfirmed "I could not confirm this profile change with the app. Check your profile in the app before you rely on it."

unconfirmed means the change may or may not have happened on your side. Build your screen from the receipt, never from the coach's wording. Enabling a profile capability raises the size of each chat request; see Sizing usage limits.

Exercise limits set in chat

When the user says in chat that they want to avoid a specific exercise, for example because it hurts, the coach can record that limit, and lift it again when the user asks. Kinellect keeps the limit itself; nothing is sent to your connector.

The coach is offered this only when all of this holds:

  • exercise_limitation.write is in enabled_capabilities;
  • exercise.search is enabled too;
  • action_policy is auto_execute.

How it behaves:

  • One exercise at a time. The limit names one exercise from your catalog, and Kinellect accepts only an exercise your connector returned by search or resolve in the same Turn. The coach is told to ask which exercise is meant when that is unclear, for example when the user names a movement or a body area ("my shoulder"). That is guidance to the model, not a guarantee. Whether a limit was recorded or lifted is in the receipt's outcome and safe_code, never in the wording. A succeeded receipt's receipt_ref is an opaque limitation reference, not the exercise; on a failed receipt it only identifies the receipt.
  • A hard exclusion. A limited exercise is left out of every new workout Kinellect plans, prepares or recommends for that user: generated drafts, workouts prepared in chat, daily plans, the check before a workout acceptance, and a recommendation of an existing workout.
  • It does not expire. It stays until the user lifts it in chat or the user is deleted. It keeps applying if you later remove the capability; once the coach no longer has the tools, only deleting the user removes it.
  • A lift touches only chat limits. Limits from your context, from a professional or from workout feedback are not changed by chat.
  • An exercise you have since removed from your catalog cannot be lifted from chat.
  • Enabling it raises the size of each chat request, so set operation_token_maximum for conversation.respond to at least 90,000, or the figure for your capabilities (see Sizing usage limits).

The receipt's outcome and safe_code, and the fixed line, which also appears in result.fixed_lines:

Outcome outcome / safe_code Fixed line
Recorded succeeded / exercise_limitation_recorded "I noted that you want to avoid this exercise. New workouts I plan, prepare or recommend for you will leave it out."
Lifted succeeded / exercise_limitation_lifted "I removed the limit you set in chat for this exercise. Any limit from your app, a professional or recent workout feedback still applies."
Exercise not confirmed (either action) failed / exercise_limitation_unverified "I could not confirm which catalog exercise you meant, so nothing changed."
No chat limit to lift failed / exercise_limitation_not_found "You have no limit set in chat on that exercise, so nothing changed. Limits from your app or a professional stay as they are."

Plans and workout history in chat

Two optional capabilities let the coach read what Kinellect already stores for the user, so it can answer questions such as "what's on today?" or "am I getting stronger at push-ups?". Both are off by default, need no connector support and work under every action_policy. Reading changes nothing.

Capability Tool the coach gets What it reads
daily_plan.read (needs daily.decide) today's plan The latest completed daily plan for the user's current local date: the outcome and why it was chosen, and each exercise with its name from the plan's catalog, sets, value and rest. If the plan is no longer current, the coach is told so. If there is no completed plan for today, the coach is told that too.
training_history.read recent workouts The three most recent completed workouts you reported: date, length, rating, how many exercises were done or skipped, and the user's own note, cut at 500 characters and marked as shortened.
training_history.read with exercise.resolve one workout in detail One of those workouts, up to its first 10 exercises, with names from one call to your connector's exercise resolve.
training_history.read progress on one exercise The latest result for one exercise, whether it beat every earlier result, and the best recorded result, within the user's latest 50 recorded workouts.
  • The user's note is passed to the coach as the user's own words. It grants nothing: every change still goes through the action tools and their checks.
  • Exercise names come from your catalog: from the plan's stored catalog for today's plan, and from your connector for one workout in detail. Technique advice still needs the exercise resolved first.
  • Enabling these raises the size of each chat request. Set operation_token_maximum for conversation.respond as described in Sizing usage limits.
  • A client that enables neither capability sends and receives exactly what it does today.

Failures

A failed conversation Operation has one of these error_code values: provider_unavailable, provider_invalid_response, connector_unavailable, client_configuration_missing, subject_context_unavailable, execution_deadline_exceeded or execution_attempts_exhausted. error_message is a fixed safe sentence. When present, fallback_text is a safe reply you can show instead of a coach answer.

Workout drafts

Requires workout.generate and its bundle: exercise.search, exercise.resolve, at least one prescription type, and a workout_generation_policy. Add workout.warmup.generate and workout.cooldown.generate to get warm-up and cool-down sections.

A workout draft is a structured workout built only from exercises in your catalog and validated against the user's context, safety constraints and your generation policy. A draft is a proposal. Nothing reaches your system until the user accepts it (see Workout acceptance).

Request

curl -sS -X POST "$KINELLECT_BASE_URL/v1/workout-drafts" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data '{"subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10"}'

The body contains subject_ref and, optionally, target_duration_minutes, and, to change a workout the user already has, base_workout and adjustment (see Changing a workout). Kinellect uses the current configuration and context and decides how to execute. You cannot choose a model or prompt. Poll the Location URL, GET /v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}.

Target length. target_duration_minutes is an integer from 5 to 180 (the chat time limit keeps its own range of 10 to 180). With a target of T minutes, a completed draft has an estimated_duration_seconds between 80% and 120% of T, which is 48 × T to 72 × T seconds, and also inside your policy's estimated-duration interval when you set one. The band applies to Kinellect's estimate from sets, repetitions, seconds, rest and your count_duration_seconds_per_repetition, not to how long the session takes in practice. A target replaces the onboarding or returning duration ceiling. An explicit null is the same as no target, and a request without the field behaves as before. The coach is guided to reach a target through the amount of work, not by changing rest.

When no proposal fits the band, the draft fails with draft_validation_failed and duration_out_of_range. One cause is that your exercise search returned too few suitable moves for the length: widen the search, or retry with a smaller target or without one. When the band does not overlap your policy interval, the draft fails the same way before any search or model call. With a target, a count exercise without count_duration_seconds_per_repetition cannot be timed, and the draft fails with duration_unverifiable if the model cannot avoid it.

A draft calls your connector and the model, and the model may need a second attempt when its first proposal fails validation, so a draft can take a while. One run of a draft, including your connector calls and both model attempts, takes at most about 100 seconds. If a run is interrupted, Kinellect retries it, so an Operation can stay queued or running for up to about 5 minutes before it ends, for example with execution_deadline_exceeded or execution_attempts_exhausted. Keep polling with backoff until the Operation reaches a terminal state, rather than giving up after a short fixed time.

Result

A completed Operation contains draft_ref and draft:

{
  "title": "Knee-friendly strength",
  "warmup_supersets": [],
  "supersets": [
    {
      "order": 1,
      "rest_between_cycles_seconds": 60,
      "workout_exercises": [
        {
          "exercise_ref": "glute-bridge",
          "exercise_content_version": "v3",
          "order": 1,
          "sets": 3,
          "rest_before_seconds": 0,
          "prescription": {"type": "count", "repetitions": 12}
        },
        {
          "exercise_ref": "banded-side-step",
          "exercise_content_version": "v2",
          "order": 2,
          "sets": 3,
          "rest_before_seconds": 30,
          "prescription": {"type": "count", "repetitions": 10}
        }
      ]
    }
  ],
  "cooldown_supersets": []
}

The Operation also reports catalog_version, the totals (total_sets, total_count_repetitions, total_timed_work_seconds, estimated_duration_seconds) and validation_codes. validated means the draft passed every check. Codes such as regression_substitution or constraint_conflict explain adjustments the validator made, for example swapping in an easier exercise to respect a constraint.

Every exercise carries the exercise_content_version your connector reported, so you can detect catalog changes before showing or saving the draft.

Changing a workout

To make the user's current workout harder, easier, shorter or longer, send the moves they have now as base_workout:

  • base_workout has the draft section shape without the title and content versions: warmup_supersets and cooldown_supersets (optional) and supersets (at least one). Each superset is {order, rest_between_cycles_seconds, workout_exercises}, and each exercise is {exercise_ref, order, sets, rest_before_seconds, prescription} with prescription {type: "count", repetitions} or {type: "time", duration_seconds}. Across the sections there are at most 20 supersets and 20 exercises, each exercise_ref at most once, numbered 1, 2, 3 within each section and superset.
  • adjustment: harder or easier, optional.
  • requested_change: the change in the person's own words, such as "more strength, less stretching", optional. 1 to 500 UTF-8 bytes without NUL. It reaches the coach as data with the base, and the coach reads it; Kinellect only checks its length and does not interpret it. For a change that is neither harder nor easier, send the routine's current length as target_duration_minutes. It is stored with the base until the user is deleted. An explicit null is the same as not sending it.
  • A length change is base_workout with target_duration_minutes, with or without an adjustment. The usual 80% to 120% band applies.
  • base_workout needs an adjustment, a target_duration_minutes or both. base_workout alone, or adjustment or requested_change without base_workout, answers 422, and nothing is created.

How it works:

  • Kinellect checks the base moves through your connector's exercise resolve (see Build your connector). A move your connector no longer returns, or one that is no longer suitable for the user, is not offered to the coach, and the coach is told which base moves are not available. The draft is built from the remaining base moves, the moves your exercise search returns, and the progressions and regressions that your search answer lists for base moves it returned (progressions only for base moves that fit the resolve request). A relationship declared only in your resolve answer, or on a base move your search did not return, adds no exercise.
  • What stays the same, and how a harder or easier version differs, are the coach's choice. Kinellect does not check them. The coach is guided to keep the routine's shape and swap a move to its harder or easier version rather than drop it, and to reach a length different from the base through sets, repetitions or the seconds of timed moves. Rest follows the effort asked for: it is not stretched or squeezed to fill a length, because more rest makes a session easier and less rest harder. That is guidance, not a guarantee: a tight length can still force a move out. The draft passes the same validation as any draft, and with a target the same length band. Hard exclusions stay in force.
  • Your exercise search must still return at least one suitable exercise; otherwise the draft fails with empty_candidate_set, as without a base.
  • A completed draft made from a base has base_changes, which Kinellect computes by comparing exercise_ref values, with no judgment by the model:
  • kept: base exercises that are in the draft;
  • removed: base exercises that are not in the draft;
  • added: draft exercises that are not in the base;
  • unavailable: the removed base exercises that were not offered to the coach (your resolve omitted them, they were unsuitable, or they did not fit the resolve request). Each is also in removed.

Kinellect does not pair removed and added exercises into swaps. Your catalog links can show an added exercise as the progression or regression of a removed one. A draft without base_workout has no base_changes field.

Failures

Failed drafts carry an error_code, for example subject_context_unavailable, exercise_catalog_unavailable, empty_candidate_set (no usable exercises for this user), draft_validation_failed, execution_deadline_exceeded or generation_request_too_large. error_message is always the fixed sentence "The workout draft could not be completed safely." The API reference lists every code.

generation_request_too_large means what Kinellect would send to the model (chiefly the exercises found in your connector or uploaded catalog, with their relationships and safety identifiers, together with your client profile, the user context and coach memory) is larger than one model request; nothing was sent and the same request fails the same way until fewer or smaller exercises are found. Kinellect doesn't retry it. Before this code existed, the same failure was reported as execution_mode_unavailable. If your client checks error_code against a fixed list, add the new value. When only the repair request is too large, the draft fails with the first attempt's code, draft_validation_failed or provider_invalid_response, as when no time is left for a repair.

When the model's first proposal fails validation, Kinellect starts a second attempt only if at least 30 seconds are left for it. Otherwise the draft fails with draft_validation_failed and the first proposal's codes in validation_codes, not with execution_deadline_exceeded.

Daily plans

Requires daily.decide and a daily_decision_policy. A daily plan answers "what should this user do today?" with one of three outcomes: workout, rest or mobility. Rules decide the outcome deterministically from your policy and the user's context, and, with week.plan, from the user's week plan (see Today follows the plan). A model is used only when the policy allows generating a new workout, and for the coach note.

Policy

daily_decision_policy defines:

  • enabled_outcomes: any non-empty subset of workout, rest and mobility;
  • workout_source_policy (when workout is enabled): existing_only picks a workout from your catalog, generation_only generates one, and existing_preferred tries your catalog first and falls back to generation;
  • non_workout_preference: whether rest or mobility wins when both are possible;
  • rest_fallback_codes: when to fall back to rest (recovery_unavailable, workout_content_unavailable);
  • recovery_max_age_seconds and activity_max_age_seconds: how fresh recovery and activity data must be.

Conditional fields must be omitted when they do not apply. An explicit null is invalid. The workout source you pick needs its capability bundle: existing workouts need workout.search, workout.resolve, exercise.resolve and a prescription type, and generation needs the workout generation bundle.

Daily context

Daily plans need daily_context in the user's current Subject context:

{
  "week_start": "2026-09-21",
  "history_through": "2026-09-25T07:00:00Z",
  "completed_workout_dates": ["2026-09-22", "2026-09-24"],
  "completed_mobility_dates": ["2026-09-23"],
  "preferred_days": [1, 3, 5],
  "recovery_state": "ready",
  "recovery_observed_at": "2026-09-25T06:30:00Z",
  "recovery_valid_through": "2026-09-25T20:00:00Z"
}
  • week_start is the Monday of the week that contains local_date, in the user's time zone.
  • Completion lists cover the period from week_start minus 7 days through history_through. A date repeated twice means two sessions that day. Each list holds at most 28 entries.
  • preferred_days are ISO weekdays (1 = Monday) and must be a subset of available_days.
  • recovery_state is ready, mobility_only, rest_only or unknown.

Kinellect decides only when the context's local_date is today in the user's time zone and the activity and recovery data are fresh under your policy. Otherwise the plan fails, with codes such as local_date_changed, activity_history_unavailable or recovery_unavailable.

Request and result

curl -sS -X POST "$KINELLECT_BASE_URL/v1/daily-plans" \
  -H "Authorization: Bearer $KINELLECT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  --data '{"subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10"}'

Poll GET /v1/subjects/{subject_ref}/daily-plan-operations/{operation_ref}. A completed Operation's result is an immutable decision with:

  • outcome and machine-readable reason_codes (for example preferred_workout_day, weekly_target_met or recovery_rest_only, and week_plan_session, week_plan_mobility or week_plan_rest on a day that follows the week plan);
  • reason_text, a safe explanation you can show;
  • existing_workout or generated_workout, when the outcome is workout, and generated_workout when the outcome is mobility and a mobility session was prepared (see Mobility sessions);
  • the pinned configuration_version, context_version, local_date and time_zone.
  • coach_note, when daily.coach_note is enabled (see Coach note).

Each poll also returns currentness: current, or why the decision no longer matches the user's situation (context_changed, local_date_changed, configuration_changed, activity_expired and others). The decision itself never changes. When it is no longer current, request a new plan.

Coach note

With daily.coach_note enabled, a completed daily plan carries coach_note: a short note, written by the model in your tone and terms, saying why today is this kind of day (the model is asked for one or two sentences). Kinellect turns it on for a tenant serving end users only after its live note evaluation passes.

  • coach_note.text is at most 500 characters. provider, model and schema_version record what wrote it. schema_version is daily_coach_note_v2 for a note on a day the coach planned in the week plan and the plan decided, which also saw that day's title and coach reason. Every other note is daily_coach_note_v1.
  • Kinellect checks only the note's structure and length, and never uses it for any decision. The outcome and reason_codes stay the source of truth.
  • A plan whose note cannot be written completes without coach_note; the note never makes a plan fail. Treat the field as optional.
  • A stored note stays on later polls, also after you turn the switch off.
  • Enabling it raises the size of each daily plan request: set operation_token_maximum for daily.decide to at least 40,000, or at least 50,000 when week.plan is also enabled (see Usage limits for daily plans).

Mobility sessions

With daily.mobility_session enabled, a mobility day gets a short generated mobility session. It takes effect only when your daily policy enables mobility and its workout source policy is generation_only or existing_preferred.

  • The session is built by the workout generator and passes the same validation as a generated workout. The plan carries it as generated_workout, with the reason code generated_workout_validated.
  • When no session can be prepared, whatever the cause, the day stays mobility with the reason code workout_content_unavailable and no session.
  • Save or schedule a prepared session like a daily plan's generated workout, with source_kind daily_generated (see Workout acceptance).
  • Its exercises get progress signals through the daily plan's progress-signals endpoint, as a workout does (see Progress signals).
  • Enabling it also needs a daily.decide operation_token_maximum of at least 40,000, or at least 50,000 when week.plan is also enabled.

Usage limits for daily plans

A daily plan makes model calls only when it generates a workout or a mobility session (the answer and at most one repair) or writes a coach note. Measured peaks while a call is in flight, in tokens:

Plan Without week.plan On a day that follows a planned day
Coach note with the longest client texts and Subject context 31,274 32,867
Generated workout with its repair and a note 30,484 33,438
Mobility session with its repair and a note 30,950 33,904

Each recommendation is the largest peak plus 25%, rounded up to the next 10,000. Without week.plan, 31,274 plus 25% is about 39,093, so daily.decide needs an operation_token_maximum of at least 40,000. With week.plan and generated workouts, daily.mobility_session or daily.coach_note, 33,904 plus 25% is 42,380, so it needs at least 50,000. Keep each daily maximum at least as high as the per-Operation maximum.

Failures

A failed daily plan carries an error_code and a fixed error_message for that code. The API reference lists every code. If your client checks error_code against a fixed list, add generation_request_too_large.

  • generation_request_too_large means what Kinellect would send to the model to generate today's workout (chiefly the exercises found in your connector or uploaded catalog, with their relationships and safety identifiers, together with your client profile, the user context and coach memory) is larger than one model request. Nothing was sent to the model, and the same request fails the same way until fewer or smaller exercises are found. Its error_message is "The workout generation request is too large; the same request fails the same way." It never falls back to rest. Before this code existed, the same failure was reported as execution_mode_unavailable.
  • When only the repair request is too large, the plan ends as the first attempt ended, as if no repair had been made: a rejected first workout becomes workout_content_unavailable (rest when your policy allows the fallback), and an unreadable first answer fails with provider_invalid_response.
  • A mobility session whose request is too large doesn't fail the plan: the day stays mobility with workout_content_unavailable and no session.

Get a fresh plan on the same day

When the user's situation changes during the day, for example they update their profile or finish a workout, ask for a new plan:

  1. Send the new Subject context version, including daily_context. It counts once it is current: a version whose effective_at is still in the future is not current yet.
  2. POST /v1/daily-plans with a new Idempotency-Key.
  3. Poll the new Operation.

What the key does:

A key repeated with the same API token never creates a second plan. Kinellect first checks the request as if it were new, and only then compares it with the plan the key already made:

  • When the request is no longer admitted, it is refused with 422 and the reason, for example local_date_changed on a later local date while the current context still names the earlier date, subject_context_unavailable when no current context with daily_context exists, activity_history_unavailable when the activity data has gone stale, or client_configuration_unavailable when no usable configuration is active.
  • When the request is admitted and everything the plan was decided from still holds, you get the original Operation.
  • When the request is admitted but something the plan was decided from has changed, you get 409. That includes a new context version, a new configuration version even when only the tone changed, recovery data that was usable and has since gone stale, and, with week.plan, a new revision of the week plan when the plan followed a planned day or today now has one.

So do not rely on replaying a key later in the day, and never reuse a key on a new day: use a new key. The key belongs to the API token that sent it. The same key sent with another token of yours is a new request and can create a second plan.

What to know:

  • The earlier plan stays readable. Its currentness is context_changed while the newer context is current, and context_unavailable when no context with daily_context is current. Nothing links the two plans or marks the earlier one as replaced, so your app keeps track of which plan it shows.
  • A plan that has not completed when the new context becomes current normally fails, whether it was queued or already running: with subject_context_unavailable while your active configuration is unchanged. Use the new request.
  • When today is in daily_context.completed_workout_dates, the plan is never a workout. On a day that is otherwise ready and available it is your configured non-workout choice with the reason workout_completed_today; a policy that enables neither rest nor mobility fails with no_eligible_outcome instead. When an earlier rule applies first (unusable recovery information, rest-only or mobility-only recovery, a context blocker, or an unavailable day), the plan carries that rule's outcome and reason.
  • Kinellect cannot see that a workout was started. Do not ask for a new plan after the user starts today's workout.
  • Every request is a full daily decision and counts toward your admission and usage limits.
  • Replacing a workout your app already accepted into its own schedule is your app's action. Kinellect does not change it.

Workout acceptance

Requires workout.save, workout.save_and_schedule and/or workout.save_and_replace, and your connector's actions/workouts/accept endpoint. With an uploaded exercise catalog, save needs no connector: Kinellect confirms it itself (see Saving a workout). Acceptance turns a proposed workout (a workout draft, a daily plan's workout or a review's changed session) into a real workout in your system. It is always an explicit request from you, and Kinellect never infers approval.

Request

{
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "selection": {
    "source_kind": "standalone_generated",
    "source_operation_ref": "22222222-2222-4222-8222-222222222222",
    "source_ref": "33333333-3333-4333-8333-333333333333",
    "action": "save_and_schedule",
    "local_date": "2026-09-26",
    "time_zone": "Europe/Oslo",
    "approval": "explicit_user_approval"
  }
}
  • source_kind is standalone_generated (a workout draft), daily_generated or daily_existing (a daily plan's workout, or with daily_generated a prepared mobility session), or review_generated (the changed session of a review after a workout). source_operation_ref and source_ref identify it. For a draft, send the draft Operation's operation_ref and its draft_ref. For a daily plan, send the daily-plan Operation's operation_ref and the decision's decision_ref. For a review, send the review Operation's operation_ref and its review_ref.
  • action is save, save_and_schedule or save_and_replace. For save_and_schedule and save_and_replace, local_date and time_zone are required, and time_zone must equal the user's context. For save, send both as null. save_and_replace puts the workout in place of the workout scheduled on local_date; it is used for changing today's workout in chat.
  • approval: "explicit_user_approval" attests that the user approved this exact workout, action, date and time zone. Under confirmation_required it is mandatory. Under auto_execute it may be null. Under professional_review_required, proposal_only and rejected the action is never executed.

Send it to POST /v1/workout-acceptances and poll GET /v1/subjects/{subject_ref}/workout-acceptance-operations/{operation_ref}.

Result

A completed Operation holds exactly one business outcome:

result.status Meaning
confirmed Your connector saved (and scheduled) the workout. Includes your receipt_ref, workout_ref, workout_content_version, confirmed_at, and for save_and_schedule and save_and_replace your schedule_ref and schedule_content_version. With an uploaded exercise catalog, Kinellect confirms a save itself and the references are Kinellect's (see Saving a workout).
conflict Your connector refused because of a conflict, for example the date is already taken. Contains only a safe_code.
rejected Your connector refused for a business reason. Contains only a safe_code.

A failed Operation's error_code tells you why nothing was confirmed. source_noncurrent, approval_required and action_denied mean Kinellect never called your connector. connector_unconfirmed means Kinellect sent the command but never received a valid answer, so the workout may exist on your side. Check your own records for the command's action_ref before asking the user to accept again. Kinellect retries only within the original Operation, always with the same action_ref and Idempotency-Key, so an idempotent connector never creates duplicates (see Build your connector).

When Kinellect sends the command again:

  • After a network error, a timeout, a redirect, 408, 409, 425, 429 or any 5xx, Kinellect tries again later, up to four attempts within the Operation. Inside each attempt it may also send the request once more within a second (see Timeouts and retries). So your connector can receive the same command up to eight times, always with the same action_ref and Idempotency-Key.
  • After a 2xx answer it cannot accept (malformed, not matching the schema, or for a different command), or after any other 4xx, Kinellect does not send it again. The Operation fails at once with connector_unconfirmed.

So answer a command you refuse for a business reason with 200 and a rejected outcome, not with a 4xx. confirmed_at may carry any number of digits after the seconds (for example 2026-10-07T18:11:33.685Z); a leap second (23:59:60) is not accepted.

Acceptance never moves or cancels schedules.

Workout completion

Report completed workouts so the coach can react and learn. This endpoint only records a snapshot of your history and derives a reaction. It never changes your workout records.

Request

POST /v1/events with a workout.completed event (requires workout:write):

{
  "event_ref": "5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c",
  "event_type": "workout.completed",
  "schema_version": 1,
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "activity_ref": "session-99102",
  "activity_revision": 1,
  "occurred_at": "2026-09-25T17:40:00Z",
  "workout_ref": "knee-programme-week-2",
  "duration_seconds": 1860,
  "exercise_results": [
    {
      "exercise_ref": "glute-bridge",
      "exercise_content_version": "v3",
      "status": "performed",
      "prescription_type": "count",
      "prescribed_value": 12,
      "completed_value": 12
    },
    {
      "exercise_ref": "banded-side-step",
      "exercise_content_version": "v2",
      "status": "skipped",
      "prescription_type": "count",
      "prescribed_value": 10,
      "completed_value": null
    }
  ],
  "feedback": {"rating": "tough", "note": "Side steps hurt a little on the outside of the knee"}
}
  • event_ref is a UUID you generate once per event.
  • activity_ref is your identifier for the session. To correct a session, send a new event with the same activity_ref and a higher activity_revision. Older revisions become superseded, and a stale revision is refused with 422.
  • feedback.rating is positive, neutral or tough. note is free text or null.

Result

Poll GET /v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}. For a completed, current Operation:

  • reaction is a short coach message you can show. When it names a move, it uses the move's display name from your exercise catalog, never its reference. If you don't enable exercise.resolve, or the name can't be looked up, the reaction names no move. If the coach's reaction can't be used, the workout still completes, with the reaction Your completed session is recorded. and notification_suggested set to false.
  • notification_suggested tells you whether the reaction is worth a push notification. You own notifications and decide whether to send one.

Superseded results never expose reaction or notification_suggested. A failed Operation reports model_failed, operation_cancelled or operation_expired.

Pain or difficulty reported in feedback can shape later coaching, for example by temporarily avoiding an exercise.

With goal.progress enabled, a completed workout can also move the user along their active goal. The completion response stays the same. Read the progress from its own route, as described in Progress from reported workouts.

With workout.review enabled, once the completion is completed your app can ask whether to keep or change the next session it planned. The completion response stays the same. See Review after a workout.

Coach memory

Coach memory is what the coach remembers about one user between conversations: what they told it, and what it observed in their completed workouts. Kinellect stores it per Subject, uses it in conversations, workout drafts and daily plans, and lets you read and delete it through the API.

Memory never outranks the facts you send. If a remembered statement conflicts with newer Subject context, the context wins.

What is remembered

Memory is organised into ten topics. Each topic has a fixed set of slots, and a slot holds one current entry.

Topic Slots Where entries come from
coaching_preferences preferred_session_length, training_days, equipment_preference, coaching_tone Stated by the user
goals_and_intent goal, motivation Stated by the user
effective_training_level training_level Stated by the user
key_coaching_context coaching_context Stated by the user
strengths strength Stated by the user, or the weekly review
challenges_and_focus_areas challenge, focus_area Stated by the user, or the weekly review
training_patterns schedule_pattern, session_pattern Stated by the user, or the weekly review
achievements_and_progress achievement Stated by the user, or the weekly review
recovery_and_feedback none Derived from completed workouts, read-only
exercise_constraints none Derived from completed workouts, read-only

Every entry carries an authority:

  • explicit_user_statement: the user said it in a conversation. The stored text is the user's own words. These entries do not expire.
  • model_inference: Kinellect derived it from the user's workout feedback. These entries carry a confidence and an expires_at. source_type tells you which kind it is:
    • weekly_review: an observation across the week's feedback, in one of the slots the weekly review may write. It expires 28 days after the review. An inference never replaces something the user stated, including a statement the user later retracted.
    • workout_completion_event: an entry of the two read-only topics, derived from one completed workout. It expires 7 days after the workout.

evidence_refs holds the event_ref of the workout completions an inferred entry is based on. A weekly review entry may also cite the context_ref. They are not your activity_ref values.

The two read-only topics summarise recent workout completion feedback. exercise_constraints lists exercises to exclude or avoid, using the same classification that workout safety validation enforces. You correct them by sending a higher activity_revision for the workout, not through the memory API.

How memory gets written

Path What it does Needs
Preference tool During a Turn, the coach stores a preference the user stated explicitly. Only the four coaching_preferences slots. memory.preference.write with the auto_execute action policy
Conversation compiler After a completed Turn, a background job stores what the user stated explicitly. It never infers. It writes the four coaching_preferences slots when memory.preference.write is enabled, and the other writable slots when memory.compile is enabled. memory.preference.write or memory.compile
Weekly review At most once per user per UTC week, triggered by the first workout completion Kinellect accepts in that week, a background job records inferred entries. memory.compile
Workout completions Feedback you report becomes the two read-only topics. Workout completion

The two background jobs run only when all of these hold:

  • the capability is enabled with the auto_execute action policy: either memory capability for the conversation compiler, memory.compile for the weekly review;
  • your configuration has a coach_memory.compile entry in both operation_admission_policies and operation_usage_policies, each with hard_enforcement_enabled: true, so the work has a ceiling;
  • the Kinellect team has switched background memory on for your environment. Ask before you rely on it.

Without them, nothing is compiled and no cost is incurred. Note that memory.preference.write alone is enough for the conversation compiler: once the policies and the environment switch are in place, it runs after every completed Turn. Enabling either memory capability also lets conversations read memory back. Without either, conversations receive no coach memory.

Your facts override memory

Four slots overlap fields of the Subject context:

Slot Context field
training_days available_days
equipment_preference equipment_refs
goal primary_goal
training_level experience

When you change one of these fields after the user made the statement, the remembered entry gets state: overridden_by_client_context. The coach stops using it. You still see it in the read API, with overlapping_context_field naming the field that overrode it.

Read a user's memory

GET /v1/subjects/{subject_ref}/memory requires the memory:read scope. It returns every current entry and an index with one row per topic. Expired and retracted entries are left out.

{
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "context_ref": "b41c0e7a-7a53-4e0f-9f3c-2d1a6c5b4e39",
  "context_version": 3,
  "index": [
    {"topic": "coaching_preferences", "entry_count": 1, "overridden_count": 0, "latest_topic_version": 2, "latest_source_occurred_at": "2026-09-28T08:15:00Z"},
    {"topic": "goals_and_intent", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "effective_training_level", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "strengths", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "challenges_and_focus_areas", "entry_count": 1, "overridden_count": 0, "latest_topic_version": 1, "latest_source_occurred_at": "2026-09-29T06:00:00Z"},
    {"topic": "training_patterns", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "recovery_and_feedback", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "exercise_constraints", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "achievements_and_progress", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null},
    {"topic": "key_coaching_context", "entry_count": 0, "overridden_count": 0, "latest_topic_version": null, "latest_source_occurred_at": null}
  ],
  "entries": [
    {
      "memory_ref": "0d0f5a3e-6f0b-4d36-8f2e-5a1c9e7b3d42",
      "topic": "coaching_preferences",
      "slot": "preferred_session_length",
      "text": "I only have about twenty minutes on weekdays",
      "authority": "explicit_user_statement",
      "confidence": null,
      "source_type": "conversation_user_turn",
      "source_turn_ref": "3b9a1c2d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
      "source_compilation_ref": null,
      "activity_ref": null,
      "evidence_refs": [],
      "topic_version": 2,
      "source_occurred_at": "2026-09-28T08:15:00Z",
      "expires_at": null,
      "created_at": "2026-09-28T08:15:04Z",
      "state": "effective",
      "overlapping_context_field": null,
      "deletable": true
    },
    {
      "memory_ref": "9a8b7c6d-5e4f-4a3b-9c2d-1e0f9a8b7c6d",
      "topic": "challenges_and_focus_areas",
      "slot": "focus_area",
      "text": "Single-leg balance work is consistently reported as tough",
      "authority": "model_inference",
      "confidence": 0.7,
      "source_type": "weekly_review",
      "source_turn_ref": null,
      "source_compilation_ref": "c2d3e4f5-a6b7-4c8d-9e0f-1a2b3c4d5e6f",
      "activity_ref": null,
      "evidence_refs": ["5f4e3d2c-1b0a-4f9e-8d7c-6b5a4f3e2d1c", "8a7b6c5d-4e3f-4a2b-9c1d-0e9f8a7b6c5d"],
      "topic_version": 1,
      "source_occurred_at": "2026-09-29T06:00:00Z",
      "expires_at": "2026-10-27T06:00:00Z",
      "created_at": "2026-09-29T06:10:21Z",
      "state": "effective",
      "overlapping_context_field": null,
      "deletable": true
    }
  ]
}
  • text is at most 1000 bytes. Texts derived from workout completions are bounded summaries: they list items in order and say how many were left out. Your own completion records remain the authoritative source.
  • deletable is false for the two read-only topics, whose slot is null.
  • The response is never cached (Cache-Control: no-store).

Use this to show users what the coach remembers about them.

Delete an entry

DELETE /v1/subjects/{subject_ref}/memory/{topic}/{slot} requires the memory:write scope and an Idempotency-Key. It returns 200 with a null body, also when the slot was already empty.

Deleting a slot:

  • removes every version of that slot, including earlier values;
  • stops background work that was queued before the deletion from bringing it back. A statement the user makes after the deletion is remembered again.

It does not rewrite conversation history. The user's own message, and any coach reply that quoted the entry, stay in the Thread until you delete the Subject.

Status Meaning
404 Unknown Subject, an unknown topic or slot, a slot that does not belong to the topic, or a read-only topic.
409 The Idempotency-Key was used for a different deletion, or the Subject is deleted (detail: subject_deleted).

Entries cannot be edited through the API. To correct one, delete it; the user can state the new value in a conversation.

Memory in daily plans

A daily plan decision lists what it relied on in sources. When remembered entries shaped a generated workout, the decision includes one source per entry, up to eight per plan:

  • entries of coaching_preferences appear with code: preference_memory and fields of preference_name, text and source_turn_ref;
  • entries of the other writable topics appear with code: coach_memory and fields of topic, slot, text and source.

The two read-only topics are never listed as memory sources.

reference and version identify the entry. The coach_memory code is new: if your client validates code against a fixed list, add it.

Progress signals

Progress signals tell you, for each exercise of a workout, one fact you can turn into a short sentence: the user has levelled up from an easier exercise, beaten their personal best, or what they did last time. Kinellect computes them from the workout completions you report. It returns facts only and never writes the sentence. No model or connector is called, nothing is stored, and the result is never cached, so every read reflects your latest completions and corrections.

Routes

Workout Route Scope
A completed daily plan GET /v1/subjects/{subject_ref}/daily-plan-operations/{operation_ref}/progress-signals coaching:read
A completed workout draft, standalone or prepared in a conversation GET /v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}/progress-signals workout:read

Use the same operation_ref you poll. Both routes return the same shape:

{
  "signals": [
    {
      "exercise_ref": "pull-up",
      "kind": "level_up",
      "easier_exercise_ref": "scapular-pull-up",
      "prescription_type": null,
      "completed_value": null,
      "prescribed_value": null,
      "previous_best_value": null,
      "performed_at": "2026-10-08T17:40:00.000000+00:00"
    },
    {
      "exercise_ref": "push-up",
      "kind": "personal_best",
      "easier_exercise_ref": null,
      "prescription_type": "count",
      "completed_value": 12,
      "prescribed_value": null,
      "previous_best_value": 10,
      "performed_at": "2026-10-08T17:40:00.000000+00:00"
    },
    {
      "exercise_ref": "plank",
      "kind": "last_time",
      "easier_exercise_ref": null,
      "prescription_type": "time",
      "completed_value": 40,
      "prescribed_value": 30,
      "previous_best_value": null,
      "performed_at": "2026-10-06T07:15:00.000000+00:00"
    }
  ]
}

Every key is always present, and keys that do not apply to the kind are null. A count value is repetitions and a time value is seconds. Signals follow the workout order (warm-up, main, cooldown). An exercise without a signal is left out, and a plan without a workout or a prepared mobility session returns an empty list.

What each kind means

Each exercise gets at most one signal, chosen in this order:

  1. level_up: the user has not done this exercise in the history below, but has done an easier exercise linked to it. easier_exercise_ref names the easier exercise and performed_at says when they last did it.
  2. personal_best: the latest result for this exercise beats every earlier one. completed_value is the new best and previous_best_value the one it beat. The first time an exercise is done is never a personal best, and an equal result is not one either.
  3. last_time: what the user did the last time: completed_value against prescribed_value.

Results compare only for the same exercise_ref with the same prescription_type, so repetitions are never compared with seconds. Only performed results with a completed_value of at least 1 count. Per-set detail and added weight are not part of the completion event, so they play no part.

Which history counts

  • The latest 50 current completions you sent with POST /v1/events.
  • Only completions that happened before today in the user's time zone, the time_zone of their latest Subject context. A workout finished earlier today does not count until the user's local midnight.
  • A higher activity_revision replaces the earlier one, and a resent event counts once.

Level up uses the relationships your connector returns for exercises. An exercise is easier than X when X lists it in regression_refs, or when it lists X in progression_refs and it was part of the catalog Kinellect resolved for that plan or draft.

  • For a plan built from one of your existing workouts, Kinellect resolves only that workout's own exercises, so declare regression_refs on the harder exercise.
  • A plan or draft stored without its exercise catalog, such as a plan created before catalogs were stored, gets no level_up. Personal best and last time still work.

Errors

Status Meaning
404 The Subject is unknown or belongs to another client. On the daily-plan route, also an unknown daily plan.
409 subject_deleted The Subject was deleted.
422 daily_plan_not_completed The daily plan is not completed: it is still queued or running, or it failed, was cancelled or expired. Poll the plan, and read signals only once it is completed.
422 workout_draft_not_completed The Operation holds no completed draft for this Subject: it is unknown, belongs to another Subject, is still running, or failed.

Workouts you pick from your own catalog outside a daily plan or draft are not supported yet.

Goals

With goal.plan enabled, your app can send a user's goal in their own words. The coach proposes a ladder of milestones toward it, and the user approves it in your app before it becomes their active goal. The feature needs no connector support. The live goal-ladder evaluation has passed, so goal.plan can be enabled for real users.

With goal.progress as well, reported workouts move the user along the ladder, and the coach may ask the user to confirm a milestone. See Progress from reported workouts.

Routes

Step Route Scope
Ask for a ladder POST /v1/goals coaching:write
Poll the planning Operation GET /v1/subjects/{subject_ref}/goal-operations/{operation_ref} coaching:read
Activate a proposal POST /v1/subjects/{subject_ref}/goals/{goal_ref}/activate coaching:write
Read the active goal GET /v1/subjects/{subject_ref}/goal coaching:read
Read a workout's goal progress (goal.progress) GET /v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}/goal-progress coaching:read
Answer a confirmation question (goal.progress) POST /v1/subjects/{subject_ref}/goal-questions/{question_ref}/answer coaching:write
Record a body reading (goal.progress) POST /v1/subjects/{subject_ref}/body-measurements coaching:write
List body readings GET /v1/subjects/{subject_ref}/body-measurements coaching:read
Delete a body reading DELETE /v1/subjects/{subject_ref}/body-measurements/{measurement_ref} coaching:write

Without goal.plan in the active configuration, POST /v1/goals and the activate route answer 422 with goals_not_enabled and create nothing. POST /v1/goals is admitted and metered as the goal.plan capability (see Admission and usage limits), and a hard admission maximum answers 429. Activation, answers and the reads are not metered. For the per-Operation usage ceiling: one planning attempt with its repair reserves about 27,000 tokens for typical inputs, and about 103,000 when the goal and all your configuration and context texts are at their byte limits. With goal.progress in the active configuration, a new goal is also told about the person's active goal (achieved or not) as it is when planning runs: its title and description, its reached steps, current step and weeks active. It is also told the newest body readings (see Body readings). That raises the typical figure to about 31,000 and the at-limit figure to about 120,400. This is not an upper bound: text with quotes or control characters is escaped and counts more bytes, and the active goal's texts are limited in characters, so non-ASCII text there counts up to 4 bytes per character. A provider retry adds its own reservation. Ask the Kinellect team for starting values.

Asking for a ladder

Send the user's goal as goal_text, with an Idempotency-Key:

{
  "subject_ref": "0b9e3c1a-7a52-4c1e-9d3f-2f6a1c8e5b47",
  "goal_text": "I want to do my first strict pull-up before summer."
}

goal_text is 1 to 1000 UTF-8 bytes, not blank and without NUL. Kinellect doesn't interpret it and passes it unchanged to the model. It is separate from primary_goal in the Subject context: nothing copies or syncs between the two. A field in your app such as "what do you want to reach?" is the intended source.

The answer is 202 with a GoalOperation and a Location header. The model writes the ladder from goal_text, parts of the user's current Subject context, and your configuration's client and product descriptions, coaching domain, tone, terminology and coaching guidance. While goal.plan stays enabled, repeating the request for the same user with the same key and body returns the original Operation, and the same key for the same user with another goal_text answers 409.

Polling

Poll the Operation until it ends. When state is completed, goal holds the proposal:

{
  "operation_ref": "5d0c2f8e-1b7a-4e39-8c64-3a9f0e2d7b15",
  "goal_ref": "9a4e6b2c-3d18-4f07-b5e1-6c2d8f9a0e34",
  "state": "completed",
  "goal": {
    "goal_ref": "9a4e6b2c-3d18-4f07-b5e1-6c2d8f9a0e34",
    "state": "proposed",
    "title": "First strict pull-up",
    "success_description": "One strict pull-up from a dead hang, chin over the bar.",
    "starting_point": "Can hold a dead hang for 20 seconds and do 8 inverted rows.",
    "overall_estimate_weeks": {"min": 8, "max": 14},
    "milestones": [
      {
        "milestone_ref": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
        "position": 1,
        "title": "Solid hang and scapular pulls",
        "success_description": "A 40-second dead hang and 3 sets of 10 scapular pulls.",
        "state": "planned",
        "estimate_weeks": {"min": 2, "max": 4},
        "remaining_estimate_weeks": {"min": 2, "max": 4}
      },
      {
        "milestone_ref": "f2a3b4c5-d6e7-4f8a-9b0c-1d2e3f4a5b6c",
        "position": 2,
        "title": "Slow negatives",
        "success_description": "3 sets of 3 negatives lasting 5 seconds each.",
        "state": "planned",
        "estimate_weeks": {"min": 5, "max": 9},
        "remaining_estimate_weeks": {"min": 5, "max": 9}
      },
      {
        "milestone_ref": "a3b4c5d6-e7f8-4a9b-8c1d-2e3f4a5b6c7d",
        "position": 3,
        "title": "First strict pull-up",
        "success_description": "One strict pull-up from a dead hang, chin over the bar.",
        "state": "planned",
        "estimate_weeks": {"min": 8, "max": 14},
        "remaining_estimate_weeks": {"min": 8, "max": 14}
      }
    ]
  },
  "error_code": null,
  "error_message": null,
  "created_at": "2026-10-27T18:02:11.000000+00:00",
  "finished_at": "2026-10-27T18:02:19.000000+00:00"
}

goal always shows the goal as it is now. A proposal that a later proposal or an activation replaced shows state superseded, and an activated one shows active.

When planning fails

error_code Meaning What to show
goal_not_plannable The model declined the goal, as outside training and movement or unsafe as stated. Kinellect doesn't check that judgement and doesn't repair a decline. A new request with the same goal_text is a new judgement and may be declined again. Ask the user to reword their goal.
model_failed No valid ladder could be written: the ladder still broke a structural rule after one repair, the model provider kept failing, or a usage-policy ceiling refused the model call. Try again later. If it repeats, check your goal.plan usage limits.
subject_context_unavailable No Subject context valid at that moment was stored when the work ran. Goal planning doesn't pull one through context.resolve. Send a context, then ask again.
operation_cancelled, operation_expired The Operation was cancelled or expired. Try again later.

error_message is a fixed sentence: "The goal cannot be planned as a training path as stated." with goal_not_plannable, and "The goal could not be planned safely." with every other code.

The ladder

  • The model writes the goal's title, success_description, starting_point and overall_estimate_weeks, and up to 7 steps toward it. Kinellect adds the goal itself as the last milestone, so a ladder has 1 to 8 milestones and always ends at the goal, with the goal's title, success description and overall estimate.
  • Code checks the ladder's structure and bounds, not its wording.
  • Text limits are in characters: title at most 120, success_description and starting_point at most 500. For a byte budget, count up to 4 bytes per character in UTF-8.
  • Week estimates are whole weeks from the day the user starts the ladder until they can expect to reach that milestone (1 to 104). They are estimates, not deadlines. They don't decrease along the ladder, and no milestone's max exceeds the goal's overall_estimate_weeks.max.

Weeks remaining

remaining_estimate_weeks is on every milestone:

  • On a proposed goal, and on a goal superseded before it was activated, it equals estimate_weeks.
  • On an active or achieved goal, it is estimate_weeks less the whole weeks since the goal was activated, and never below 0, on every milestone that isn't reached. Estimates count from the start of the ladder, so a planned milestone counts down too: it means "about this many weeks from now until this one". A reached milestone shows 0, so on an achieved goal every milestone shows 0.
  • On a goal superseded after activation, it stops counting when the goal was superseded.

Activating a proposal

Show the proposal to the user. When they approve it, call the activate route with an Idempotency-Key and no body. Only the last proposal to complete can be activated (see below). The answer is 200 with the goal: it is now active, its first milestone is current and every other milestone is planned. If the user had an active or achieved goal, it becomes superseded.

Answer When
200 with the goal as it is now You repeat the request for the same goal with the same key while goal.plan stays enabled. After a later activation the goal shows superseded.
409 The key already activated another goal of the user.
409 goal_not_proposed The goal is still being planned, or its planning failed.
409 goal_superseded A proposal that completed later, or another activation, replaced it.
409 goal_already_active It is already the active goal (with a new key).

When a proposal completes, every other proposal of the user that is neither active nor superseded becomes superseded. This goes by completion order, not request order: if an earlier request completes later, its proposal is the one you can activate. An active goal stays active until the user activates another proposal.

Without goal.progress, nothing moves the user along the ladder, except a check that was already being judged when you turned it off. With it, see Progress from reported workouts.

Reading the active goal

GET /v1/subjects/{subject_ref}/goal returns {"goal": …} with the active goal, or {"goal": null} when the user has none. remaining_estimate_weeks is computed on every read. With goal.progress, milestones can be reached, and a goal whose last milestone was reached is achieved. An achieved goal is still returned here until the user activates another proposal.

Progress from reported workouts

With goal.progress, the workouts you report with workout.completed move the user along their active goal's ladder. Enabling it needs goal.plan and exercise.resolve too: otherwise activation answers 422 with goal_progress_bundle_incomplete. Apart from exercise.resolve, it needs no connector support: a check makes at most one exercise resolve per attempt, through your connector or your uploaded exercise catalog. The live goal-progress evaluation has passed for the current judge, so goal.progress can be enabled for real users.

How it works:

  1. You report a workout with workout.completed as you do today. The completion response doesn't change, and the completion doesn't wait for a judgment.
  2. When the completion completes and the user has an active goal that isn't achieved, Kinellect records a progress check for the milestone that was current at that moment.
  3. A background worker judges the check. It reads the ladder, this workout's results, rating and note, and the newest results of up to 50 of the user's other current workout completions that occurred from when that milestone became current up to this workout (at most 20 exercises, 10 results each and 100 in all). For each kind of body reading, it also reads the newest reading at or before the goal's activation, or else the oldest after it, plus up to seven newer readings after activation and not after the check started. It then resolves the exercise names and asks the coach once. The user's note counts as evidence, so what the user writes can move the ladder. Code checks only the judgment's structure and the references it cites, never its wording.
  4. You read the result from the goal-progress route of that workout completion.

Reading the progress

GET /v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}/goal-progress takes the workout completion Operation from POST /v1/events. It needs coaching:read and no capability, so progress stays readable after you turn goal.progress off.

  • Until the workout completion is completed, it answers 422 with workout_completion_not_completed, also when the completion failed, was cancelled or expired.
  • {"goal_progress": null} means no check applies: the active configuration didn't enable goal.plan, goal.progress and exercise.resolve when the completion completed, the user had no active goal or it was already achieved, or the completion was superseded before it completed.
  • Otherwise goal_progress.state is pending until the check is judged. Poll until it is judged with an outcome, or not_judged with a not_judged_reason. Its state, outcome and not_judged_reason don't change after that. Its question always shows the question as it is now.
{
  "state": "judged",
  "goal_ref": "9a4e6b2c-3d18-4f07-b5e1-6c2d8f9a0e34",
  "milestone_ref": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
  "outcome": "question_asked",
  "not_judged_reason": null,
  "question": {
    "question_ref": "c7d8e9f0-a1b2-4c3d-8e4f-5a6b7c8d9e0f",
    "milestone_ref": "e1f2a3b4-c5d6-4e7f-8a9b-0c1d2e3f4a5b",
    "text": "You held the hang for 38 seconds today. Can you hold a 40-second dead hang now?",
    "answers": ["reached", "not_yet"],
    "state": "open",
    "answer": null,
    "offered_at": "2026-11-02T17:40:12.000000+00:00",
    "expires_at": "2026-11-09T17:40:12.000000+00:00"
  }
}
outcome Meaning
unchanged Nothing moved. This includes a check where the coach wanted to ask, but a still-current workout completion had already offered a question about the same milestone in the last seven days.
milestone_reached The milestone is reached and the next one is current.
goal_achieved The milestone was the goal itself, so the goal is achieved. It is still the goal that GET /v1/subjects/{subject_ref}/goal returns, and no further check is recorded for it.
question_asked The coach offers one question about the milestone, in question.

A reached milestone is never moved back, also when a body reading it rested on is deleted later.

not_judged_reason Meaning
usage_limit_reached The goal.progress admission policy refused the check, or its usage policy refused the model call.
exercise_names_unavailable The exercise resolve failed.
model_failed The evidence didn't fit one model message, the provider failed, the answer didn't have the required shape or failed the code check, or the check ran out of attempts or time.
goal_changed Another workout, an answer or an activation moved the goal or its current milestone first.
workout_superseded A later revision of the workout arrived first.
measurement_deleted A body reading the judgment cited to mark the milestone reached was deleted first.
goal_progress_disabled The active configuration no longer enabled the three capabilities when the check ran.
operation_cancelled The check's Operation was cancelled.
operation_expired Reserved. Not returned today.

A check that wasn't judged isn't retried. The next reported workout is judged with everything recorded by then.

Confirmation questions

A question is model-written text of 1 to 300 characters. Code checks only that limit and that it isn't blank, never its wording. Show it with two answers: reached and not_yet, always in that order.

To answer, call POST /v1/subjects/{subject_ref}/goal-questions/{question_ref}/answer with an Idempotency-Key and {"answer": "reached"} or {"answer": "not_yet"}. It needs coaching:write and both goal.plan and goal.progress in the active configuration (422 goal_progress_not_enabled otherwise). The answer is 200 with the question and its goal as they are after the answer.

  • reached marks the milestone reached and makes the next one current, or, for the last milestone, marks the goal achieved.
  • not_yet changes nothing. A later workout may ask about the milestone again once seven days have passed since this question was offered.

A question's state is derived on every read. It is the first of these that applies, in this order: answered, withdrawn, expired, otherwise open.

state When
answered It has an answer. Answering again answers 409 question_answered.
withdrawn Its goal is no longer active or is achieved, its milestone is no longer current, or a later revision of the workout that offered it arrived. Answering answers 409 question_withdrawn.
expired Seven days passed since offered_at (see expires_at). Answering answers 409 question_expired.
open It can be answered.

At most one question about a milestone is offered every seven days. Only questions offered by workout completions that are still current count, so a later revision of the workout that offered a question frees the slot.

While goal.plan and goal.progress stay enabled, repeating the answer with the same key and body returns 200 with the question and goal as they are now. The same key with another question or answer answers 409.

Usage limits

Give goal.progress its own admission and usage policies (see Admission and usage limits). Each attempt of a check makes at most one exercise resolve of up to 20 references and one model call, which reserves its request bytes plus 3,000 output tokens. A check whose worker is lost is run once more, and that attempt reserves again.

  • 8,957 to 9,854 request bytes in the evaluation scenarios, so at most 12,854 tokens;
  • 70,728 bytes with every input at its limit, so 73,728 tokens;
  • 75,929 tokens for the largest request that can be sent at all, with a full model message. An operation_token_maximum of 80,000 covers that.

Text with quotes or control characters is escaped and counts more bytes. Evidence that grows past one model message fails the check as model_failed before the model call, and nothing is reserved. Goal and milestone texts are limited in characters, not bytes, so a goal whose texts are at full length in non-Latin characters or emoji can be too long to judge when the other inputs are also near their limits. Its checks then end model_failed and offer no new question until the other inputs are smaller or a goal with shorter texts is activated. A question offered earlier can still be answered and moves the goal.

Size the daily maximum for one check per reported workout. When admission is refused, the check is recorded at once as not_judged with usage_limit_reached, without an Operation. The workout result is never affected.

Body readings

With goal.progress, your app can record the body weight and waist readings a person takes, so a goal like losing weight can be planned from where they are, and progress checks can see how the readings change. Kinellect computes no trend from them.

POST /v1/subjects/{subject_ref}/body-measurements with an Idempotency-Key records one reading:

{"kind": "body_weight", "value": 78.4, "unit": "kg", "measured_at": "2026-11-06T07:30:00Z"}
  • kind is body_weight in kg (20.0 to 400.0) or waist in cm (30.0 to 250.0). Kinellect accepts no other unit, so convert pounds and inches before sending. value is a number with at most one decimal place. The bounds only refuse impossible values; they say nothing about whether a reading is healthy.
  • measured_at is when the person took the reading. A time more than 300 seconds in the future or more than 366 days old answers 422 with measured_at_out_of_range. Several readings of one kind may share a day or a time.
  • The response is 201 with {"body_measurement": …}, including its measurement_ref. While goal.plan and goal.progress stay enabled, repeating the request with the same key and body returns 200 with the stored reading. The same key with another body answers 409, and the same key after the reading was deleted answers 409 with body_measurement_deleted, so a retry never brings a deleted reading back.
  • It needs both goal.plan and goal.progress in the active configuration (422 with goal_progress_not_enabled otherwise, also for a repeated key).

Recording a reading starts no progress check; the next reported workout reads it (see How it works). When a goal is planned, the coach is told the three newest readings of each kind measured at or before planning starts, each with the days since it was measured.

GET /v1/subjects/{subject_ref}/body-measurements lists readings newest first by measured_at. kind limits it to one kind, and limit is 1 to 100 (default 50). Pass next_before as before for the next page; it is null on the last page. A before that is unknown or deleted since answers 404, so start again from the first page.

DELETE /v1/subjects/{subject_ref}/body-measurements/{measurement_ref} with an Idempotency-Key deletes a reading and answers 204, also when it was already deleted. Kinellect removes its kind, value and measured time at once, so no later read, plan or retry sees them. Deleting a reading never moves a milestone already reached back, and a goal it helped plan does not change. A progress check whose judgment cited that reading to mark a milestone reached, and whose result isn't applied yet, ends not_judged with measurement_deleted, so the ladder does not move on it. Erasing a Subject deletes all its readings.

Listing and deleting need no capability, so readings stay readable and deletable after you drop goal.progress.

What goals change elsewhere

Outside these routes, goal.plan and goal.progress are only named in two lists of enabled capabilities that the model reads: in the coach instruction of a chat Turn and in client.enabled_capabilities of every workout-generation request. With goal.progress, a workout completion also records a progress check when it completes. Recording it makes no provider or connector call, but it takes a lock shared by your whole tenant environment, so completions that record a check at the same moment wait for each other briefly. The check itself runs afterwards in the background and makes at most one exercise resolve (through your connector or uploaded catalog) and one model call per attempt. Changing primary_goal, including through profile.goal.update in chat, leaves the active ladder as it is.

Errors on every goal route

Unknown and cross-tenant Subjects, Operations and goals answer 404. A paused client answers 403 with client_paused. On POST /v1/goals, the activate route and the active-goal read, a deleted Subject answers 409 with subject_deleted. All three POST routes need a valid Idempotency-Key (400 without one, see Idempotency), and an invalid or unknown field in POST /v1/goals answers 422. On the activate route, a missing goal.plan answers 422 before the goal is looked up, so an unknown goal then also answers 422. The goal-progress route answers 404 for an Operation that isn't a workout completion. On the answer route, a missing goal.plan or goal.progress answers 422 before the question is looked up, so an unknown question then also answers 422. A question of another user answers 404, a deleted Subject answers 409 with subject_deleted, and an invalid or unknown field answers 422.

Review after a workout

Requires workout.review, together with workout.generate and its generation policy. Without them, activation answers 422 with workout_review_requires_generation. Unless you use an uploaded exercise catalog, your connector must also list workout.review in its capabilities (422 connector_capability_unavailable otherwise), because it receives the saves of changed sessions.

After each finished workout, your app can ask the coach whether the next session it planned should stay as it is or change. The coach answers keep or change, with a one-line reason the user reads right after the session. A change comes with the changed workout and a note per move. The user saves a change like any other workout, through Workout acceptance. Nothing reaches your system until they do, and on any failure your app keeps the session it planned.

Routes

Route Scope Purpose
POST /v1/workout-reviews workout:write Ask for a review of a finished workout. Needs workout.review.
GET /v1/subjects/{subject_ref}/workout-review-operations/{operation_ref} workout:read Poll a review. Needs no capability.
GET /v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}/workout-review workout:read Read the review of a workout completion. Needs no capability, so reviews stay readable after you turn workout.review off.

Asking for a review

  1. Report the workout with workout.completed as you do today (see Workout completion). The completion response doesn't change.
  2. Poll the completion Operation until it is completed.
  3. Send the review request with an Idempotency-Key:
{
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "completion_operation_ref": "44444444-4444-4444-8444-444444444444",
  "next_session": {
    "supersets": [
      {
        "order": 1,
        "rest_between_cycles_seconds": 60,
        "workout_exercises": [
          {
            "exercise_ref": "glute-bridge",
            "order": 1,
            "sets": 3,
            "rest_before_seconds": 0,
            "prescription": {"type": "count", "repetitions": 12}
          }
        ]
      }
    ]
  },
  "target_duration_minutes": null
}
  • completion_operation_ref is the operation_ref that POST /v1/events returned for the finished workout.
  • next_session is the session your app planned next, in the base_workout shape of Changing a workout. There is no adjustment and no requested_change. The body is strict, so any other field answers 422.
  • target_duration_minutes is optional, from 5 to 180. Without it, your policy's duration interval and the user's coaching-mode ceiling apply, as for a draft. With it, the 80% to 120% band of a draft target applies (48 × T to 72 × T seconds), narrowed to your policy interval. Kinellect never widens your interval. When the band and your interval don't overlap, the request is still accepted, and the review fails with review_validation_failed and duration_out_of_range before any exercise lookup or model call. An explicit null is the same as not sending it.

The answer is 202 with a workout.review Operation, under your workout.review admission policy. Poll the Location URL.

A completion that isn't completed yet answers 422 with workout_completion_not_completed. This covers one that is still queued or running, and one that failed, was cancelled or expired. Poll the completion and ask again, or keep the planned session. When a later activity_revision of the same workout replaced the completion, the request answers 422 with workout_completion_superseded. The newer revision is a completion of its own, and you can ask for its review.

One review per completion

  • While a completion's review is queued, running or completed, a request with another Idempotency-Key answers 409 with workout_review_exists. Read that review from the completion's workout-review route. You don't need the review's own operation_ref for that.
  • The same key with the same body returns the original Operation. The same key with a different body answers 409.
  • A review that failed, was cancelled or expired frees the completion, so a request with a new key can ask again.
  • When the user edits the next session after a review, nothing reviews it again. Their edit stands.
  • A review still queued or running past its 300-second deadline reads as expired with operation_expired on both read routes. The next request for that completion with a new key ends it and starts a new review, unless an earlier check or your admission policy refuses that request. Then the old review stays stored as it was.

Reading the review

Every key of the Operation is always present:

{
  "operation_ref": "55555555-5555-4555-8555-555555555555",
  "state": "completed",
  "completion_operation_ref": "44444444-4444-4444-8444-444444444444",
  "review_ref": "66666666-6666-4666-8666-666666666666",
  "decision": "keep",
  "reason": "You finished every set with room to spare, so the next session stays as planned.",
  "workout": null,
  "base_changes": null,
  "move_changes": null,
  "estimated_duration_seconds": null,
  "catalog_version": "2026-10-01",
  "stage": null,
  "error_code": null,
  "error_message": null,
  "validation_codes": [],
  "created_at": "2026-11-04T08:00:00.000000+00:00",
  "finished_at": "2026-11-04T08:00:21.000000+00:00"
}
  • state is queued, running, completed, failed, cancelled or expired. stage is for display only, as for a draft.
  • decision keep means the user does next_session as planned. workout, base_changes, move_changes and estimated_duration_seconds are null, and there is nothing to save.
  • decision change means your app runs workout instead. workout is a workout draft. base_changes compares next_session and workout by exercise_ref, as for a draft with base_workout. estimated_duration_seconds is the length of workout as a draft reports it, or null when a count exercise has no seconds per repetition.
  • reason is model-written text of at most 160 characters. Code checks only its length and that it isn't blank, never its wording.
  • move_changes lists each exercise of next_session in its order, then each added exercise of workout. Kinellect pairs them, not the model. Each entry is {change, planned_exercise_ref, exercise_ref, note}:
change Meaning
unchanged The planned exercise stays as it was.
changed The planned exercise stays, with other sets, prescription or rest before it.
swapped The planned exercise is replaced by one of its progression_refs or regression_refs.
removed The planned exercise is left out. exercise_ref is null.
added A new exercise. planned_exercise_ref is null.

note is the coach's note on that move, at most 120 characters, or null. A swap has at most one note.

Saving a change

Save a change with POST /v1/workout-acceptances and source_kind review_generated. Set source_operation_ref to the review's operation_ref and source_ref to its review_ref. Every action and approval rule of Workout acceptance applies. A review that decided keep answers 422 with source_unavailable. A review of a completion that a later activity_revision replaced answers 422 with source_noncurrent.

Your connector receives a review_generated save as generated_workout, exactly like a standalone_generated one. Kinellect sends it only while your configuration enables workout.review. With an uploaded exercise catalog, Kinellect confirms the save itself, and workout_ref is the review_ref.

When a review fails

A failed, cancelled or expired review carries an error_code, and your app keeps the session it planned. error_message is always the fixed sentence "The workout review could not be completed safely; keep the planned session."

  • review_validation_failed: the review broke a rule that wasn't fixed, either after its one repair or because no time was left for one, or the target band didn't overlap your policy interval. validation_codes names each rule, the review's own codes first and then the workout validation codes of a draft.
  • usage_limit_reached: your workout.review usage policy refused the model call.
  • workout_review_disabled: workout.review left your active configuration before the review ran.
  • workout_completion_superseded: a later activity_revision of the workout arrived before the review finished.
  • operation_expired: the review passed its 300-second deadline.
  • generation_request_too_large: what Kinellect would send to the model for this review is larger than one model request. That is chiefly the next session's exercises and the exercises found beside them in your connector or uploaded catalog, with their relationships and safety identifiers, together with your client profile, the user context, coach memory, this session's results and note, earlier results, the exercise limits and the goal step. Nothing was sent to the model, no usage was reserved, and Kinellect doesn't retry it; keep the planned session. validation_codes is empty. The completion is free again, so a request with a new Idempotency-Key can ask again, but it fails the same way until that evidence gets smaller, for example when your connector or catalog returns fewer or smaller exercises. Before this code existed, the same failure was reported as provider_unavailable. If your client checks error_code against a fixed list, add the new value. When only the repair request is too large, the review fails with review_validation_failed and the first attempt's codes, as when no time is left for a repair.
  • The other codes, such as provider_unavailable, empty_candidate_set or execution_deadline_exceeded, mean what they mean for a workout draft.

How the coach decides

A background worker reads:

  • the finished workout's results, rating and note (the first 20 results, and the note up to its first 2,000 bytes);
  • up to five earlier results of each exercise in the finished workout and in next_session, at most 40 in all, from the user's 50 most recent current workout completions before this one;
  • the user's current exercise limits from recent workout feedback;
  • the active goal's current milestone, when goal.plan is enabled;
  • up to eight coach memory entries, as a draft does.

It looks up exercises exactly as a draft with base_workout does: one exercise search and one exercise resolve, through your connector or your uploaded catalog. Then it asks the coach. An answer that breaks a rule gets one repair with every code it broke, when enough time is left before the deadline, and nothing is repaired again after that.

Code checks the reason and notes for length and for the exercises they refer to, and it checks a changed workout with the same validator as a draft, including your length band and the user's hard exclusions. A keep is refused when an exercise of next_session can no longer be offered to the user, for example after a new limit, or when your connector no longer returns it, so the coach must change the session. Code never checks the wording, or whether keeping or changing the session, or the direction of a change, is right for the user. The live workout-review evaluation, which includes coach memory, measures those on fixed scenarios. It passed before release, so workout.review can be enabled for real users.

Usage limits

Give workout.review its own admission policy (see Admission and usage limits). A usage policy is optional. If you only count reviews, an admission policy alone is enough.

Each attempt of a review makes at most two model calls: the answer and one repair. If a run is interrupted, Kinellect runs the review again within its 300-second deadline, and that attempt reserves again. Each call reserves its request bytes plus 6,000 output tokens. A repair also carries the codes it must fix, so it reserves slightly more than the first call:

  • 25,731 to 27,112 request bytes in the evaluation scenarios, so at most 33,112 tokens for the first call;
  • 66,967 request bytes with every input at its limit and eight coach memories, so 72,967 tokens for the first call.

A finished call then counts at the usage the provider reported (see Sizing usage limits), so a repair adds its own reservation to far less than the first one. An operation_token_maximum of 146,000 covers one attempt with its repair at every input limit, when the provider reports the first call's usage.

These aren't upper bounds: text with quotes or control characters is escaped and counts more bytes. Evidence that grows past one model message fails before the model call with generation_request_too_large and reserves no usage, and asking again with the same inputs fails the same way.

Errors on the review routes

Unknown and cross-tenant Subjects and Operations answer 404, and so does a completion_operation_ref that isn't a workout completion. A paused client answers 403 with client_paused. On POST /v1/workout-reviews, a deleted Subject answers 409 with subject_deleted, a missing or invalid Idempotency-Key answers 400, and a missing workout.review answers 422 with workout_review_not_enabled. A refused admission answers 429. The completion's workout-review route answers 422 with workout_completion_not_completed until the completion is completed, and then returns {"workout_review": …}: the completion's newest review, or null when it has none.

Branch on detail, not on the HTTP status.

Week plan

Requires week.plan, together with daily.decide. Without daily.decide, activation answers 422 with week_plan_requires_daily_decide. It needs no connector support.

Your app can ask the coach to plan the open days of a user's week, Monday to Sunday. Each open day becomes a training, mobility or rest day. A session day has a title, a scope, the minutes as planned with a shorter and a longer option, and a coach reason. A rest day has a coach reason. Your app shows the week, and today's daily plan follows it. Nothing in your system changes.

What the week plan does today:

  • Your app asks for it. Kinellect never starts a week plan on its own, for example after a goal activation or a context change.
  • Today's daily plan follows the plan's day for today, after the daily safety and recovery rules (see Today follows the plan).
  • Your app can move a session to another day, pick its shorter or longer option, or skip a day (see Changing days). A day the user changed stays theirs.
  • A missed day doesn't rearrange the week. Ask again when the week should change.
  • The coach in chat can't change the week plan yet.

Routes

Route Scope Purpose
POST /v1/week-plans coaching:write Ask for a plan of the open days of the user's week. Needs week.plan.
GET /v1/subjects/{subject_ref}/week-plan-operations/{operation_ref} coaching:read Poll a week plan request.
GET /v1/subjects/{subject_ref}/week-plan coaching:read Read the plan of one week. Needs no capability, so a plan stays readable after you turn week.plan off.
POST /v1/subjects/{subject_ref}/week-plan/days/{date}/changes coaching:write Move, resize or skip one future day. Needs week.plan.

When to ask

Good moments to ask for a new week plan:

  • on Monday, before you request that day's daily plan;
  • after the user finishes setup;
  • after a new context version that changes the user's available days, their goal or their sessions a week.

A daily plan never waits for the week plan. It follows the plan only when the plan already has a day for today at the moment Kinellect accepts the daily plan request. Today is open for the week plan only until a daily plan has decided it, also while the week plan runs. If you want today to follow the week plan, request the daily plan only after the week plan's Operation has completed.

Asking for a plan

The user's current Subject context must carry daily_context. Send the request with an Idempotency-Key:

{
  "subject_ref": "7c1f2a4e-2b8d-4f3a-9a51-0d6e4b3c2a10",
  "requested_change": "I'm travelling on Thursday, keep that day light."
}
  • requested_change is optional: the user's own words about this week, 1 to 500 UTF-8 bytes, not blank. Kinellect passes the words to the coach unchanged and never interprets them. Send null or leave it out when the user said nothing.
  • The week is the Monday week of the context's local_date.

The answer is 202 with a week.plan Operation, under your week.plan admission policy. Poll the Location URL.

Which days are open

Kinellect sets the open days itself from its own records, never from the request. The open days are the context's local_date through Sunday, except:

  • a day that daily_context lists as a completed workout or mobility session;
  • today, once a daily plan has decided it;
  • a day the user set through a day change.

Earlier days of the week are never open. When no day is open, the request answers 422 with week_plan_no_open_dates.

One request at a time

  • Only one request per user and week can be queued or running. Another one answers 409 with week_plan_in_progress. Keep polling the Operation you already have, then read the week.
  • A request still queued or running after its 300-second deadline is ended by the next request for that week, which then continues.
  • The same key with the same body, configuration, context version, local date and week returns the original Operation, even while that request is still running. The same key with anything else answers 409.
  • Asking again for a week that already has a plan writes the new plan over the coach's days that are still open, and the plan's revision goes up by one. Days that are no longer open keep what they had. A day the user set is never open, so a new plan never changes it.

Reading the result

Every key of the Operation is always present. result is null until the state is completed. Then it is the week's plan as it is now, so a later request shows its newer revision.

{
  "operation_ref": "66666666-6666-4666-8666-666666666666",
  "state": "completed",
  "result": {
    "week_plan_ref": "77777777-7777-4777-8777-777777777777",
    "week_start": "2026-11-09",
    "revision": 1,
    "context_version": 4,
    "currentness": "current",
    "days": [
      {"date": "2026-11-09", "kind": "unplanned", "state": "completed", "set_by": null, "title": null, "total_minutes": null, "shorter": null, "longer": null, "length": null, "scope": null, "coach_reason": null},
      {"date": "2026-11-10", "kind": "unplanned", "state": "past", "set_by": null, "title": null, "total_minutes": null, "shorter": null, "longer": null, "length": null, "scope": null, "coach_reason": null},
      {"date": "2026-11-11", "kind": "training", "state": "planned", "set_by": "coach", "title": "Full-body strength", "total_minutes": {"min": 30, "max": 40}, "shorter": {"min": 20, "max": 30}, "longer": {"min": 40, "max": 50}, "length": "planned", "scope": "Squats, push-ups and rows.", "coach_reason": "You're available today, and your last workout was on Monday."},
      {"date": "2026-11-12", "kind": "mobility", "state": "planned", "set_by": "coach", "title": "Easy mobility", "total_minutes": {"min": 10, "max": 15}, "shorter": {"min": 5, "max": 10}, "longer": {"min": 15, "max": 20}, "length": "planned", "scope": "Hips, back and shoulders.", "coach_reason": "A light day, as you asked for while travelling."},
      {"date": "2026-11-13", "kind": "training", "state": "planned", "set_by": "coach", "title": "Upper-body strength", "total_minutes": {"min": 30, "max": 40}, "shorter": {"min": 20, "max": 30}, "longer": {"min": 40, "max": 50}, "length": "planned", "scope": "Push-ups, rows and planks.", "coach_reason": "A day you prefer to train, with a lighter day before it."},
      {"date": "2026-11-14", "kind": "rest", "state": "rest", "set_by": "coach", "title": null, "total_minutes": null, "shorter": null, "longer": null, "length": null, "scope": null, "coach_reason": "A rest day after Friday's session."},
      {"date": "2026-11-15", "kind": "rest", "state": "rest", "set_by": "coach", "title": null, "total_minutes": null, "shorter": null, "longer": null, "length": null, "scope": null, "coach_reason": "You're not available on Sundays."}
    ]
  },
  "error_code": null,
  "error_message": null,
  "created_at": "2026-11-11T07:00:00Z",
  "finished_at": "2026-11-11T07:00:21Z"
}
  • days always holds the seven days from Monday to Sunday.
  • kind is training, mobility or rest, or unplanned when the plan has no day for the date, for example a day that was already settled when the plan was written.
  • total_minutes is the session as planned. shorter is the option for a day with less time: it starts no later and ends earlier. longer is the option for a day with more time: it starts no earlier and ends later. Every range lies between 1 and 180 minutes. A training day's ranges lie inside the whole minutes of your workout generation policy's duration interval, or 1 to 180 without one. An interval that holds no whole minute gives the two whole minutes around it, and when the interval spans fewer than three whole minutes, shorter and longer may end where total_minutes ends.
  • title is at most 60 characters, and scope and coach_reason at most 200. Show them in full.
  • set_by is coach for a day the coach planned, person for a day the user moved, resized or skipped (see Changing days), and null for an unplanned day.
  • length is the option the day follows: shorter, planned (total_minutes) or longer. A plan writes planned, and the user can pick another one. Today's daily plan and the next plan use the chosen option. It is null on a rest or unplanned day.
  • coach_reason is null on an unplanned day and on a day the user set, because the reason explained the coach's plan for that date.
  • A day the plan covered keeps its kind, set_by and texts after it becomes completed, decided or past. Read state for where the day stands.
  • revision goes up by one with every written plan of the week and every applied day change.
  • context_version is the context version the latest plan was made from.

Day states

Kinellect works out each day's state from its own records on every read. Today is the newest context's local_date, never the server clock.

state Meaning
completed The context lists a completed workout or mobility session on that date.
decided Today, once a daily plan has decided it.
past An earlier date without a completion. Kinellect has no signal that a session started, so a missed day also reads past.
planned A training or mobility day of the plan that is still ahead.
rest A rest day of the plan that is still ahead.
unplanned A day still ahead that the plan has no day for.

Reading the week later

GET /v1/subjects/{subject_ref}/week-plan returns {"week_plan": …}:

  • Without week_start, it returns the week of the newest context's local_date.
  • With week_start=YYYY-MM-DD, it returns that week. A date that isn't a Monday answers 422.
  • week_plan is null when the week has no plan or the user has no context.

currentness is current while the newest context is the version the plan was made from, and context_changed after a newer version arrives. Kinellect doesn't replan by itself. Ask for a new plan when the change matters to the week.

When a plan fails

A failed, cancelled or expired request carries an error_code and a fixed error_message. The week keeps the plan it had, if any.

  • model_output_invalid: the plan still broke a rule after its one repair.
  • model_failed: the model could not be reached, or the request didn't fit one model message, within the attempts and the 300-second deadline. A request that was still running when its deadline passed also fails with model_failed.
  • usage_limit_reached: your week.plan usage policy refused a model call.
  • subject_context_changed: a newer context version arrived after the request was accepted, even one that changes nothing about the week. Ask again, and avoid sending a new context while a plan runs.
  • week_plan_not_enabled: week.plan left your active configuration before the plan ran.
  • week_plan_no_open_dates: every open day was settled before the plan was written, also when the user set every remaining open day while the plan ran.
  • operation_cancelled: the request was cancelled, for example while your client was paused, or it was still queued when its 300-second deadline passed.

operation_expired is in the schema, but week plans don't produce it in this release.

Today follows the plan

With week.plan in your active configuration, POST /v1/daily-plans reads the week plan's day for today when Kinellect accepts the request, and the daily plan keeps that copy. A later revision of the week never changes a daily plan that was already accepted, and the daily plan never waits for a week plan that is still running.

The daily rules in Daily plans run first. Unusable recovery information, rest-only or mobility-only recovery, a context blocker, an unavailable day, a workout completed today, a met weekly target and disabled workouts keep their usual outcome and reasons. Only then does the plan's day decide:

Planned day Outcome Reason codes
training workout week_plan_session, with target_unattainable, onboarding_mode or returning_mode when they apply
mobility mobility, or rest when your daily policy doesn't enable mobility week_plan_mobility, with non_workout_preference when it falls back
rest rest, or mobility when your daily policy doesn't enable rest week_plan_rest, with non_workout_preference when it falls back

The content reasons and the workout_content_unavailable rest fallback in Daily plans still apply on top of these rows.

  • On a planned day, deferred_to_preferred_day, preferred_workout_day and target_at_risk never appear. A planned rest day stays rest even when the weekly target is at risk, and a planned training day is a workout also on a day that isn't a preferred day. A planned rest or mobility day keeps its kind whatever non_workout_preference says.
  • A policy that enables neither rest nor mobility fails a planned rest or mobility day with no_eligible_outcome.
  • The plan applies in every coaching mode, and also when its currentness is context_changed. The daily rules always read the current context.
  • A day the plan has no row for, a week without a plan, and a configuration without week.plan decide exactly as before.
  • reason_text gets the sentence "Your week plan has a training session today.", "Your week plan has mobility today." or "Your week plan has rest today."
  • The decision's sources include week_plan. Its reference is the plan's week_plan_ref and its version is the revision the day followed. Its fields are ["kind"], or ["kind", "title", "scope", "total_minutes"] when the planned session guided the generated workout or mobility session the plan carries.

When a day follows a planned training or mobility session and Kinellect generates its workout or mobility session, the planned title, scope and minutes guide the coach. The minutes are those of the day's chosen length. They are guidance, not limits: your workout generation policy's duration interval stays the bound, and the generated session passes the usual validation. Kinellect doesn't check that the session matches the title, scope or minutes. A workout picked from your own catalog follows the planned kind but not the planned session.

With daily.coach_note, the note on a day the coach planned and the plan decided also sees that day's kind, title and coach_reason, and its schema_version is daily_coach_note_v2. Every other note, including the note on a day the user set, is daily_coach_note_v1.

A daily plan that read a planned day also ties its Idempotency-Key to the plan's revision. After the week's next revision, including one from a day change, a replay of that key answers 409, and so does a replay of a key whose plan had no planned day when today now has one. Send a new key.

Changing days

Your app can change a future day of the plan for the user with POST /v1/subjects/{subject_ref}/week-plan/days/{date}/changes. {date} is the day to change, as YYYY-MM-DD, and its Monday week names the plan. Send the change with an Idempotency-Key:

{
  "action": "move",
  "to": "2026-11-14",
  "expected_revision": 3
}
  • move gives the session of {date} to the day to in the same week. to must be a later day of the same week that isn't completed and holds no session: a rest day, also one the user set, or a day without a plan. {date} becomes the user's rest day. Kinellect never swaps two sessions. The moved session keeps its title, scope, ranges and chosen length.
  • set_length picks one of the session's three options with length: shorter, planned or longer. All three ranges stay, so planned can be chosen again.
  • skip makes {date} the user's rest day. The day keeps its row, so a later plan can't put a session back. A day without a plan also becomes the user's rest day.
  • move needs to and takes no length, set_length needs length and takes no to, and skip takes neither. Anything else, an unknown field or an expected_revision below 1 answers 422 with a validation problem.
  • expected_revision is the revision of the week your app shows. When the week has another revision, the change answers 409 with week_plan_revision_changed. Read the week again and let the user try again.
  • To move a session and change its length, send two changes: the move, then set_length on the new day with the revision the move returned.

Only a day after the context's local_date that isn't completed can change, and only such a day can take a moved session. Today belongs to the daily plan, and earlier days never change.

The change is synchronous and makes no model call, so it creates no Operation and counts toward no usage limit. The answer is 200 with:

  • outcome: applied, or no_change when the day already was what you asked for, for example a skip of a day the user already made a rest day, or the length the day already has;
  • affected_dates: the days the change wrote, in calendar order. That is {date} and to for a move, {date} for the other actions, and none for no_change;
  • revision: the week's revision after the change. An applied change adds one. no_change leaves the week as it was and keeps the revision;
  • week_plan: the week as GET /v1/subjects/{subject_ref}/week-plan reads it now.

The same key with the same body returns the stored outcome, affected_dates and revision, with the week as it is now. The same key with another body answers 409. A refusal writes nothing, so a retry is checked again.

Days the user set

  • Every day a change writes has set_by person and coach_reason null.
  • A day the user set stays theirs. A new plan writes only the days still open and never a day the user set. A change made while a plan request runs goes through, and that plan then writes around it. Nothing hands a day back to the coach yet.
  • When the coach plans the rest of the week, it sees the days the user set with their kind and minutes.
  • Today's daily plan follows a day the user set like a day the coach planned, with the minutes of the chosen length.
  • Every applied change raises the week's revision. A daily plan key replayed after it answers 409, as after a new plan.

How the coach plans

A background worker asks the coach for exactly the open days. The coach reads:

  • the seven days of the week, with which days the user is available and prefers, what is already settled, and the kind and minutes of each day the user set;
  • the user's context: goal, experience, sessions a week, available and preferred days, equipment, safety constraints, completed workouts, mobility and recovery summaries, blocker, recovery state and coaching mode;
  • your client profile: its description, product, coaching domain, tone, terms and coaching guidance;
  • up to ten workouts reported in the last 14 days, with their minutes, rating and note;
  • requested_change, when you sent it;
  • the active goal's current milestone, when goal.plan is enabled;
  • up to eight coach memory entries, when memory.compile is enabled.

The coach offers only kinds your daily policy can decide. Rest is always offered. Training is offered when your daily policy enables workouts. Mobility is offered when it enables mobility and daily.mobility_session is on. The coach never plans a session on a day the user isn't available.

When the plan is written, Kinellect writes only the days that are still open, so a day the user changed while the plan ran keeps the change.

Code checks the plan's structure: each open day exactly once and no other day, only offered kinds, no session on an unavailable day, and the minute ranges and text lengths above. A plan that breaks a rule gets one repair with every rule it broke. A second failure ends the request with model_output_invalid. Code never checks the wording, the training load or how many sessions the week holds. The live week-plan evaluation measures those on fixed scenarios: that the week is safe for the user's recovery and constraints, stays within the sessions a week they chose, and states as fact only what the evidence shows. It passed before release, so week.plan can be enabled for real users.

Usage limits

Give week.plan its own admission and usage policies (see Admission and usage limits). Expect 1 to 4 plans per active user a week.

Each attempt makes at most two model calls: the answer and one repair. Each call reserves its request bytes plus 8,000 output tokens. A provider failure retries the attempt with the same request. A retry starts only when the earlier attempt's 110-second lease runs out, so at most three attempts fit in the 300-second deadline. A failed call counts at most its whole reservation (all of it when the provider reports no usage, for example a timeout), and the retry reserves again on top of it.

The request is 9,285 to 10,792 bytes in the evaluation scenarios, and 64,868 bytes with every input at its limit. Measured Operation totals, in tokens:

Plan Largest evaluation scenario Every input at its limit The same, goal milestone in four-byte characters such as emoji
Answer with its repair 37,967 146,119 149,839
Failed answer, then a retry with its repair - 218,987 224,567
Failed repair, then a retry with its repair 75,934 292,238 299,678
Two failed repairs, then a third attempt with its repair 113,901 - -

The worst place for a provider failure is the repair: when the provider reports no usage, the failed attempt keeps its whole reservation, so the retry with its repair doubles the total (2 x 149,839 = 299,678).

Set an operation_token_maximum of 300,000 for week.plan: 299,678 rounded up to the next 10,000. It covers one provider retry wherever it fails, with every input at its limit, and all three attempts of an evaluation-sized plan. A second retry near the input limits doesn't fit. Set a daily maximum of at least 300,000 plus about 38,000 for each week plan you expect in a UTC day. Under hard enforcement, a call that doesn't fit fails the plan with usage_limit_reached.

These aren't upper bounds: text with quotes or control characters is escaped and counts more bytes. A request that grows past one model message fails with model_failed.

Turning on week.plan also adds its name to the capability list that the coach reads in chat and in workout generation. That can move one chat tier, see Sizing usage limits. It also raises the daily plan's sizing when the daily plan generates workouts or writes a coach note, see Daily plans.

Errors on the week plan routes

Unknown and cross-tenant Subjects and Operations answer 404. A paused client answers 403 with client_paused. On POST /v1/week-plans and on the week read, a deleted Subject answers 409 with subject_deleted. On POST /v1/week-plans, a missing or invalid Idempotency-Key answers 400, and a refused admission answers 429. The other refusals of POST /v1/week-plans, in the order Kinellect checks them:

Status detail Meaning
422 week_plan_not_enabled Your active configuration doesn't enable week.plan.
422 subject_context_unavailable The user has no current context with daily_context.
422 local_date_changed The context's local_date is no longer the user's date.
409 week_plan_in_progress A request for the user's week is still queued or running.
422 week_plan_no_open_dates Every remaining day of the week is completed, decided or set by the user.

A day change checks, in this order: the body, which answers 422 with a validation problem before the path date is read; a {date} that isn't a real calendar date, which answers 404; a missing or invalid Idempotency-Key, which answers 400; an unknown Subject (404); a deleted Subject (409 with subject_deleted); week_plan_not_enabled (422); the Idempotency-Key replay; and then:

Status detail Meaning
422 subject_context_unavailable The user has no current context with daily_context.
422 local_date_changed The context's local_date is no longer the user's date.
422 week_plan_missing The week of {date} has no plan.
409 week_plan_revision_changed expected_revision isn't the week's revision. Read the week again.
422 week_plan_day_past {date} is before the context's local_date.
422 week_plan_day_today {date} is today, which only the daily plan decides.
422 week_plan_day_completed The context lists a completed workout or mobility session on {date}. Currently unreachable: a completed day is always today or earlier, which the two rows above refuse first. It is kept so that a future context change can't edit a completed day.
422 week_plan_date_outside_week A move's to is in another week.
422 week_plan_destination_not_open A move's to is today, an earlier day or a completed day.
422 week_plan_destination_occupied A move's to already holds a session, also when to is {date} itself. Sessions are never swapped.
422 week_plan_day_has_no_session A move or a length change of a rest day or a day without a plan.

Branch on detail, not on the HTTP status. The day changes added new detail values to the week plan problems: if your client checks detail against a fixed list, add them.

Build your connector

Your connector is an HTTPS service that Kinellect calls to read your content and a user's context, and to carry out actions on your side. The full contract is the Connector API specification in the reference. This page covers what matters most when building it.

Endpoints by capability

All paths are fixed and relative to the base URL you registered.

Endpoint Needed for
GET /ai-coach-connector/v1/capabilities Always. It is called when you activate a configuration.
POST /ai-coach-connector/v1/context/resolve context.resolve
POST /ai-coach-connector/v1/content/exercises/search exercise.search
POST /ai-coach-connector/v1/content/exercises/resolve exercise.resolve
POST /ai-coach-connector/v1/content/workouts/search workout.search
POST /ai-coach-connector/v1/content/workouts/resolve workout.resolve
POST /ai-coach-connector/v1/actions/preferences/update preference.update
POST /ai-coach-connector/v1/actions/workouts/accept workout.save, workout.save_and_schedule, workout.save_and_replace, workout.review
POST /ai-coach-connector/v1/actions/schedules/move schedule.move
POST /ai-coach-connector/v1/actions/schedules/cancel schedule.cancel
POST /ai-coach-connector/v1/actions/profile/update profile.goal.update, profile.note.add, profile.sessions_per_week.update

The two prescription capabilities, workout.prescription.count and workout.prescription.time, have no endpoint of their own. Advertise them in capabilities when your catalog supports repetition-based or time-based prescriptions.

Every request

Kinellect sends:

Authorization: Bearer <your connector secret>
Accept: application/json
Accept-Encoding: identity
Content-Type: application/json
X-Kinellect-Tenant: <your tenant environment UUID>
X-Kinellect-Request-Id: <random UUID, new for each call>
X-Kinellect-Attempt: <1 or 2>
Idempotency-Key: <key>            # action endpoints only

On every call, verify the bearer secret with a constant-time comparison, and check that X-Kinellect-Tenant is the tenant environment you expect.

X-Kinellect-Request-Id and X-Kinellect-Attempt are for diagnosis. You may ignore them, but logging them tells you what a repeated request was:

You receive It means
The same request ID twice, both with attempt 1 One Kinellect call whose send was repeated below Kinellect's retry logic: by Kinellect's HTTP library on a dropped connection, or by a proxy or network between the two sides.
The same request ID with attempts 1 and 2 Kinellect's own retry (see Timeouts and retries).
Different request IDs Two separate calls from Kinellect.

The request ID is random and says nothing about the tenant, the user or the Operation. A later attempt of the same workout acceptance command is a separate call: it has a new request ID and the same Idempotency-Key and action_ref.

subject_ref in request bodies is Kinellect's user reference (a UUID), not your user id. Look up your user through the mapping you stored when you created the user's first Thread.

Every response

Kinellect validates connector responses strictly, because they feed safety decisions:

  • Exact keys. Each object must contain exactly the documented keys: no more, no fewer. An extra field such as "debug": true makes the whole response invalid.
  • Optional means omit. Keys documented as optional (for example verification_facts, relationships, daily_context, warmup_supersets) are either present with a valid value or absent. Do not send null for them.
  • Status. Answer business outcomes with HTTP 200 and a JSON object. Any status outside 2xx counts as a failure.
  • Limits. String limits are UTF-8 bytes. Lists have maximum sizes. The body is at most 131072 bytes, uncompressed, with no NUL characters. Timestamps are UTC ending in Z or +00:00.
  • No redirects. Kinellect does not follow them.

A response that breaks these rules is treated as unavailable. The Operation that needed it fails safely, with codes such as connector_invalid_response, exercise_catalog_invalid or connector_unavailable, depending on the capability.

Timeouts and retries

  • Kinellect waits at most 4 seconds for a response to start or for further activity, and 5 seconds per attempt, always within the deadline of the Operation that needs the answer.
  • After HTTP 408, 429, 502, 503, 504 or a network error, Kinellect retries once, waiting 0.1 to 1 second. It honours a Retry-After header within that range. Other failures are not retried within the same attempt. Workout acceptance can make further attempts later: see Workout acceptance.
  • Capability discovery during activation has a 10-second budget. If it fails, activation returns 503.

Design every endpoint to answer well within 2 seconds, and keep them idempotent so that a retry is harmless.

Content endpoints

Exercises. Return at most 20 exercises per response. For each exercise you want Kinellect to use in generated or verified workouts, include verification_facts:

  • active and available: Kinellect uses only exercises that are both.
  • prescription_types: count, time or both.
  • safety_identifiers: identifiers that are matched against the user's safety_constraints and exercise constraints. Use the same vocabulary in both places.
  • generation_facts: allowed repetition and duration ranges. A range is either fully null or fully set, with 1 <= minimum <= maximum.
  • Optionally in generation_facts, minimum_sets and maximum_sets: the allowed number of sets for that exercise, both integers from 1 to 20 with minimum_sets <= maximum_sets, always sent together. Sending only one, null, or a value outside 1 to 20 makes the whole search or resolve response invalid. The pair bounds that exercise's sets in every generated workout: standalone and chat-prepared workout drafts and the workout a daily plan generates. A move outside the pair gets the validation code sets_out_of_range and at most one repair; a workout draft that still fails reports draft_validation_failed with that code, and a daily plan reports workout_content_unavailable. A regression substitute keeps the replaced move's sets, so a regression whose pair excludes them is skipped.

Add relationships with progression_refs, regression_refs and related_refs so Kinellect can substitute a safer regression when a constraint rules an exercise out.

Order and the 20-reference limit. List the most suitable exercises first in a search answer. To generate a workout, Kinellect sends one exercises/resolve request of at most 20 references, built from your search answer:

  1. First, every searched exercise that declares relationships and that one of the user's exercise constraints matches, whether that constraint hard-excludes it, soft-avoids it or was lifted, with its regression_refs.
  2. Then the suitable exercises in your search order, each with its regression_refs, as long as the request stays within 20 references. An exercise that does not fit is skipped and not offered for the workout. Exercises the user asked to leave out of a workout prepared in chat come last.

A reference already in the request counts once. related_refs are never resolved, and progression_refs only for a draft that changes a workout. When the first group alone needs more than 20 references or leaves no room for any suitable exercise, no resolve request is sent: a workout draft fails with exercise_catalog_invalid and the validation code constraint_evidence_exceeds_bound, and a daily plan that generates its workout fails with connector_invalid_response. When there is no first group and no suitable exercise fits with its regression_refs, a workout draft fails with exercise_catalog_invalid and no validation code, and a daily plan fails with connector_invalid_response. For a draft that changes a workout, these two failures apply only when no base reference fits, as described next.

A draft that changes a workout (sent with base_workout) sends at most one resolve request of at most 20 references. After the first group, it starts with the base exercise references in workout order, then the progression_refs your search answer lists for the base exercises that joined, each only while the request stays within 20. The suitable searched exercises then join as above, and the regression_refs of base exercises and of those progression_refs that your search returned also join. When base references fit, the request is sent even if no suitable searched exercise fits. Answer as for any request. A reference that is also a searched reference in the request (the first group, a suitable searched exercise that fits, or a regression_ref of either) must be answered, or the draft fails with exercise_catalog_invalid. The other base references, progression_refs and their regression_refs may be omitted; an omitted one is dropped, and an omitted base exercise is listed in base_changes.unavailable.

Versions. content_version, catalog_version, item_content_version and exercise_content_version are your own version labels. Change them when content changes. Kinellect pins them in results, so you can tell whether a proposal still matches your catalog.

Workouts. workouts/resolve answers resolved with the full workout, or missing, inactive or changed with "workout": null. Superset and exercise order values start at 1 and have no gaps. Resolved supersets have no rest_between_cycles_seconds key.

Action endpoints

Action endpoints change data on your side, so they must be idempotent:

  • Store the Idempotency-Key together with your result.
  • The same key with the same command returns the stored result without acting again.
  • The same key with a different command is a conflict. For workout acceptance, answer with a conflict outcome whose safe_code is command_conflict, and never overwrite the original.

Preference update. Apply the change and return succeeded: true with your receipt_ref. If you decline, return succeeded: false with a safe_code and HTTP 200.

Workout acceptance. Kinellect sends an immutable command containing the complete workout (for a generated workout) or your existing_workout_ref, the action, and for scheduling the local_date and time_zone. save_and_schedule must be atomic: when the date conflicts, create neither the workout nor the schedule, and answer conflict with safe_code schedule_conflict. save_and_replace puts the saved workout in place of the workout scheduled on local_date. Confirm it only when that day has no scheduled workout (then schedule the new one) or exactly one that is neither started nor completed. Otherwise, including when you cannot be sure the day's workout is untouched, answer conflict with schedule_conflict and change nothing in the schedule. The schedule change is all-or-nothing: the previous workout is unscheduled, never deleted, and stays scheduled unless the new one takes its place. You may save the new workout before the conditional schedule write, so a conflict or failure can leave it saved but unscheduled; Kinellect then treats the swap as not done. A confirmed save_and_replace returns schedule_ref and schedule_content_version too. List workout.save_and_replace in your capabilities answer only when you support it. A command whose source.source_kind is review_generated saves the changed session of a review after a workout. It carries generated_workout exactly like standalone_generated, and Kinellect sends it only when your configuration enables workout.review, which needs workout.review in your capabilities answer. Answer confirmed, conflict or rejected with HTTP 200. The accept operation in the Connector API reference defines the exact command and outcome shapes.

Schedule changes. Kinellect sends subject_ref, local_date (the user's day when they asked, in the time zone of their current context), for a move also target_local_date (the day after), and evidence_turn_ref. Answer HTTP 200 with exactly outcome and receipt_ref:

outcome Meaning receipt_ref
applied Move: the workout on local_date now sits on target_local_date, local_date is a rest day, and no workout already on target_local_date was removed or replaced. Cancel: the workout on local_date was removed and the day is a rest day. Your receipt
no_workout_today local_date has no scheduled workout. Nothing changed. null
tomorrow_occupied Move only: target_local_date already has a workout. Change nothing; never replace it. null
action_rejected You refuse the change for your own reason. Nothing changed. null
command_conflict The Idempotency-Key was already used with a different body. Change nothing. null

Bind the Idempotency-Key to the exact request body. Kinellect fixes local_date once and every later send of the same command carries the identical body and key. A refusal is always an outcome in a 200, never an HTTP error status. After a network error, a timeout, a redirect, 408, 409, 425, 429 or any 5xx, Kinellect later sends the identical body with the same key, until the Operation's time or attempt limit runs out, and then reports the change as unconfirmed. After any other 4xx, a 200 it cannot accept, or command_conflict, it does not send the command again and reports the change as unconfirmed at once.

Profile changes. Kinellect sends exactly subject_ref, primary_goal, note_addition, desired_sessions_per_week and evidence_turn_ref. Each of the three fields is a value or null, and at least one is a value. null means leave that field as it is: a field is null when the coach does not change it, and always when its capability was not enabled for the call. primary_goal is 1 to 1000 bytes, note_addition 1 to 500 bytes and desired_sessions_per_week 0 to 14. Append note_addition to the user's notes; never replace them. Answer HTTP 200 with exactly outcome and receipt_ref:

outcome Meaning receipt_ref
applied You applied every field that is not null. Your receipt, 1 to 200 bytes
action_rejected You refuse the change, including when you cannot apply every field. Nothing changed; there is no partial result. null
command_conflict The Idempotency-Key was already used with a different body. Change nothing. null

Retries follow the schedule changes above: after a network error, a timeout, a redirect, 408, 409, 425, 429 or any 5xx, Kinellect sends the identical body with the same key until the Operation's time or attempt limit runs out, then reports the change as unconfirmed. After any other 4xx, a 200 it cannot accept, or command_conflict, it does not send it again and reports it unconfirmed at once. A refusal is always an outcome in a 200.

Testing your connector

  • Validate each response against the Connector API schemas, with additionalProperties: false enforced.
  • Test the empty cases: an unknown user in context/resolve returns {"available": false}, unknown exercise references are simply left out, and an unknown workout returns missing.
  • Replay each action with the same Idempotency-Key and confirm nothing is applied twice.
  • Measure latency under load. Keep p99 well below 2 seconds.

Upload your exercise catalog

If you don't run a server that Kinellect can call, you can upload your exercise catalog to Kinellect instead of building a connector. Kinellect then searches and looks up exercises in its copy of your catalog. You still own the content: each upload replaces the previous one.

A configuration reads exercises either from a connector or from an uploaded catalog, never from both. Uploaded workouts aren't supported yet. Only exercises can be uploaded.

Setting it up

  1. Ask the Kinellect team for an uploaded-catalog registration. You send no URL or secret. You receive a connector_registration_ref as with a connector, and you name it in your configuration in the same way.
  2. Upload your catalog with PUT /v1/exercise-catalog/{catalog_version}.
  3. Activate a configuration that names the registration (see Client configuration). Until your first upload is accepted, activation and validation refuse it with 422 exercise_catalog_not_uploaded.

What works without a server

With an uploaded-catalog registration, Kinellect itself answers activation's capability check with exercise.search, exercise.resolve, workout.prescription.count, workout.prescription.time and workout.save. workout.review needs no connector either. Enabling any other capability that needs a connector answers 422 with connector_capability_unavailable. Before your first upload, activation answers exercise_catalog_not_uploaded first.

Works Needs a connector, so not available
Generated workout drafts that your app requests (workout.generate, with warm-ups and cool-downs) Existing workouts from your catalog (workout.search, workout.resolve)
Daily plans whose workout is generated (workout_source_policy generation_only) Pulling a user's context (context.resolve): push it with PUT /v1/subjects/{subject_ref}/context/{context_version}
Saving a generated workout (workout.save): Kinellect confirms the save, and your app stores the workout Saving and scheduling, or replacing, a workout (workout.save_and_schedule, workout.save_and_replace), and so changing today's workout in chat
Coaching conversations, where the coach can search and look up your exercises, and, with workout.generate and workout.save under auto_execute or confirmation_required, prepare a workout (see Workouts prepared in chat); with workout.change as well, prepare a changed version of the workout you send as current_workout, which you save as a new workout Every other action on your side: moving or cancelling today's workout, preference and profile updates
Capabilities marked "No" in the capability table, such as memory, goals and exercise limits

Saving a workout

Your app stores the workouts. When the user approves a generated workout (a draft your app requested, one the coach prepared in chat, a daily plan's generated workout, or a review's changed session), call POST /v1/workout-acceptances with action save, as described in Workout acceptance. Kinellect runs its usual checks and then completes the Operation as confirmed without calling a server of yours:

  • workout_ref is the source_ref you sent: the draft's draft_ref, the daily plan's decision_ref, or the review's review_ref. Store the workout in your database under this reference.
  • workout_content_version is a fingerprint of the approved source, receipt_ref is a reference Kinellect creates for this save, and confirmed_at is when Kinellect confirmed it.

Kinellect sends the workout nowhere, so store the one you showed the user. save_and_schedule and save_and_replace are refused with 422 capability_unavailable, and a daily_existing selection with 422 source_unavailable. The check before the save uses the catalog that was current when the workout was prepared, so a later upload doesn't change or block it. The saved workout can name an exercise that a later upload removed or marked unavailable.

The upload

The body is the whole catalog: 1 to 2,000 exercises, in the order you want them offered when the search words don't decide. Send an Idempotency-Key. The token needs the configuration:write scope.

{
  "exercises": [
    {
      "exercise_ref": "ex-push-up",
      "display_name": "Push-up",
      "movement_pattern": "horizontal push",
      "equipment_refs": [],
      "active": true,
      "available": true,
      "prescription_types": ["count"],
      "safety_identifiers": ["wrist-loading"],
      "generation_facts": {
        "minimum_count": 5,
        "maximum_count": 20,
        "count_duration_seconds_per_repetition": 3,
        "minimum_sets": 2,
        "maximum_sets": 4
      },
      "relationships": {
        "progression_refs": ["ex-decline-push-up"],
        "regression_refs": ["ex-incline-push-up"],
        "related_refs": []
      }
    },
    {
      "exercise_ref": "ex-incline-push-up",
      "display_name": "Incline push-up",
      "movement_pattern": "horizontal push",
      "equipment_refs": [],
      "active": true,
      "available": true,
      "prescription_types": ["count"],
      "safety_identifiers": ["wrist-loading"],
      "generation_facts": {
        "minimum_count": 8,
        "maximum_count": 25,
        "count_duration_seconds_per_repetition": 3,
        "minimum_sets": 2,
        "maximum_sets": 4
      },
      "relationships": {
        "progression_refs": ["ex-push-up"],
        "regression_refs": [],
        "related_refs": []
      }
    },
    {
      "exercise_ref": "ex-decline-push-up",
      "display_name": "Decline push-up",
      "movement_pattern": "horizontal push",
      "equipment_refs": ["bench"],
      "active": true,
      "available": true,
      "prescription_types": ["count"],
      "safety_identifiers": ["wrist-loading"],
      "generation_facts": {
        "minimum_count": 4,
        "maximum_count": 15,
        "count_duration_seconds_per_repetition": 3,
        "minimum_sets": 2,
        "maximum_sets": 4
      },
      "relationships": {
        "progression_refs": [],
        "regression_refs": ["ex-push-up"],
        "related_refs": []
      }
    }
  ]
}

Each exercise has the same fields as an exercise your connector would return, with no content version of its own:

  • exercise_ref appears once in the file and is at most 200 bytes.
  • display_name (at most 200 bytes) is shown to the coach. Search reads it as words.
  • movement_pattern (at most 100 bytes) is your own label. Search reads it as words too.
  • equipment_refs (at most 30) lists the equipment the exercise needs. Workout generation offers it only to a user whose pushed equipment_refs contain all of them.
  • active and available: search, and so generated workouts, leave out an exercise that is inactive or unavailable. A lookup by reference still returns it.
  • prescription_types is count, time or both.
  • safety_identifiers (at most 30) are your own identifiers for body areas or contraindications. A user's safety_constraints value, or an exercise constraint with target type safety_identifier, applies to every exercise carrying the same value. It also applies to the related exercises and harder versions of an exercise carrying it, but only when the exercise carrying it is in the same search or lookup answer. An exercise constraint on one exercise_ref also reaches its related exercises and harder versions, never its easier versions, which stay available as alternatives. It always reaches an exercise that names the constrained one in its own related_refs or regression_refs; a link declared only on the constrained exercise counts only when that exercise is in the same answer. Links reach one step only. Put each identifier on every exercise it applies to, and declare each link on both exercises.
  • generation_facts: an exercise is offered for workout generation only when they hold a complete range for a prescription type that the exercise lists and your configuration enables. An upload with generation_facts {}, or with only a count range on a time exercise, is accepted, but the exercise is never offered. A count or duration range is either all null or complete, with a minimum of at least 1 and no higher than the maximum (counts up to 1000, durations up to 7200 seconds). count_duration_seconds_per_repetition (1 to 600) needs a count range. minimum_sets and maximum_sets (1 to 20) come together. An omitted key reads as null.
  • relationships is optional. When you send it, all three lists are required. Each reference names another exercise in the same file, never the exercise itself, and appears in at most one of the three lists, with up to 20 per list. progression_refs are harder versions, and regression_refs easier ones.

A new upload gets 201:

{
  "catalog_version": 3,
  "exercise_count": 3,
  "accepted_at": "2026-10-28T09:14:02.000000+00:00",
  "replayed": false
}

An accepted upload replaces the previous catalog in one step: a single search or lookup sees either the previous catalog or the new one. A workout draft searches and then looks up, so an upload that lands between the two fails that draft with exercise_catalog_invalid, and a daily plan with connector_invalid_response. Request it again.

Versions

Every upload is the whole catalog under a catalog_version higher than any you have uploaded before.

Answer When
201 A new, higher version was stored and is now current.
200 with replayed true The same body again, with the same Idempotency-Key or under the same catalog_version. Nothing new is stored. If catalog_version in the answer differs from the one in the path, that key had already stored this body under that version.
409 catalog_version_conflict The Idempotency-Key already stored a different body, or the key is new and the catalog_version already holds a different body. The key is checked first.
409 catalog_version_not_newer A higher version is already stored, and neither this key nor this version has stored an upload.

A replay never makes an older version current again. To go back, upload the old content under a new, higher version.

Drafts and lookups report every exercise's content version, and the catalog's, as the decimal catalog_version. So every upload changes the content version of every exercise, including the ones you didn't edit.

Limits and errors

The codes below are in the problem's detail.

Answer Meaning
400 A valid Idempotency-Key header is missing, or the body is not valid JSON.
401 The API token is missing or invalid.
403 The token lacks configuration:write, or the client is paused (client_paused).
404 catalog_version is not a positive integer of at most 10 digits.
413 exercise_catalog_too_large The body declares a Content-Length above 4,194,304 bytes. It is refused before it is read. A larger body sent without Content-Length is cut off at that size and is then not valid JSON, so send Content-Length.
415 The Content-Type is missing or unsupported. Send application/json.
422 catalog_version_out_of_range catalog_version is above 2147483647. This is checked after the body passes validation.
422 validation problem A field is unknown or breaks a rule. Nothing is stored. Each entry of violations names the rejected value by propertyPath, for example exercises[12].relationships.regression_refs[0], and, for a rule, the rule by type.

The catalog rules run after every field rule has passed. Their type values are:

type Rule
urn:uuid:225cb09a-5f82-4d3d-819f-afa72bc48975 The exercise_ref is already used by an earlier exercise.
urn:uuid:3ebfb2a6-7094-4955-a74c-7b4ff49959cf A relationship names an exercise that is not in the file.
urn:uuid:1b6b909a-2f20-4d0c-88d9-ae8c2ff173b7 A relationship names the exercise itself.
urn:uuid:fffd82fa-21a0-4ad9-bdca-8a7e50cbd3fb One exercise is in two relationship lists.
urn:uuid:a564eea3-a0cc-4648-b025-ae996ab952c8 The generation facts are incomplete or out of range.

There is no delete call. To remove an exercise, upload the catalog again without it. Marking it inactive takes it out of search and generated workouts, but lookups by reference, for example in chat or workout history, still return it.

How search picks exercises

Search ranks your active and available exercises by the search words found in display_name or movement_pattern. Words are compared in lower case, with no synonyms or word stems: "squats" doesn't match "squat". Exercises of equal rank keep file order, and at most 20 are returned. When fewer than 20 match, exercises without a matching word fill the remaining places in file order.

Workout generation searches with at most the first 500 bytes of the primary_goal in the user's pushed context, or with a fixed query for a mobility session. When your catalog has more than 20 exercises, the words of the user's goal therefore decide which 20 exercises the coach can choose from. Kinellect then checks equipment, safety, constraints, prescriptions and progressions on that page exactly as it does for a connector.

To get good picks:

  • Use plain, common words in display_name and movement_pattern, the words your users would write in a goal.
  • Put your most broadly useful exercises first in the file, because file order breaks ties and fills the page.
  • Exercises without usable generation_facts, or that need equipment the user lacks, still take places on the page. With too many of them, a goal can end in empty_candidate_set even when suitable exercises sit further down the file.
  • Give every exercise you want in generated workouts its generation_facts, and link easier and harder versions through relationships.

Using these docs with an LLM

These docs are published in forms that coding assistants and agents can read directly:

File Contents Use it when
llms.txt A short index of every document, following the llms.txt convention. An agent should discover what exists.
llms-full.txt Every guide on this page plus both complete OpenAPI specifications, in one Markdown file. You want to give an assistant the whole contract in one go.
openapi/kinellect-api-v1.json OpenAPI 3.1 for the Kinellect API you call. Generating a client, or validating requests.
openapi/kinellect-connector-v1.json OpenAPI 3.1 for the connector you implement. Generating server stubs, or validating responses.

Paste llms-full.txt into your assistant's context, or point an agent at it. It is self-contained.

Suggested instructions for a coding assistant

You are implementing an integration with Kinellect. The attached llms-full.txt is the complete contract.
Rules:
- Never invent endpoints, fields, enum values or status codes. Use only what the OpenAPI specs define.
- Kinellect API requests reject unknown fields. Send only documented fields.
- Every POST/PUT needs an Idempotency-Key. Reuse the key only to retry the identical request.
- 202 responses start an Operation. Poll it with backoff until queued/running ends.
- Handle 429 by waiting Retry-After, then retrying with the same Idempotency-Key.
- Connector responses must contain exactly the documented keys. Optional keys are omitted, never null.
- subject_ref is Kinellect's UUID for a user. Keep a mapping from our user id to subject_ref.
- The Kinellect API token is a backend secret. Never put it in client-side code.

Invariants checklist

Use this list to review generated code:

  1. Each write sends an Idempotency-Key that is persisted before the request and reused on retry.
  2. No request body contains a field that is missing from the specification.
  3. Every Operation state is handled: queued, running, completed, failed, cancelled and expired.
  4. Byte limits are checked in UTF-8 bytes, not characters.
  5. Timestamps are sent as UTC. time_zone is an IANA name.
  6. Connector responses are built from explicit field lists, never by serialising internal objects that may carry extra fields.
  7. Connector action endpoints store and replay results by Idempotency-Key.
  8. The connector verifies the bearer secret and the X-Kinellect-Tenant header.

Limits of v1

Plan your integration around these current limits. Ask the Kinellect team about timelines.

  • No self-service provisioning. API tokens, scopes and connector registrations are issued by the Kinellect team.
  • No webhooks. Results are delivered by polling Operations.
  • Registering a user means creating a Thread. There is no separate "create subject" endpoint. POST /v1/threads both creates the conversation and registers the user.
  • Backups keep erased data until they expire. DELETE /v1/subjects/{subject_ref} erases the user's coaching data immediately (see Deleting and reactivating a Subject), but encrypted backups keep it until they expire. The retention period is confirmed at production provisioning.
  • No listing endpoints. The API does not list users, Threads or past Operations. Store the references you need when you receive them.
  • One safety policy. safety_policy currently accepts only fitness_coach_safety_v1.
  • English. Coaching output is currently English.

Endpoint index

Kinellect API (you call)

MethodPathPurpose
DELETE/v1/subjects/{subject_ref}Delete or replay deletion of one Subject
POST/v1/subjects/{subject_ref}/reactivateReactivate or replay reactivation of one deleted Subject
GET/v1/subjects/{subject_ref}/memoryRead one Subject's coach memory
GET/v1/subjects/{subject_ref}/threadsList one Subject's Conversation Threads
DELETE/v1/subjects/{subject_ref}/memory/{topic}/{slot}Delete one coach memory slot
GET/v1/client-configurationsList this tenant's configuration versions
GET/v1/client-configurations/activeRead the active configuration document
GET/v1/client-configurations/{configuration_version}Read one stored configuration version
POST/v1/client-configurations/{configuration_version}/validateRun every activation check without activating
PUT/v1/client-configurations/{configuration_version}/activateActivate or replay one immutable tenant coaching configuration version
PUT/v1/exercise-catalog/{catalog_version}Upload or replay one whole exercise catalog version
PUT/v1/subjects/{subject_ref}/context/{context_version}Store or replay one immutable authoritative subject-context version
POST/v1/threadsCreate or replay a tenant-scoped Conversation Thread
POST/v1/threads/{thread_ref}/turnsAccept one immutable user Turn
GET/v1/threads/{thread_ref}/turnsRead one Thread's Turns
PUT/v1/turns/{turn_ref}/ratingRate a coach reply, change the rating or clear it
GET/v1/operations/{operation_ref}Poll a Conversation Operation
POST/v1/workout-draftsRequest or replay one validated workout draft
GET/v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}Poll a subject-scoped workout-generation Operation
GET/v1/subjects/{subject_ref}/workout-draft-operations/{operation_ref}/progress-signalsRead progress signals for a workout draft's exercises
POST/v1/daily-plansRequest or replay one daily coaching decision
GET/v1/subjects/{subject_ref}/daily-plan-operations/{operation_ref}Poll a subject-scoped daily-coaching Operation
GET/v1/subjects/{subject_ref}/daily-plan-operations/{operation_ref}/progress-signalsRead progress signals for a daily plan's exercises
POST/v1/workout-acceptancesRequest or replay explicit workout acceptance
GET/v1/subjects/{subject_ref}/workout-acceptance-operations/{operation_ref}Poll a subject-scoped workout acceptance Operation
POST/v1/goalsRequest a milestone ladder for a person's goal
GET/v1/subjects/{subject_ref}/goal-operations/{operation_ref}Poll a subject-scoped goal-planning Operation
POST/v1/subjects/{subject_ref}/goals/{goal_ref}/activateActivate a proposed goal
GET/v1/subjects/{subject_ref}/goalRead the Subject's active goal
POST/v1/week-plansRequest a plan of the open days of a person's week
GET/v1/subjects/{subject_ref}/week-plan-operations/{operation_ref}Poll a subject-scoped week plan Operation
GET/v1/subjects/{subject_ref}/week-planRead the Subject's plan of one week
POST/v1/subjects/{subject_ref}/week-plan/days/{date}/changesMove, resize or skip one day of the Subject's week plan
GET/v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}/goal-progressRead the goal progress of a workout completion
POST/v1/subjects/{subject_ref}/goal-questions/{question_ref}/answerAnswer a goal confirmation question
POST/v1/subjects/{subject_ref}/body-measurementsRecord a body weight or waist reading
GET/v1/subjects/{subject_ref}/body-measurementsList the Subject's body readings
DELETE/v1/subjects/{subject_ref}/body-measurements/{measurement_ref}Delete a body reading
POST/v1/workout-reviewsAsk whether to keep or change the next session after a finished workout
GET/v1/subjects/{subject_ref}/workout-review-operations/{operation_ref}Poll a subject-scoped workout review Operation
GET/v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}/workout-reviewRead the review of a workout completion
POST/v1/eventsReport one completed workout
GET/v1/subjects/{subject_ref}/workout-completion-operations/{operation_ref}Poll a subject-scoped workout-completion Operation

Connector API (you implement)

MethodPathPurpose
GET/ai-coach-connector/v1/capabilitiesDeclare the connector contract version and supported capabilities
POST/ai-coach-connector/v1/context/resolveReturn the Subject's current authoritative context
POST/ai-coach-connector/v1/content/exercises/searchSearch the exercise catalog for one Subject
POST/ai-coach-connector/v1/content/exercises/resolveResolve exercises by reference
POST/ai-coach-connector/v1/content/workouts/searchSearch existing workouts
POST/ai-coach-connector/v1/content/workouts/resolveResolve one existing workout
POST/ai-coach-connector/v1/actions/preferences/updateUpdate one Subject preference
POST/ai-coach-connector/v1/actions/workouts/acceptAccept the immutable workout command
POST/ai-coach-connector/v1/actions/schedules/moveMove the Subject's workout on local_date to target_local_date
POST/ai-coach-connector/v1/actions/schedules/cancelCancel the Subject's workout on local_date and make the day a rest day
POST/ai-coach-connector/v1/actions/profile/updateChange the Subject's goal, add a note to the Subject's notes, or change how many sessions a week the Subject plans to train

Full request and response schemas, limits and error codes are in the API reference.