---
title: "Expand text macros"
method: POST
path: "/v1/objects/{object-id}/expand-text"
tags: ["Objects"]
---

# Expand text macros

`POST /v1/objects/{object-id}/expand-text`

Expand text containing NetXMS macros in the context of a given object.

## Path parameters

- `object-id` integer, required — Object ID

## Request body

- object
  - `text` string, required — Text containing macros to expand
  - `alarmId` integer — Optional alarm ID for alarm-related macro expansion
  - `inputFields` object — Optional key-value pairs for custom macro substitution

## Response `200`

Text expanded successfully

- object
  - `expandedText` string — Text with all macros expanded

## Other responses

- `400` — Invalid request or missing text parameter
- `401` — Unauthorized
- `403` — User does not have read access to given object or alarm
- `404` — Object with given ID does not exist

---

[API](https://skmtc.net/netxms/apis/netxms-api.md) · [All operations](https://skmtc.net/netxms/apis/netxms-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/netxms/netxms-api/versions/14d93e5115dd/schema)
