# POST /ui/action

Perform one action on an observed element.

This is a device HTTP route. Set `DEVICE_URL` to your reachable device URL; [connection and examples](https://mcp.applesauceos.com/doc/http.md) explain how. Do not append this path to the public MCP URL.

## Parameters

| Parameter | Type | Meaning |
| --- | --- | --- |
| `observationId` | JSON string | Required observation ID. |
| `ref` | JSON string | Required reference from the same observation. |
| `action` | JSON string | read, tap, setText, typeText, clear, scroll or scrollIntoView. |
| `text` | JSON string | Required text for setText/typeText. |
| `direction` | JSON string | Optional scroll direction: up, down, left or right; default down. |

## Response

JSON {backend,observationId,ref,action,value}. read returns fresh attributes; successful mutations return value:true.

## Example

```sh
curl --fail-with-body "$DEVICE_URL/ui/action" \
  -H 'Content-Type: application/json' \
  -d '{"observationId":"OBSERVATION_ID","ref":"e1","action":"tap"}'
```

## Notes

Use actual observation values, not these placeholders. The inspector must be closed for mutations and the same app must remain foreground. Acknowledgement is not navigation completion. Mutations are not automatically retried. HTTP typeText does not accept the JS interval option.

Check the HTTP status and any JSON error. [HTTP workflows and error handling](https://mcp.applesauceos.com/doc/http-guide.md) explain shared limits. [All endpoints](https://mcp.applesauceos.com/doc/http.md).
