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

# fromJson

> Build a PromptObjectModel from JSON data (static).

[ref-pom]: /docs/server-sdks/reference/typescript/agents/pom-object-model

[ref-tojson]: /docs/server-sdks/reference/typescript/agents/pom-object-model/to-json

Static factory that reconstructs a [`PromptObjectModel`][ref-pom] from JSON
data. Use this to restore a model serialized via [`toJson()`][ref-tojson].

## **Parameters**

Either a JSON string or an already-parsed array of section data objects. A
string is parsed with `JSON.parse()`; anything else is used directly.

## **Returns**

[`PromptObjectModel`][ref-pom] -- A new model populated from the supplied data.

## **Example**

```typescript {8}
import { PromptObjectModel } from '@signalwire/sdk';

const data = [
  { title: 'Intro', body: 'Welcome.' },
  { title: 'Rules', bullets: ['Be nice.', 'Stay on topic.'] },
];

const pom = PromptObjectModel.fromJson(data);
console.log(pom.renderMarkdown());
```