Getting Started
Endpoints
Reference

PharmaDocs AI API

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.

Base URL
https://pharmadocsai.com
Authentication
Bearer Token (API Key)
Format
JSON (UTF-8)

Availability: API access is available on the Pro and Enterprise plans. Upgrade your plan to generate API keys.

Authentication

All API requests must include an Authorization header with a Bearer token. Generate your API key from the API Keys section of your dashboard.

Authorization: Bearer sk_pd_your_api_key_here
curl -X GET "https://pharmadocsai.com/api/v1/projects" \ -H "Authorization: Bearer sk_pd_your_api_key_here" \ -H "Content-Type: application/json"

API keys are prefixed with sk_pd_ 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.

Error Codes

All errors return a JSON body with a { "success": false, "error": "message" } shape.

HTTP StatusMeaning
200 OKRequest succeeded
201 CreatedResource created successfully
400 Bad RequestMissing or invalid parameters in the request body
401 UnauthorizedMissing or invalid API key
403 ForbiddenAPI key is valid but lacks permission (plan restriction)
404 Not FoundResource does not exist or belongs to a different account
422 UnprocessableExtracted data missing — run AI extraction in dashboard first
429 Too Many RequestsRate limit exceeded
500 Internal ErrorServer-side error — retry or contact support

Rate Limits

PlanLimitWindow
Pro500 requestsPer day
EnterpriseUnlimitedPer contract

Endpoints

All endpoints require a valid API key passed as a Bearer token.

GET/api/v1/projectsAuth Required

List all projects belonging to your account.

NameTypeInDescription
pageintegerqueryPage number (default: 1)
limitintegerqueryItems per page, max 100 (default: 20)
{ "success": true, "data": [ { "id": 1042, "product_name": "Paracetamol 500mg", "product_id": "uuid", "project_type": "amv", "status": "completed", "created_at": "2026-01-15T10:30:00Z" } ], "meta": { "total": 42, "page": 1, "limit": 20, "pages": 3 } }
GET/api/v1/projects/{id}Auth Required

Get a single project with its AI-extracted fields and list of generated documents.

NameTypeInDescription
idintegerpathProject ID returned from List Projects
{ "success": true, "data": { "id": 1042, "product_name": "Paracetamol 500mg", "status": "completed", "created_at": "2026-01-15T10:30:00Z", "extracted_fields": { "product_name": "Paracetamol 500mg", "method_of_analysis": "HPLC", "specification": "99.0 – 101.0%", "wavelength": "243 nm", "column": "C18, 250 x 4.6 mm" }, "documents": [ { "id": 88, "doc_type": "AMV_PROTOCOL", "file_name": "AMV_PROTOCOL_Paracetamol_500mg_1705312200.docx", "generated_at": "2026-01-15T11:00:00Z" } ] } }
GET/api/v1/documentsAuth Required

List generated documents. Optionally filter by project or document type.

NameTypeInDescription
project_idintegerqueryFilter by project ID
doc_typestringqueryFilter by type: AMV_PROTOCOL, AMV_REPORT, etc.
pageintegerqueryPage number (default: 1)
limitintegerqueryItems per page, max 100 (default: 20)
{ "success": true, "data": [ { "id": 88, "project_id": 1042, "doc_type": "AMV_PROTOCOL", "file_name": "AMV_PROTOCOL_Paracetamol_500mg_1705312200.docx", "file_url": "https://res.cloudinary.com/.../document.docx", "generated_at": "2026-01-15T11:00:00Z" } ], "meta": { "total": 15, "page": 1, "limit": 20, "pages": 1 } }
POST/api/v1/generateAuth Required

Trigger document generation for an existing project. The project must have AI-extracted data. Returns the generated document URL.

NameTypeInDescription
project_idintegerbodyID of the project to generate from
doc_typestringbodyamv-protocol | amv-report | amv-rs-protocol | amv-rs-report | pp-protocol | pp-report | stability-study | force-degradation
{ "success": true, "data": { "doc_type": "amv-protocol", "project_id": 1042, "file_url": "https://res.cloudinary.com/.../AMV_Protocol.docx", "file_name": "AMV_PROTOCOL_Paracetamol_500mg_1705315200.docx", "generated_at": "2026-01-15T12:00:00Z" }, "message": "Document generated successfully." }

Supported Document Types

Use these values for the doc_type field in the Generate endpoint.

ValueNameDescription
amv-protocolAMV ProtocolAnalytical Method Validation Protocol
amv-reportAMV ReportAnalytical Method Validation Report
amv-rs-protocolAMV RS ProtocolRelated Substances AMV Protocol
amv-rs-reportAMV RS ReportRelated Substances AMV Report
pp-protocolPP ProtocolProcess Validation Protocol
pp-reportPP ReportProcess Validation Report
stability-studyStability StudyICH Stability Study Document
force-degradationForce DegradationStress Testing / Force Degradation Report

Need Help?

If you have questions about the API, encounter an unexpected error, or want to request a new feature, reach out to our team.

Email SupportOpen a Ticket