How do I let an AI agent write the integration?
This API is meant to be integrated by Claude Code, Codex, Cursor or whatever else you have open. Two files exist for that, and a button that writes the prompt for you.
The two files
| File | What is in it |
|---|---|
/llms.txt | A short index: what this service is, and one line per documentation page. Cheap to fetch and enough to decide what to read next. |
/llms-full.txt | Everything, in one fetch: every endpoint, every setting, the response envelope, every outcome code with its number and whether it is retryable, then the whole guide as text. About 100 KB. |
Both are generated from the running service. The settings come out of the request model, the outcome numbers out of the error catalogue, the response shape out of the code that builds it. They cannot describe a version of the API that does not exist, which is the whole reason to point an agent at them rather than let it infer the contract from an example.
The button
Your console has an Integrate with AI button on each
template. It writes a prompt that already names your template id, the fields
that template reads, and a payload of the right shape — the three things
an agent cannot look up — and points it at
/llms-full.txt for everything it can.
The prompt never contains your API key, on purpose. It
says to read the key from the DOCONURE_API_KEY environment
variable. A prompt is pasted into a chat transcript, stored by whoever runs
the model, and often ends up in a file that gets committed; a key that
reaches all three has been published. Reading it from the environment is
also the integration you would want anyway, so there is nothing to trade
off.
Rules for an agent
If you are writing the prompt yourself, these are the five that matter. They are the ones that are cheap to state and expensive to get wrong.
- Read
/llms-full.txtbefore writing any code. Do not infer the request shape from an example. Unknown keys anywhere in the body outsidedataare refused, not ignored, so a plausible-looking invented setting fails the whole call (datais yours, and is free-form). - Read the API key from the environment
(
DOCONURE_API_KEY). Never write it into a source file, a committed config, or a log line. - Branch on
code, never onmessage. Every failure carries a stablecodeand a four-digitnumber; the message is a hint for a human reading a log and may be reworded at any time. - Retry only when the body says
"retryable": true. ATEMPLATE_DATA_MISMATCHretried a hundred times fails a hundred times, and each attempt is billed as work done. - Surface
output.warnings. A call can succeed having done less than it was asked.TEMPLATE_FIELDS_MISSINGmeans the PDF was produced with blanks in it and names the fields; swallowing that warning is how a customer finds out from their own customer.
Two more that are about this API in particular: generation is
synchronous, so use a client timeout of at least 120 seconds;
and send "responseFormat": "json" inside settings
if you want the ids, the warnings and the document in one JSON body rather
than raw PDF bytes with the identifiers in headers.
Model Context Protocol
An official MCP server is planned and not built yet, so
that this page does not promise one. When it exists it will expose the
operations an agent actually needs — list templates, fetch a template's
expected fields, validate a payload before spending a credit on it, generate a
document, read usage — and it will be announced here and in
/llms.txt.
Until then, /llms-full.txt plus an agent that can make HTTP
requests is the whole integration, and it is enough: there is one endpoint to
learn and no SDK to install.
Next: First document · Outcomes and error codes · Generating a document