Skip to content

Plan and run (or dry-run) a code-action goal or natural-language question for a user

POST
/api/v1/admin/code-action/run
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>'
username
required
string

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

goal
string

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)

question
string

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

seed
string
default: run

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

dryRun
boolean

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

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

Media typeapplication/json
string

Example generated

example

Unknown username, or neither goal nor question given

Media typeapplication/json

A refusal carrying only its reason, with no status word

object
error
required

Why the request was refused, written to be shown

string

Example generated

{
"error": "example"
}