Skip to content

Answer one open question — keep, reverse, or fall back to what the store asserted

POST
/api/v1/learn/{id}/answer
curl --request POST \
--url http://localhost:11044/api/v1/learn/example/answer \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "choice": "example", "subject": "example" }'
id
required
string

Id of the held draft review (learn- plus a UUID, as returned by POST /api/v1/learn/sources/{name}/learn) whose open question is answered; 404 when no draft of that id is held for this user, which includes an expired id and a database-description review

The question to settle: subject is an open question’s subject as the review lists it, and choice one of that question’s option values. For a SQL source, a mined decision takes keep, reverse (flip an edge’s direction), or anything else to fall back to the mined default; a proposed join takes accept to add the key, and anything else drops the candidate. The draft is re-emitted with the answer recorded under the caller’s name

Media typeapplication/json

A person’s answer to one open question, sent to POST /learn/{id}/answer

object
choice
required

The value of one of that question’s options (OptionWire.value), e.g. keep, reverse or accept

string
subject
required

The question’s subject, as QuestionWire.subject gives it

string

Example generated

{
"choice": "example",
"subject": "example"
}

OK

Media typeapplication/json

A learning proposal to review before anything is written: what was read, what was decided and asked, the realm it would install, and where it stands. Answered by the learn, proposal, answer, approval and change endpoints; every part is flattened into one object

object
id
required

The proposal’s id, for the /learn/{id} endpoints. Held in memory for its owner only; another user’s or an expired one answers 404

string
source
required

Name of the source it was learned from, as SourceWire.name gives it

string
summary
required

One line to show when the pass finishes: tables, decisions, joins that returned rows, open questions and decisions applied unconfirmed

string

Example generated

{
"id": "example",
"source": "example",
"summary": "example"
}

No draft review of that id is held for this owner

REVISION_STALE: another write changed the review first; fetch it again

Media typeapplication/json

A refusal that names a machine-readable code beside its explanation

object
code
required

The refusal’s code, for a client that branches rather than reads. Every value comes from the sealed LearningReviewRefusal hierarchy, except SOURCE_UNREADABLE which the 502 path builds directly.

string
Allowed values: REVISION_STALE WARNINGS_STALE WARNINGS_NOT_ACKNOWLEDGED DIGEST_STALE SOURCE_CHANGED LEARNING_IN_PROGRESS DECISION_UNKNOWN CHANGE_INVALID SOURCE_UNREADABLE
error
required

What was refused and what to do about it, written to be shown to the person reviewing

string

Example

{
"code": "REVISION_STALE"
}