# avatar.expression

Source: https://docs.lightair.app/developers/remote-api/avatar.expression

> Sets an avatar's expression, or clears it.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Avatars and co-host. Script plugins need the `project.write` permission.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `source` | `string` | no | The avatar's source id or name. Default: the only avatar in the workspace. |
| `expression` | `string` | no | One of its expressions; empty for none. |

## Errors

Not found (-32004) when the workspace has no avatar or the source doesn't exist. Invalid params (-32602) when there are several avatars and no `source`, or the source isn't an avatar. Not found (-32004) when the model has no such expression; the message lists the ones it has.

## Events

- `workspace.changed`

## From an AI agent

The MCP server's `avatar (action: expression)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "avatar.expression", "params": { "expression": "Happy" } }
```

Result:

```json
{}
```

## Related

- [avatar.status](https://docs.lightair.app/developers/remote-api/avatar.status.md)
