Skip to main content

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​

This message was already learned — the existing example.