lua push agent and lua persona call; drafts, presets, and the enhance routes have no CLI equivalent.
Verified against lua-cli 3.33.0.
Base URL and authentication
Routes under:agentId check an agents scope on that agent: agents:read reads versions, agents:write creates, activates, drafts, publishes, enhances, and applies presets, and agents:manage discards a draft. The preset catalog needs only an authenticated key. The host, the bearer header, and the error envelope are on the REST API overview.
Persona version object
A persona is either a string or a channel-aware object{ base?, voice?, text? }; both forms are accepted wherever a persona is sent and returned as stored. Creating a version serves it from the agent’s next message, and making an earlier version current switches the served persona at once, on any agent. An agent version records which persona version was current, but promoting one does not change the served persona.
number
Version number.
number
Unix time in milliseconds.
string
User ID of the creator.
boolean
Whether this version is the active persona.
string | object
The persona text or channel-aware object.
Endpoints
GET /developer/agents/:agentId/persona/versions
Lists the agent’s persona versions. Scopeagents:read. Equivalent: lua persona production versions.
string
default:"all"
draft, published, or all.200 with { status, message, versions }, each entry a persona version object.
GET /developer/agents/:agentId/persona/version/:version
Returns one version with the configuration it was built from. Scopeagents:read.
Response
200 with { status, message, version }, where version carries id, agentId, version, persona, config (the structured configuration used to build it, when any), createdBy, and createdAt, plus the storage fields _id and __v.
POST /developer/agents/:agentId/persona/version
Creates a new persona version from text you supply. Scopeagents:write. Equivalent: lua push agent, which creates a version from LuaAgent.persona.
string | object
required
The persona text, or
{ base?, voice?, text? }.201 with { status, message, version }, where version is the new version number.
POST /developer/agents/:agentId/persona/version/:version
Makes a version the current persona. Scopeagents:write. Equivalent: lua persona production deploy --persona-version <n> or lua deploy persona. The agent serves that version from its next message, and a later agent-version promote does not change it, as described under Persona version object.
Response
201 with { status, message, version }.
POST /developer/agents/:agentId/persona
Builds a persona from business details and stores it as a new version. Scopeagents:write. The model writes the text.
string
What the business does.
string
Website to draw details from.
string
Name the agent should use.
string
deprecated
Use the draft routes’
personalityAndVoice instead.string
deprecated
Use the draft routes’
personalityAndVoice instead.201 with { status, message, persona, version }.
POST /developer/agents/:agentId/persona/draft
Generates a draft from a structured configuration. Scopeagents:write. A draft is a generated persona version held for testing until you publish or discard it; only one exists at a time, and creating another answers the existing one with status: "draft_exists" instead of replacing it. Each has… flag includes or omits its section; each list supplies that section’s statements.
string
Name the agent should use.
string
Website to draw details from.
string
Preset to base the configuration on.
object[]
Each
{ title, isEnabled }: tone choices.string[]
Role statements. Included when
hasRoleAndPurpose is true.string[]
Audience statements. Included when
hasContextAndAudience is true.string[]
Personality traits. Included when
hasPersonalityAndVoice is true.string[]
Rules. Included when
hasRulesAndBoundaries is true.string
What the business does.
string[]
Product statements. Included when
hasBusinessInfo is true.boolean
Section switches.
string
Existing persona text to extract a configuration from, instead of the structured fields.
string
deprecated
Use
personalityAndVoice.201 with { status: "draft", message, version, versionStatus: "draft", persona, config }, or status: "draft_exists" and the existing draft’s fields when one already exists.
PUT /developer/agents/:agentId/persona/draft
Regenerates the existing draft from a new configuration, with the same body and response as create. Scopeagents:write.
POST /developer/agents/:agentId/persona/publish
Publishes the draft, making it the current persona. Scopeagents:write. A draft whose text is empty is built from its configuration first.
number
required
The draft’s version number.
201 with { status: "success", message, version, persona, versionStatus: "published" }.
DELETE /developer/agents/:agentId/persona/draft
Discards the draft without publishing. Scopeagents:manage.
Response
200 with { status, message }.
GET /developer/agents/persona/presets
Lists presets. Any authenticated key. A preset is a named, ready-made persona configuration, for examplecustomer-support-expert, that you can start a draft from or apply to an agent’s configuration without generating new persona text.
Response
200 with { status, presets: [{ id, title, description }] }.
GET /developer/agents/persona/presets/:presetId
Returns one preset. Any authenticated key. Response200 with { status, preset }, where preset is the configuration object.
POST /developer/agents/:agentId/persona/preset/apply
Copies a preset into the agent’s persona configuration. Scopeagents:write. Only the configuration changes; no persona version is generated.
string
required
Preset to apply.
201 with { status, message, config }, where config is the applied configuration.
POST /developer/agents/:agentId/enhance/website
Reads a website and suggests persona text and configuration from it. Scopeagents:write. The three enhance routes are non-destructive: each runs the model, can take minutes, and returns a suggestion for you to review without changing the agent. When currentPersona and currentConfig are omitted, the agent’s current values are used.
string
required
Site to read.
string
Persona text to improve.
object
Configuration to improve.
201 with { suggestedPersona, suggestedConfig }.
POST /developer/agents/:agentId/enhance/storytelling
Suggests a version with more narrative depth and personality. Scopeagents:write.
string
Persona text to improve.
object
Configuration to improve.
201 with { suggestedPersona, suggestedConfig }.
POST /developer/agents/:agentId/enhance/instructions
Refines the persona from written instructions, from example replies that need improving, or both. Scopeagents:write.
string
For example
Make the agent more formal and professional.object[]
Each
{ agentReply, reason, expectedReply }: a reply the agent gave, why it was wrong, and what it should have said.string
Persona text to improve.
object
Configuration to improve.
201 with { suggestedPersona, suggestedConfig }.
Errors
Example
Create a persona version from text; the agent serves it from its next message. The second call,POST …/persona/version/:version, is how you switch back to an earlier version, and on the version just created it changes nothing. To keep agent versions in step with the served persona, follow with lua version create and lua version promote.
See also
- About the persona — writing guidance and the channel-aware object form
lua persona— view, list, and deploy persona versions- Versions — agent versions, which pin the persona
- Releasing — push, version, promote
- REST API overview — authentication, scopes, errors

