Approve displayed decisions against the current draft digest. Recorded, not yet enforced
const url = 'http://localhost:11044/api/v1/learn/example/approval';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"revision":"example","subjects":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:11044/api/v1/learn/example/approval \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "revision": "example", "subjects": [ "example" ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Id of the held draft review (learn- plus a UUID, as returned by POST /api/v1/learn/sources/{name}/learn) whose decisions are approved; 404 when no draft of that id is held for this user, which includes an expired id and a database-description review
Request Bodyrequired
Section titled “Request Bodyrequired”What the reviewer approves: revision is the draft revision they read (409 REVISION_STALE when the draft has moved on), and subjects the subjects of displayed decisions they approve, such as rename:Grant (400 DECISION_UNKNOWN when empty or naming one the review does not display). The approvals are recorded against the draft and shown on the review; they do not yet gate the install
Decisions a person approves, sent to POST /learn/{id}/approval. Approvals are recorded and shown, not yet enforced
object
The revision the approver read; one that is no longer current is refused 409 REVISION_STALE
Subjects of displayed decisions, e.g. rename:Grant. An empty list, or a subject the review does not display, is refused 400 DECISION_UNKNOWN
Example generated
{ "revision": "example", "subjects": [ "example" ]}Responses
Section titled “Responses”DECISION_UNKNOWN: no subjects, or one the review does not display
A refusal that names a machine-readable code beside its explanation
object
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.
What was refused and what to do about it, written to be shown to the person reviewing
Example
{ "code": "REVISION_STALE"}No draft review of that id is held for this owner
REVISION_STALE: the review changed; fetch it again. SOURCE_CHANGED: the source served another description since; learn it again
A refusal that names a machine-readable code beside its explanation
object
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.
What was refused and what to do about it, written to be shown to the person reviewing
Example
{ "code": "REVISION_STALE"}
