The PharmaDocs AI REST API lets you integrate pharmaceutical document generation into your LIMS, ERP, or custom workflows. Authenticate with an API key and access your projects and documents programmatically.
Availability: API access is available on the Pro and Enterprise plans. Upgrade your plan to generate API keys.
GET /api/v1/projects to find the project's id (a UUID).POST /api/v1/generate with that project_id and a doc_type.file_url — it is a public HTTPS link to the generated .docx; fetch it directly (no auth header needed for the file itself).All API requests must include an Authorization header with a Bearer token. Generate your API key from the API Keys section of your dashboard.
API keys are prefixed with sk_pd_ (followed by 40 hex characters) and are tied to a specific company account. Keep your key secret — treat it like a password. Revoke and regenerate it from your dashboard if compromised.
Use server-side only. Call the API from your backend — never embed your sk_pd_ key in browser/front-end JavaScript or a mobile app, where it would be exposed to end users. Your front-end should call your own server, which then calls the PharmaDocs AI API. (The API does not send CORS headers, so direct browser calls are blocked by design.)
All errors return a JSON body with a { "success": false, "error": "message" } shape.
| HTTP Status | Meaning |
|---|---|
| 200 OK | Request succeeded |
| 201 Created | Resource created successfully |
| 400 Bad Request | Missing or invalid parameters in the request body |
| 401 Unauthorized | Missing or invalid API key |
| 402 Payment Required | Monthly document quota exhausted — upgrade your plan |
| 403 Forbidden | Your plan does not include API access (Pro/Enterprise only) |
| 404 Not Found | Resource does not exist or belongs to a different account |
| 422 Unprocessable | Extracted data missing — run AI extraction in dashboard first |
| 429 Too Many Requests | Daily request rate limit exceeded |
| 500 Internal Error | Server-side error — retry or contact support |
| Plan | Limit | Window |
|---|---|---|
| Free | No API access | — |
| Pro | 500 requests | Per day (UTC) |
| Enterprise | 100,000 requests | Per day (UTC) |
Only successful (2xx) requests count toward the daily limit; the window resets at 00:00 UTC. Document generation also counts against your monthly document quota (the same quota as the dashboard — e.g. 200/month on Pro). When the daily request cap is hit you receive 429; when the monthly document quota is exhausted, 402.
All endpoints require a valid API key passed as a Bearer token.
/api/v1/projectsAuth RequiredList all projects belonging to your account.
| Name | Type | In | Description |
|---|---|---|---|
| page | integer | query | Page number (default: 1) |
| limit | integer | query | Items per page, max 100 (default: 20) |
/api/v1/projects/{id}Auth RequiredGet a single project with its AI-extracted fields and list of generated documents.
| Name | Type | In | Description |
|---|---|---|---|
| id | string (uuid) | path | Project UUID returned from List Projects |
/api/v1/documentsAuth RequiredList generated documents. Optionally filter by project or document type. The doc_type filter uses the STORED upper-snake form (e.g. AMV_PROTOCOL), not the lower-hyphen value used by the Generate endpoint.
| Name | Type | In | Description |
|---|---|---|---|
| project_id | string (uuid) | query | Filter by project UUID |
| doc_type | string | query | Filter by stored type: AMV_PROTOCOL, AMV_REPORT, AMV_RS_PROTOCOL, … (upper-snake) |
| page | integer | query | Page number (default: 1) |
| limit | integer | query | Items per page, max 100 (default: 20) |
/api/v1/generateAuth RequiredGenerate a document for an existing project. The project must already have AI-extracted data (run extraction in the dashboard first). Counts against your monthly document quota. Returns a public file_url you can download directly.
| Name | Type | In | Description |
|---|---|---|---|
| project_id | string (uuid) | body | UUID of the project to generate from |
| doc_type | string | body | amv-protocol | amv-report | amv-rs-protocol | amv-rs-report | pp-protocol | pp-report | stability-study | force-degradation (lower-hyphen) |
Use these values for the doc_type field in the Generate endpoint.
| Value | Name | Description |
|---|---|---|
| amv-protocol | AMV Protocol | Analytical Method Validation Protocol |
| amv-report | AMV Report | Analytical Method Validation Report |
| amv-rs-protocol | AMV RS Protocol | Related Substances AMV Protocol |
| amv-rs-report | AMV RS Report | Related Substances AMV Report |
| pp-protocol | PP Protocol | Process Validation Protocol |
| pp-report | PP Report | Process Validation Report |
| stability-study | Stability Study | ICH Stability Study Document |
| force-degradation | Forced Degradation | Stress Testing / Forced Degradation Report |
If you have questions about the API, encounter an unexpected error, or want to request a new feature, reach out to our team.