Skip to content

Change one displayed name or description to a person's words, and re-emit the draft

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

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

One change in a person’s own words: revision is the draft revision they read (409 REVISION_STALE when the draft has moved on), subject a displayed name or description decision, and value the wording that replaces it. A subject that is not a name or description, or a value the draft cannot carry, is refused with 400 CHANGE_INVALID. The draft is re-emitted with the change recorded under the caller’s name

Media typeapplication/json

A person’s own words for one displayed name or description, sent to POST /learn/{id}/change

object
revision
required

The revision the person read; one that is no longer current is refused 409 REVISION_STALE

string
subject
required

The subject of a displayed rename or description decision, e.g. rename:Grant; any other kind is refused 400 CHANGE_INVALID, and one not displayed 400 DECISION_UNKNOWN

string
value
required

The new value, trimmed: for a rename, one word of letters, digits and underscores starting with a letter; for a description, its whole text. Empty or unchanged is refused 400 CHANGE_INVALID

string

Example generated

{
"revision": "example",
"subject": "example",
"value": "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"
}

CHANGE_INVALID: not a name or description, or a value the draft cannot carry; DECISION_UNKNOWN

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"
}

No draft review of that id is held for this owner

REVISION_STALE: the review changed; 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"
}