Make a template from a document the person already has
import_documentTurn a document the person already sends — their invoice, letterhead, minutes, a form — into a Galley template that reproduces its look, with a JSON Schema you can fill. PDF only (exported from the program that made it, not a scan), up to 10 pages and 20 MB.
Getting the file to Galley — send exactly one:
upload: true, the usual answer in a chat. A file the person dropped into the conversation reaches you as pages to read, not as bytes you can pass on, so this returns a one-time upload link (15 minutes, one use) for the person and a curl line for an agent with a shell. Ask the person to open the link and drop the file; then callget_import.file_url, a public https link to the PDF (a share link the person pasted).file_base64, the bytes, up to 5 MB — only for a client that already holds them in code.
Then poll get_import every few seconds; an import is usually ready in a few minutes. Galley may ask up to three questions about what on the page is fixed and what changes (get_import shows each with an image of the region), answer_import answers them, and save_import makes the template once the person has seen the preview. Nothing is a template until it is saved.
Needs a verified account on a paid plan: the keyless trial cannot import (call create_account first), and Free answers plan_required. Each paid plan includes a number of imports a month (twelve times that over the year on an annual plan), counted when one starts — failed and refused imports are not counted — and this answer says how many are left; nothing is billed per import. A document you import is sent to Anthropic's Claude API to be read and converted, under their 30-day retention; Galley deletes its copy within 7 days. Identity, financial and government documents (bank statements, diplomas, tax forms, tickets) are refused.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| auto | No | Skip the questions: every one takes its recommended answer. Default false. Use it only when the person has said they do not want to be asked. | |
| hint | No | What kind of document this is, if you know: `invoice`, `quote`, `meeting-minutes`, `letterhead`… A hint for the classifier, never a command; it does not change what the page says. | |
| name | No | Name for the template this import will save as, e.g. `ashcroft-invoice`. Optional: save_import can name it too, and the draft proposes one. | |
| upload | No | `true` for a one-time upload link (15 minutes, one use) to give the person, plus a curl line for an agent with a shell. The usual choice in a chat: a file someone dropped into the conversation reaches you as pages to read, not as bytes you can pass on. Send exactly one of `upload`, `file_url` and `file_base64`. | |
| file_url | No | A public https link to the PDF, such as a share link the person pasted. Fetched once, up to 20 MB, from public addresses only. | |
| file_base64 | No | The PDF's bytes, base64, at most 5 MB decoded. Only for a client that already holds the bytes in code. A model writing base64 out spends roughly a token for every two or three characters — a 100 KB PDF is tens of thousands of tokens — so in a chat use `upload: true`, and with a shell use its curl line. |