Teach the assistant from this reply ('use in training')
POST/api/messages/:message/training
Turns an agent's (or the assistant's) reply into a question-and-answer
example the assistant retrieves from then on: the customer message
before it becomes the question, this message the answer. Allowed to
whoever may reply in the conversation; needs the training feature.
scope_type decides who the example applies to: the whole workspace
(tenant, the default), one department (department + scope_id) or
one person (contact — answers learned from and for that contact).
Refusals carry a stable error code. 409: contact_ineligible (the
person is not saved with data capture on), knowledge_not_ready (no
embedding model chosen). 422: not_agent_message, no_question,
empty_answer, duplicate, source_excluded (eBay forbids training
on its content), ai_disabled, not_classified.
Idempotent: using the same message again returns the existing example
with 200 instead of creating a second one. With the training feature
off for the workspace, every training endpoint answers 404.
Request
Responses
- 200
- 201
- 401
- 403
- 404
- 409
- 422
This message was already learned — the existing example.
The example that was learned.
Not authenticated. code: account_disabled means the member's seat was deactivated in this workspace: the session is over even though the token was not revoked (clients sign out and clean up).
Authenticated but not allowed.
Resource not found (or not visible to the current tenant).
The workspace or the person cannot be trained on yet (error says which).
The message cannot be learned from (error says why), or the body is invalid.