# OneML overview

OneML is the XML markup you return from your webhook URL to control a live call. When PressOne needs instructions for a call, it requests your webhook URL and executes the OneML document your server returns, verb by verb, until the document runs out or a verb ends the call.

## Document rules

Every OneML document follows the same set of rules:

- The root element must be `<Response>`. PressOne rejects any document whose root element is something else.
- Verbs execute top-to-bottom, in document order.
- Unknown verbs and unknown attributes are rejected. Parsing is strict: a typo in a verb or attribute name fails the entire document, it is not silently ignored.

## Fetching OneML documents

PressOne fetches OneML documents from the webhook URL you configure. For a `GET` request, call parameters are sent as query string parameters. For a `POST` request (the default), call parameters are sent as an `application/x-www-form-urlencoded` request body.

PressOne waits at most 10 seconds for your server to respond, and follows at most 5 HTTP redirects before it gives up on the request.

## Verbs

| Verb | Description |
|------|-------------|
| [Say](/voice/oneml/say) | Speaks text to the caller using text-to-speech. |
| [Play](/voice/oneml/play) | Plays an audio file, or sends DTMF tones, to the caller. |
| [Gather](/voice/oneml/gather) | Collects DTMF digits or speech input from the caller. |
| [Record](/voice/oneml/record) | Records the caller's voice. |
| [Dial](/voice/oneml/dial) | Connects the call to another phone number. |
| [Redirect](/voice/oneml/redirect) | Fetches and executes a new OneML document. |
| [Pause](/voice/oneml/pause) | Waits silently on the call for a specified duration. |
| [Hangup](/voice/oneml/hangup) | Ends the call. |
| [Reject](/voice/oneml/reject) | Rejects an incoming call before it is answered. |
| [Stream](/voice/oneml/stream) | Streams call audio to a WebSocket endpoint. |
| [Disconnect](/voice/oneml/disconnect) | Returns control of the call to the platform dialplan without ending it. |

## Limits

| Limit | Value |
|-------|-------|
| Inline OneML document size | 4,000 characters maximum |
| Redirect loop cap | 10 consecutive parameterless redirects |
| `loop="0"` repeat cap | 1,000 iterations |
| Webhook fetch timeout | 10 seconds |

## Minimal example

The following document answers the call, speaks a greeting, and hangs up:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Say>Welcome to PressOne.</Say>
  <Hangup/>
</Response>
```
