***

title: getDocument
slug: /reference/typescript/agents/swml-builder/get-document
description: Return the raw SWML document object.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Returns the raw SWML document object containing the version string and all sections
with their verb arrays.

## **Parameters**

This method takes no parameters.

## **Returns**

`Record<string, unknown>` -- The SWML document object with `version` and `sections` keys.

## **Example**

```typescript {7}
import { SwmlBuilder } from '@signalwire/sdk';

const builder = new SwmlBuilder();
builder.addVerb('answer', {});
builder.addVerb('play', { url: 'https://example.com/audio.mp3' });

const doc = builder.getDocument();
console.log(doc);
// { version: '1.0.0', sections: { main: [ { answer: {} }, { play: { url: '...' } } ] } }
```