YOUR_API_KEY_HERE makes test documents too. Things to know before you send:
- Test mode is the default. The plugin sends
test: trueunless you settest: false, so documents are not charged against the plan, but PDFs carry a watermark and Excel output is cut to 20 rows. Settest: falseonly when you mean to spend quota. Every create is marked destructive, so the permission check runs before it. - Synchronous or asynchronous.
documents.createwaits for the conversion (up to 60 seconds) and returns the file itself: base64 under the inline limit, or a file id when the host keeps files.documents.createAsyncqueues a conversion and returns astatus_id;documents.statusreads it back withqueued,working,completedorfailed, anddocuments.downloadfetches the finished file by itsdownload_id. - Download URLs allow few fetches. A non-hosted
download_urlcan be fetched only a few times (as few as once, depending on the account’s data retention setting) and disappears when retention expires. Download and store the file yourself. - Hosted documents are a paid add-on.
documents.createHostedanddocuments.createHostedAsyncput the finished document on a public unbranded URL that is billed per download. The account’s retention setting does not apply to them: a hosted URL stays up untilhosted_download_limitfetches are used,hosted_expires_atpasses, ordocuments.expireremoves it. Hosted test documents allow five downloads and expire after one day. - Expiring is permanent.
documents.expireremoves a hosted document immediately and cannot be undone. - The throttle is a 403, not a 429. More than 30 simultaneous generation requests are refused with a 403 whose message names simultaneous requests; the plugin retries that once on reads. Other 403s mean a missing permission or a denied listing and are never retried. Errors are core
ApiErrors whosebodyholds DocRaptor’s XML or JSON error text;describeDocRaptorErrorBodyreads it. - Listing needs a real key. The public test key is refused
documents.listwith a 403, so its row fields are unverified and pass through as sent. - Webhooks. DocRaptor’s
callback_urlposts completion notices to your own endpoint. The callback is not signed, so the plugin does not receive it as a webhook; polldocuments.statusinstead.
- 9 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the DocRaptor API key before the first call: More: API Key
pnpm corsair setup --plugin=docraptor --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Read where a document standsWhat’s next
API reference
Every
docraptor.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.