---
ai:
  exclude: true
deprecated: 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/hash/{hash} endpoint in the
    Confluence Data Center API.
sidebar:
  label: Get macro body by hash
  badge: GET
title: Get macro body by hash
type: openapi-operation
---
Returns the body of a macro (in storage format) with the given hash. This resource is primarily used by connect applications that require the body of macro to perform their work. 

The hash is generated by connect during render time of the local macro holder and is usually only relevant during the scope of one request. For optimisation purposes, this hash will usually live for multiple requests. 

Collecting a macro by its hash should now be considered deprecated and will be replaced, transparently with macroIds. This resource is currently only called from connect addons which will eventually all use the `getContentById` resource. 

To make the migration as seamless as possible, this resource will match macros against a generated hash or a stored macroId. This will allow add ons to work during the migration period.

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

**Deprecated.**

**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 hash or id.

Response example, 200:

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