---
updatedAt: 2026-04-28T09:31:16.000Z
agentTools:
  projectIndex: https://docs.makaira.io/llms.txt
---

# Get snippet by ID

The snippet endpoint is usable for Enterprise customers and is used to retrieve the snippets that you can configure in the Makaira backend.

Returns one or more page editor snippets by their IDs. Snippets are reusable content blocks managed in the Makaira Page Editor.

## Request

**`POST /enterprise/snippets`**

### Headers

| Header               | Value                            |
| -------------------- | -------------------------------- |
| `Content-Type`       | `application/json`               |
| `X-Makaira-Instance` | Your Makaira instance identifier |

### Request Body

| Field         | Type   | Required | Description                                        |
| ------------- | ------ | -------- | -------------------------------------------------- |
| `snippetIds`  | array  | Yes      | Array of snippet IDs to retrieve.                  |
| `constraints` | object | Yes      | Must include `query.shop_id` and `query.language`. |

### Example Request

```json
{
  "snippetIds": ["footer-info", "promo-banner"],
  "constraints": {
    "query.shop_id": "1",
    "query.language": "de"
  }
}
```

## Response

Returns a JSON object keyed by snippet ID, each containing the rendered snippet content.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Makaira API",
    "version": "1.0",
    "contact": {
      "name": "Makaira GmbH",
      "url": "https://www.makaira.io/",
      "email": "support@makaira.io"
    },
    "description": "API of the powerful Makaira Search/Recommendation and Marketing Suite"
  },
  "servers": [
    {
      "url": "https://{yourinstance}.makaira.io"
    }
  ],
  "paths": {
    "/enterprise/snippets": {
      "post": {
        "summary": "Get snippet by ID",
        "tags": [
          "Storefront APIs"
        ],
        "operationId": "post-enterprise-snippets",
        "parameters": [
          {
            "$ref": "#/components/parameters/instance"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        },
        "description": "The snippet endpoint is usable for Enterprise customers and is used to retrieve the snippets that you can configure in the Makaira backend.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "snippetIds": {
                    "type": "array",
                    "description": "The snippet IDs to search for.",
                    "items": {
                      "type": "string"
                    }
                  },
                  "constraints": {
                    "type": "object",
                    "properties": {
                      "query.shop_id": {
                        "type": "string",
                        "description": "This constraints acts as an implicit filter and only returns products that belong to the given Shop-ID. Only relevant if you have multiple shops."
                      },
                      "query.language": {
                        "type": "string",
                        "description": "The language constraints tells Makaira in what language to search and return data for."
                      }
                    },
                    "required": [
                      "query.shop_id",
                      "query.language"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "instance": {
        "in": "header",
        "name": "X-Makaira-Instance",
        "required": true,
        "description": "Makaira Instance ID",
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authentication by JSON Web Token\n"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```