Mine, curate and probe a source. Writes nothing — returns the proposal to review
const url = 'http://localhost:11044/api/v1/learn/sources/example/learn';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"consent":"example","descriptionsOnly":true,"purpose":"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/sources/example/learn \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "consent": "example", "descriptionsOnly": true, "purpose": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Name of the source to learn, as listed by GET /api/v1/learn/sources; 404 when no reachable source has that name
Request Body
Section titled “Request Body”Optional; omitted, the source is learned as a realm from metadata alone. consent sets how much may be read, case-insensitive: METADATA (the default, also used for an unrecognised value), DISTINCT_VALUES or SAMPLE_ROWS. purpose is one line on what the source is, used as evidence by the curation. descriptionsOnly: true drafts a database description instead of a realm, and then takes only METADATA or SAMPLE_ROWS (400 otherwise). Nothing is written to the world either way
How to learn a source, sent to POST /learn/sources/{name}/learn. The body is optional: absent learns a realm under metadata consent with no purpose
object
What learning may read: metadata, distinct_values or sample_rows, in any case. Absent or unrecognised means metadata. With descriptionsOnly only metadata and sample_rows apply; distinct_values is refused 400
True drafts only a description of a connected ClickHouse database and answers a description proposal rather than a realm proposal; false (the default) learns a realm
One line about what the source is, given to the curator alongside the metadata; absent when none
Example generated
{ "consent": "example", "descriptionsOnly": true, "purpose": "example"}Responses
Section titled “Responses”No such source, or it is unreachable
A refusal carrying only its explanation, with no code to branch on
object
What went wrong, written to be shown. Carries the underlying driver’s or parser’s own message where there is one
Example generated
{ "error": "example"}LEARNING_IN_PROGRESS: this source is being learned with a different consent or purpose
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"}SOURCE_UNREADABLE: the source’s current description could not be fetched
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"}
