Copy page
Copy page as Markdown for LLMs
Base URL: https://pdf.divineapi.com
All report generation requests require two headers:
| Header | Value | Description |
|---|---|---|
Authorization | Bearer <api_acc_token> | User's bearer token from Divine API |
x-api-key | <api_key> or <test_api_key> | Determines live or test mode |
Live mode (api_key): Deducts from remaining_credits
Test mode (test_api_key): Deducts from remaining_test_credits
Product listing endpoints (GET /api/v1/products) are public and require no authentication.
Get all available report products for listing on your website.
GET /api/v1/productsAuthentication: None required
Example:
curl https://pdf.divineapi.com/api/v1/productsResponse (200):
[
{
"id": "9480c262-a91b-4569-a285-2fc4f674add8",
"name": "Education & Academic Report",
"slug": "education-academic-report",
"creditCost": 99,
"description": null,
"shortDescription": null,
"imageUrl": null,
"reportType": "Vedic",
"category": "Careers, Education & Finances",
"sampleHtmlUrl": null,
"samplePdfUrl": null,
"docUrl": null,
"isPopular": true,
"sortOrder": 0,
"template": {
"name": "Education & Academic Report",
"slug": "education-academic-report"
}
},
{
"id": "e384bef1-a927-4671-b81b-08240139114e",
"name": "Vedic Health Report",
"slug": "vedic-health-report",
"creditCost": 1,
"description": null,
"shortDescription": null,
"imageUrl": null,
"reportType": null,
"category": null,
"sampleHtmlUrl": null,
"samplePdfUrl": null,
"docUrl": null,
"isPopular": false,
"sortOrder": 0,
"template": {
"name": "Vedic Health Report",
"slug": "vedic-health-report"
}
},
{
"id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "Vedic Career Report",
"slug": "vedic-career-report",
"creditCost": 1,
"description": null,
"shortDescription": null,
"imageUrl": null,
"reportType": null,
"category": null,
"sampleHtmlUrl": null,
"samplePdfUrl": null,
"docUrl": null,
"isPopular": false,
"sortOrder": 0,
"template": {
"name": "Vedic Career Report",
"slug": "vedic-career-report"
}
}
]Get details for a specific product by its slug.
GET /api/v1/products/:slugAuthentication: None required
Example:
curl https://pdf.divineapi.com/api/v1/products/vedic-health-reportSubmit birth data to generate a full astrology report (HTML + PDF).
POST /api/v1/reports/generateAuthentication: Required (Bearer token + API key)
Content-Type: application/json
Authorization: Bearer <api_acc_token>
x-api-key: <api_key or test_api_key>| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
report_type | string | Yes | Must be a valid template slug | Report to generate |
full_name | string | Yes | — | Full name of the person |
day | number | Yes | 1–31 | Birth day |
month | number | Yes | 1–12 | Birth month |
year | number | Yes | 1900–2100 | Birth year |
hour | number | Yes | 0–23 | Birth hour (24h format) |
min | number | Yes | 0–59 | Birth minute |
sec | number | Yes | 0–59 | Birth second |
gender | string | Yes | — | "male" or "female" |
place | string | Yes | — | Birthplace name |
lat | number | Yes | — | Latitude (e.g. 28.6139) |
lon | number | Yes | — | Longitude (e.g. 77.2090) |
tzone | number | Yes | — | Timezone offset in hours (e.g. 5.5for IST) |
lan | string | No | Default: "en" | Language code |
font_pairing | string | No | classic, modern, elegant, professional, minimal, bold | Font style for the report |
| report_type | Name | Credit Cost | Sections | Word Count |
|---|---|---|---|---|
vedic-career-report | Vedic Career Report | 1 | 13 | ~2,000 |
vedic-health-report | Vedic Health Report | 1 | 22 | ~6,500 |
education-academic-report | Education & Academic Report | 99 | 22 | ~6,500 |
curl -X POST https://pdf.divineapi.com/api/v1/reports/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1Q..." \
-H "x-api-key: 83cd001efdc14045852ecb823f0f0e6e" \
-d '{
"report_type": "vedic-health-report",
"full_name": "Rahul Sharma",
"day": 15,
"month": 5,
"year": 1990,
"hour": 14,
"min": 30,
"sec": 0,
"gender": "male",
"place": "New Delhi, India",
"lat": 28.6139,
"lon": 77.2090,
"tzone": 5.5
}'{
"reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"htmlUrl": "https://pdf.divineapi.com/reports/a1b2c3d4.html",
"pdfUrl": "https://pdf.divineapi.com/reports/a1b2c3d4.pdf",
"status": "processing"
}Important: The API returns immediately with status: "processing". The report is generated in the background and typically takes 30–90 seconds.
-The htmlUrl initially shows a loading page that auto-refreshes when the report is ready.
-The pdfUrl becomes downloadable once generation is complete.
| Status | Response | Cause |
|---|---|---|
| 400 | {"error": "full_name is required, day is required, ..."} | Missing or invalid fields |
| 401 | {"error": "Bearer token required"} | Missing Authorization header |
| 401 | {"error": "x-api-key header required"} | Missing x-api-key header |
| 401 | {"error": "Invalid Bearer token"} | Token not found in database |
| 401 | {"error": "API key does not match authenticated user"} | API key doesn't belong to this user |
| 402 | {"error": "Insufficient credits", "required": 99, "available": 10, "isTestMode": false} | Not enough credits to generate this report |
| 403 | {"error": "Tenant account is inactive"} | Account has been deactivated |
| 429 | {"error": "Rate limit exceeded. Maximum 100 reports per hour."} | Too many requests |
-Credits are deducted atomically before report generation starts.
-If report generation fails, credits are refunded automatically.
-The credit cost for each report is defined in the Products table and can be managed via the admin dashboard.
-402 Insufficient credits response includes required (cost) and available (current balance) fields for user-friendly error messages.
| Limit | Value |
|---|---|
| Report generation | 100 requests per hour per tenant |
Optional font_pairing parameter to customize the report's typography:
| Value | Heading Font | Body Font |
|---|---|---|
classic(default) | Georgia, Times New Roman | Georgia, Times New Roman |
modern | Google Sans (Montserrat) | Google Sans (Open Sans) |
elegant | Playfair Display | Lora |
professional | Roboto Slab | Roboto |
minimal | Inter | Inter |
bold | Oswald | Source Sans Pro |
Manage products, templates, tenants, and view reports at:
https://pdf.divineapi.com/admin/-All timestamps are in UTC.
-The htmlUrl and pdfUrl are permanent links — they do not expire.
-Reports are stored on the server and served as static files.
-The same birth data parameters are used across all report types — only report_type changes.