Plan and run (or dry-run) a code-action goal or natural-language question for a user
const url = 'http://localhost:11044/api/v1/admin/code-action/run?username=example&seed=run&dryRun=false';const options = {method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
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/admin/code-action/run?username=example&seed=run&dryRun=false' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Login username of the user whose world, repositories and realm tools the catalog is built from and the run acts as; an unknown username is refused with 400
Name of the type the plan must produce, such as CommitActivity, matched against the world’s types; a type no action produces is bridged by a model-backed converter from Person. Used when no question is given; one of goal or question is required (400 otherwise)
A natural-language question; a model ranks the catalog’s goals and the best fit is planned and run. Takes precedence over goal when both are given
Text handed to the plan’s first step as its Query seed on the typed-goal path; defaults to run. Ignored when a question is given, which seeds the plan itself
With a question, true returns only the routing decision (the chosen goal, its confidence and the reason) without executing anything; defaults to false. Has no effect on the typed-goal path
Responses
Section titled “Responses”One of five outcomes, told apart by planned and the keys present: a dry run’s routing decision, an answered question with its results, a question no goal fits with the rankings, a write parked for confirmation, or a typed goal’s plan and results. Open by contract: results carries whatever items the goal type produces
Example generated
exampleUnknown username, or neither goal nor question given
A refusal carrying only its reason, with no status word
object
Why the request was refused, written to be shown
Example generated
{ "error": "example"}
