Write one of an agent's own lines
Saves your own words for one line in one language on the agent's draft. Your line always wins over the written-for-you one, and goes live with the next publish. text: null removes it. A {{placeholder}} the line cannot fill in is refused with 422 unknown_placeholder. An agent whose code declares its own lines answers 422 code_owned_field.
Requires an API key with the workspace:write scope.
apiKeyAuthorizationBearer <token>A secret API key from the dashboard (Developers → API keys): vl_live_…, or vl_test_… for test mode. Each operation says which scope the key needs.
id*stringThe agent id.
language*stringThe language, for example gu-IN.
line*stringThe name of the line, from the lines read (for example goodbye).
application/json- body
text*|What the agent says; null goes back to the written-for-you line.
1 <= length <= 300The language's lines after the change (saved on the draft)
application/json- response
language*stringpackState*|The platform-written lines: being written, ready, or failed ("write again"); null when none was asked for
"writing""ready""failed"nullrevision*integer|nulllines*array<>words*|nullcurl -X PUT "https://api.vlayers.ai/v1/agents/$AGENT_ID/lines/$LANGUAGE/$LINE" \ -H "Authorization: Bearer $VOICELAYER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "text": "Just a moment." }'{ "language": "gu-IN", "packState": "ready", "revision": 1, "lines": [ { "id": "goodbye", "text": "આવજો, તમારો દિવસ શુભ રહે.", "source": "owner", "english": "Goodbye." } ], "words": null}