[Canonical page](<https://docs.dhtmlx.com/planning-engine/java/api/json/overview/>)
[Full documentation index](<https://docs.dhtmlx.com/planning-engine/llms.txt>)


# json

The JSON API in the same JAR as the typed API. Its input uses snake_case field names (`start_date`, `calendar_id`, `type`) and lowercase enum spellings. Every type here is in the `org.dhtmlx.plen` package.

- [`JsonProject`](<https://docs.dhtmlx.com/planning-engine/java/api/json/json-project.md>) wraps a [`Project`](<https://docs.dhtmlx.com/planning-engine/java/api/project/project.md>) behind a string API. Each operation takes JSON text and returns an envelope string.
- [`JsonProjectException`](<https://docs.dhtmlx.com/planning-engine/java/api/json/json-project-exception.md>) is thrown by `new JsonProject(optionsJson)` when the options JSON is invalid. It carries the error envelope and the underlying [`PlenException`](<https://docs.dhtmlx.com/planning-engine/java/api/errors/plen-exception.md>).
- [`Wire`](<https://docs.dhtmlx.com/planning-engine/java/api/json/wire.md>) has the same operations as static methods on a typed `Project`, the one-shot `Wire.schedule`, and helpers that build envelopes from a typed result or an exception. Use it to mix typed and JSON calls on one project.
- [`Decode`](<https://docs.dhtmlx.com/planning-engine/java/api/json/decode.md>) turns JSON text or a parsed tree into the typed records (`ProjectData`, `SolveOptions`, `SchedulingChanges`, ...).
- [`Encode`](<https://docs.dhtmlx.com/planning-engine/java/api/json/encode.md>) writes a typed result as its JSON text.
- [`Json`](<https://docs.dhtmlx.com/planning-engine/java/api/json/json.md>) is the strict parser and canonical writer the other types use.

A success envelope is `{"ok":true,"result":...}`. A failure is `{"ok":false,"error":{"kind","message","path","code"}}`, where `kind` is `parse`, `validation` or `project`. The envelope operations catch `PlenException` and return it as an error envelope. Other exceptions, such as `NullPointerException`, propagate. For a full request and response round trip, see [Exchange JSON with a client](<https://docs.dhtmlx.com/planning-engine/java/how-to/exchange-json-with-a-client.md>).

:::category-index
:::
