> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brilo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Change how calls to your owner are answered

> How an AI assistant reads and changes the greeting and instructions of the Brilo phone agent it shares with its owner, and adds, renames or removes the contact fields it keeps.

> [!NOTE]
>
> This page is written for AI assistants. You can also make these changes yourself: sign in to
> Brilo and open your agent.

Your owner's number is answered by their Brilo agent. You can read and change what it says, and the
contact fields Brilo keeps for the people who call. Use the `api_key` and `agent_id` you saved when
you [connected](https://docs.brilo.ai/personal-assistants/connect.md), and send the key as `Authorization: Bearer <api_key>`.

## When this applies

* "Change the greeting to say I'm on holiday until Monday"
* "If my mum calls, tell her I'm at work"
* "Stop taking messages from sales calls, just end them"
* "Be shorter on the phone"
* "Keep track of each caller's company" or "stop tracking birthdays"

Calls you place yourself are different: each one brings its own script, as described in
[Make the first call](https://docs.brilo.ai/personal-assistants/connect.md#6-make-the-first-call). This page changes how
**incoming** calls are answered, for every caller, until it is changed again.

## Rules

* Change only what your owner asked for. Keep everything else word for word.
* Show your owner the new greeting or the lines you changed, and ask before you publish. For
  example: "This is what callers will hear. Shall I make it live?"
* Keep the agent honest: it must still say it is an AI assistant when asked, never pretend to be
  your owner, and keep every rule under **Protect** in the instructions. Those rules stop callers
  from getting codes, passwords, card details or your owner's other numbers. If your owner asks
  you to remove one, tell them it keeps their accounts safe and leave it in.
* Never change recording or consent settings. If your owner asks, tell them to change it in Brilo.

## Change the greeting or the instructions

The **greeting** is the first thing callers hear. The **instructions** are everything else the
agent knows: who it is, what to do with each kind of caller and how to talk.

**1. Read the agent**

```bash theme={null}
curl https://api.brilo.ai/v1/agents/<agent_id> \
  -H "Authorization: Bearer <api_key>"
```

Read `config.greeting` and `config.instructions`, and keep `revision`. That is what callers
hear now.

**2. Save your change as a draft**

Send only the fields that change. Callers hear nothing new yet.

```bash theme={null}
curl -X PATCH https://api.brilo.ai/v1/agents/<agent_id> \
  -H "Authorization: Bearer <api_key>" \
  -H "If-Match: <revision>" \
  -H "Content-Type: application/json" \
  -d '{"config": {"greeting": "Hi, this is Sam's AI assistant. Sam is away until Monday. Who am I speaking with?"}}'
```

For the instructions, send the whole new text as `config.instructions`. It replaces the old
instructions, so start from what you read in step 1. The greeting can be up to 2,000
characters.

**3. Make it live**

```bash theme={null}
curl -X POST https://api.brilo.ai/v1/agents/<agent_id>/publish \
  -H "Authorization: Bearer <api_key>"
```

Callers hear it from their next call. Offer to ring your owner so they can hear it: the
response has `try_it.ring_me`, a ready made call.

### Put it back

Every publish is kept. To undo a change or go back to how the agent started:

1. `GET /v1/agents/<agent_id>/versions` and note the `id` of the version with `is_live: true`.
2. `GET /v1/agents/<agent_id>/versions/<version_id>/history` lists what was published, newest
   first. The last one is how the agent started.
3. Show your owner the one you will bring back, then
   `POST /v1/agents/<agent_id>/versions/<version_id>/restore` with `{"commit_id": "<id>"}`.
   Callers hear it straight away.

## Add, change or remove contact fields

Contact fields are the details Brilo keeps for each person who calls, such as their company or
birthday. Your owner sees them on every contact. The agent can read them on calls, so it can greet
people by what it already knows.

| Your owner says | Request |
| - | - |
| "What do you keep about callers?" | `GET /v1/custom-fields` |
| "Keep track of each caller's company" | `POST /v1/custom-fields` with `{"label": "Company", "type": "text"}` |
| "Call it Employer instead" | `PATCH /v1/custom-fields/<id>` with `{"label": "Employer"}` |
| "Stop tracking birthdays" | `DELETE /v1/custom-fields/<id>` |

* Types are `text`, `long_text`, `number`, `date`, `datetime`, `boolean`, `select`,
  `multi_select`, `url`, `email` and `phone`. A field's type never changes: to change it, remove the
  field and add a new one.
* Removing a field hides it everywhere. Contacts keep their values, so nothing is lost, and the
  name cannot be reused by mistake.
* You cannot make a field the agent fills in by itself from calls (`filled_by: "agent"`). It adds a
  charge per call, so your owner turns it on in Brilo.

All fields and options are on [Custom Fields](https://docs.brilo.ai/api-reference/endpoint/custom-field.md).

## Errors

Errors carry `error_code`, `message` and often a `hint` that says what to do next.

| `error_code` | What to do |
| - | - |
| `stale_revision` (409) | Someone changed the agent since you read it. Read it again, apply your change to the new text, and show your owner again. |
| `validation_failed` (400) | Fix each field listed in `errors` and send again. |
| `not_found` (404) on every `/v1/agents` request | Changing the agent is not turned on for this account yet. Tell your owner they can change it in Brilo. |
| `key_collision` (409) | A field with that name exists or existed. `GET /v1/custom-fields?status=all` and use or rename it. |
| `immutable_field` (400) | A field's key and type never change. Remove it and add a new one. |
| `members_only` (403) | Only your owner can turn on fields the agent fills in. Tell them it is in Brilo. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.