# Write one of an agent's own lines

Source: https://docs.vlayers.ai/reference/agents/edit-agent-line

`PUT /v1/agents/{id}/lines/{language}/{line}` · scope `workspace:write`

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.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The agent id. Example: `"0192f5c2-6f7a-7b9c-8d1e-2f3a4b5c6d78"` |
| `language` | path | string | yes | The language, for example `gu-IN`. Example: `"gu-IN"` |
| `line` | path | string | yes | The name of the line, from the lines read (for example `goodbye`). Example: `"goodbye"` |
| `text` | body | string | yes | What the agent says; `null` goes back to the written-for-you line. |

## Request

cURL:

```bash
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."
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { language } = await voicelayer.agents.editLine('<agent-id>', '<language>', '<line>', {
  text: 'Just a moment.'
});
console.log(language);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.agents.edit_line(
    "<agent-id>",
    "<language>",
    "<line>",
    text="Just a moment.",
)
print(result.language)
```

## Response `200`

```json
{
  "language": "gu-IN",
  "packState": "ready",
  "revision": 1,
  "lines": [
    {
      "id": "goodbye",
      "text": "આવજો, તમારો દિવસ શુભ રહે.",
      "source": "owner",
      "english": "Goodbye."
    }
  ],
  "words": null
}
```
