> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magicmealkits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Utilities

> Single-purpose helper endpoints: JavaScript execution, JSON extraction, ISO 8601 durations, and Markdown → Slack conversion.

The Utilities group bundles small, stateless building blocks that show up again and
again inside automations. All routes are `POST` under `/api/v1` and authenticate with the
`X-API-KEY` header (see [Authentication](/authentication)).

Error shapes differ per endpoint — rely on each operation's response schema, not one
blanket shape:

* `javascript` and `slack/convert` fail with `{ "success": false, "error": "..." }`.
* `json/extract` and the `iso8601/*` routes return `{ "status": "error", "error": "..." }`
  on a Pro-gate failure, and a `200` with `is_valid: false` (ISO) or an `error` field
  (JSON) when the input can't be parsed.

## Endpoints

| Endpoint                   | Tier    | What it does                                                   |
| -------------------------- | ------- | -------------------------------------------------------------- |
| `POST /javascript`         | Basic   | Run JavaScript in a sandboxed VM (10 KB code cap, ≤10 s)       |
| `POST /json/extract`       | **Pro** | Pull the first JSON object/array out of mixed text             |
| `POST /iso8601/format`     | **Pro** | Format an ISO 8601 duration into human-readable strings        |
| `POST /iso8601/components` | **Pro** | Decompose an ISO 8601 duration into days/hours/minutes/seconds |
| `POST /slack/convert`      | Basic   | Convert Markdown to Slack Block Kit (rate limited)             |

<Note>
  `json/extract` and both `iso8601/*` endpoints require a **Pro** license — a Basic key
  gets `you are not a magic meal kits PRO user`. See [Authentication](/authentication).
</Note>

## Notes

* **JavaScript** runs in a secure sandbox. Values passed in `args` are available as the
  `args` array inside the script. Timeout defaults to 5000 ms (max 10000 ms).
* **Slack convert** is rate limited; it returns both the Block Kit `blocks` and a
  `blockKitUrl` you can open in Slack's Block Kit Builder to preview.

Use the interactive playground on each endpoint page to try a request with your own
deployment host and API key.
