Create or update a command
const url = 'http://localhost:11044/api/v1/commands';const options = { method: 'POST', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>', 'Content-Type': 'application/json'}, body: '{"actionName":"example","command":"example","description":"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/commands \ --header 'Content-Type: application/json' \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \ --data '{ "actionName": "example", "command": "example", "description": "example" }'Saves a command configuration that maps a slash command to a world action.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The command to save: command is the slash command’s name without the leading slash, actionName the world action it runs, and description optional help text (empty when omitted). Saved as config/commands/<command>.yml in the user’s world, replacing any command of the same name, after which the world’s GOAP specs are redeployed; the action name is not checked against the world here
A slash command that runs a world action when a chat message starts with it. Listed by GET /commands and saved by POST /commands
object
Name of the world action the command runs. Text typed after the command word becomes the action’s input; with none, the action runs directly if it takes no input and otherwise asks for it with a form
The command word without its leading slash, matched case-insensitively. Also the file name it is saved under, so saving one that exists replaces it
The message shown with that input form. Empty when not set
Example generated
{ "actionName": "example", "command": "example", "description": "example"}Responses
Section titled “Responses”Command created/updated

