---
title: "Get a macro."
method: GET
path: "/v2/macros/{id}"
tags: ["macroManagement"]
---

# Get a macro.

`GET /v2/macros/{id}`

Get a macro by the given identifier.

## Path parameters

- `id` string, required

## Response `200`

Macro object that was requested.

- Macro
  - `description` string — Description of the macro.
  - `definition` string, required — The definition of the macro. Use a valid Sumo Log Search expression.
  - `enabled` boolean — If the macro is enabled or not (default True)
  - `arguments` Argument[] — Arguments used in the macro.
    - `name` string, required — Argument name for the macro.
    - `type` string — The type of the macro.
  - `argumentValidations` ArgumentValidation[] — Validation expressions for the arguments.
    - `evalExpression` string, required — The expression to validate a macro argument.
    - `errorMessage` string, required — Error message to be shown if the macro argument validation fails.
  - `name` string, required — Name of the macro.
  - `macroCreationSuggestionId` string — Identifier if the suggestion comes from an macro creation suggestion. This id is used to track macro creation suggestions, and to delete the suggestion once the macro is created.
  - `id` string, required — Unique identifier for the macro. This id is used to get detailed information about the macro, such as name, definition, arguments and argument validations.
  - `createdAt` string, date-time, required — Creation timestamp of the macro in UTC in [RFC3339](https://tools.ietf.org/html/rfc3339) format.
  - `createdBy` string, required — The identifier of the user who created the macro.

## Other responses

- `default` — Operation failed with an error.

---

[API](https://skmtc.net/sumologic/apis/sumo-logic-api.md) · [All operations](https://skmtc.net/sumologic/apis/sumo-logic-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sumologic/sumo-logic-api/revisions/18a824df1e78/schema)
