---
title: "Whether an upstream macro preset can be filled from a document"
type: reference
method: GET
path: /rest-api/upstream-macro-presets/from-document.do
tag: "Placements"
---

# Whether an upstream macro preset can be filled from a document

`GET https://YOUR-NETWORK-DOMAIN/rest-api/upstream-macro-presets/from-document.do`

available is false when no Anthropic key is set up (reason no_key) or this month's AI budget is spent (reason limit); the preset editor offers Fill from document only while it is true. Also answers the size limits a document is held to: a PDF, an image, a text or HTML file or downloaded page, and pasted text. Requires the UPSTREAM_MACRO_PRESETS admin permission and an Anthropic key: the user's own, the network's, or Epom's while the network's plan includes it.

## Responses

- `200` — {available, reason, maxPdfMb, maxImageMb, maxPageMb, maxTextLength}
- `400` — Bad request — invalid or missing parameters
- `401` — Authentication error
- `403` — Insufficient permissions, naming the missing one

## Example request

```bash
curl --request GET \
  --url 'https://YOUR-NETWORK-DOMAIN/rest-api/upstream-macro-presets/from-document.do' \
  --header 'X-Api-Key: YOUR_API_KEY'
```

Source: https://epom.com/ad-server/docs/api/placements/get-upstream-macro-presets-from-document