Write one of an agent's own lines

PUT
/v1/agents/{id}/lines/{language}/{line}

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.

Authorization

apiKey
headerAuthorizationBearer <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.

Path Parameters

id*string

The agent id.

language*string

The language, for example gu-IN.

line*string

The name of the line, from the lines read (for example goodbye).

Request Body

application/json
  1. body
text*|

What the agent says; null goes back to the written-for-you line.

Length1 <= length <= 300

Response Body

The language's lines after the change (saved on the draft)

application/json
  1. response
language*string
packState*|

The platform-written lines: being written, ready, or failed ("write again"); null when none was asked for

Value in"writing""ready""failed"null
revision*integer|null
lines*array<>
words*|null
Example Request
curl -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."  }'
Example Response
{  "language": "gu-IN",  "packState": "ready",  "revision": 1,  "lines": [    {      "id": "goodbye",      "text": "આવજો, તમારો દિવસ શુભ રહે.",      "source": "owner",      "english": "Goodbye."    }  ],  "words": null}