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

# Render a macro against a context — the dry run before sending.

> **Required scope:** write

**Required scope:** `write`

### Path parameters

<ParamField path="id" type="string" required>
  Macro id
</ParamField>

### Request body

`RenderMacroRequest`

<ParamField body="context" type="object">
  Values for the macro's merge fields.
</ParamField>

### Response

`RenderMacroResponse`

<ResponseField name="macro_name" type="string" required />

<ResponseField name="missing_slots" type="string[]" required>
  Slots with no value supplied. Non-empty means DO NOT SEND: a macro is only safe once every field it promises is filled.
</ResponseField>

<ResponseField name="ready_to_send" type="boolean" required />

<ResponseField name="rendered" type="string" required />

<ResponseField name="tool_blocked_on" type="string[]" required>
  Unresolvable tool arguments. A partially-bound refund is worse than no refund, so the call is withheld rather than sent incomplete.
</ResponseField>

<ResponseField name="tool_call" type="object" />

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Rendered text and any unfilled slots               |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `404` | No such macro in this organization                 |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/macros/{id}/render' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "context": {}
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "macro_name": "string",
    "missing_slots": [
      "string"
    ],
    "ready_to_send": true,
    "rendered": "string",
    "tool_blocked_on": [
      "string"
    ],
    "tool_call": null
  }
  ```
</ResponseExample>
