---
ai:
  exclude: true
search:
  tags:
    - Content Resource
    - GET
seo:
  description: >-
    Returns the body of a macro (in… Reference for the GET
    /rest/api/content/{id}/history/{version}/macro/id/{macroId} endpoint in the
    Confluence Data Center API.
sidebar:
  label: Get macro body by macro ID
  badge: GET
title: Get macro body by macro ID
type: openapi-operation
---
Returns the body of a macro (in storage format) with the given id. This resource is primarily used by connect applications that require the body of macro to perform their work. 

When content is created, if no macroId is specified, then Confluence will generate a random id. The id is persisted as the content is saved and only modified by Confluence if there are conflicting IDs. 

To preserve backwards compatibility this resource will also match on the hash of the macro body, even if a macroId is found. This check will become redundant as pages get macroId's generated for them and transparently propagate out to all instances.

`GET /rest/api/content/{id}/history/{version}/macro/id/{macroId}`

**Responses**

- `200` — Returns a json representation of a macro.
- `404` — Returned if there is no content with the given id, or if the calling user does not have permission to view the content, or there is no macro matching the given id or hash.

Response example, 200:

```json
{
  "name": "panel",
  "body": "This is the body of the panel macro.",
  "parameters": {}
}
```
