search

Copy page

Copy page as Markdown for LLMs

View as Markdown

View this page as plain text


Open in ChatGPT

Ask ChatGPT about this page

Open in Claude

Ask Claude about this page

Reports V2 API

Generate detailed, fully branded PDF and HTML astrology reports. Reports are generated asynchronously — you receive URLs immediately and the report is ready within 10-30 seconds.


Base URL

https://pdf.divineapi.com

Authentication

Every request requires two headers:

HeaderDescription
AuthorizationBearer {api_acc_token} — identifies the user
x-api-keyUse api_key for live mode, test_api_key for test mode

Live mode deducts from remaining_credits. Test mode deducts from remaining_test_credits.


Generate Report

POST /api/v1/reports/generate

How It Works

  1. Send a POST request with birth data + branding — receive reportId + URLs immediately (status: processing)
  2. Report generates in the background (10-30 seconds)
  3. Poll GET /api/v1/reports/:reportId/status until status is completed
  4. HTML and PDF URLs are ready to view/download

Request Headers

Content-Type: application/json
Authorization: Bearer {api_acc_token}
x-api-key: {api_key}

Request Body Parameters

Birth Data (Required)

ParameterTypeRequiredDescription
report_typestringYesReport template slug (see Available Reports)
full_namestringYesPerson's full name
daynumberYesDay of birth (1-31)
monthnumberYesMonth of birth (1-12)
yearnumberYesYear of birth (1900-2100)
hournumberYesHour of birth (0-23)
minnumberYesMinute of birth (0-59)
secnumberYesSecond of birth (0-59)
genderstringYesmale or female
placestringYesBirth place (e.g. "New Delhi, India")
latnumberYesLatitude (e.g. 28.6139)
lonnumberYesLongitude (e.g. 77.2090)
tzonenumberYesTimezone offset in hours (e.g. 5.5 for IST)
lanstringOptionalLanguage code. Default: "en"

Numerology reports use fname, lname, and mobile_number instead of full_name, hour, min, sec, gender, place, lat, lon, tzone.

Company Branding (Required)

ParameterTypeRequiredDescription
company_namestringYesYour company/brand name
company_urlstringYesYour company website URL
company_emailstringYesYour company email address
company_mobilestringYesYour company phone number
company_biostringYesShort company description
footer_textstringYesText displayed in the report footer
logo_urlstringYesURL to your company logo image

Design Customization (Optional)

ParameterTypeDefaultDescription
text_primary_colorstring#000000Body text color (hex format #RRGGBB)
text_secondary_colorstring#fff6d3Secondary text color
background_colorstring#fff6d3Page background color
theme_colorstring#af1f0fTheme/accent color used for highlights, table headers, borders
heading_colorstring#af1f0fSection heading text color
font_pairingstringclassicFont combination (see Font Pairings)
front_imagestringURL to the cover page image
report_namestringCustom report title (defaults to template name)

Example Request

curl -X POST https://pdf.divineapi.com/api/v1/reports/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {api_acc_token}" \
  -H "x-api-key: {api_key}" \
  -d '{
    "report_type": "vedic-career-report",
    "full_name": "Rahul Sharma",
    "day": 15,
    "month": 6,
    "year": 1990,
    "hour": 14,
    "min": 30,
    "sec": 0,
    "gender": "male",
    "place": "New Delhi, India",
    "lat": 28.6139,
    "lon": 77.2090,
    "tzone": 5.5,
    "lan": "en",
    "company_name": "Astro Insights",
    "company_url": "https://astroinsights.com",
    "company_email": "info@astroinsights.com",
    "company_mobile": "+91 9876543210",
    "company_bio": "Your trusted source for Vedic astrology insights and guidance.",
    "footer_text": "© 2026 Astro Insights. All rights reserved.",
    "logo_url": "https://astroinsights.com/logo.png",
    "front_image": "https://astroinsights.com/cover.png",
    "report_name": "Career Astrology Report",
    "theme_color": "#ebab3d",
    "heading_color": "#800000",
    "text_primary_color": "#000000",
    "text_secondary_color": "#7b1300",
    "background_color": "#ffffff",
    "font_pairing": "elegant"
  }'

Success Response

{
  "reportId": "f8624bc3-71d8-4e72-bd95-895a9778fbd1",
  "htmlUrl": "https://pdf.divineapi.com/reports/html/84cd6e30.html?token=6adf39ad...",
  "pdfUrl": "https://pdf.divineapi.com/reports/pdfs/84cd6e30.pdf?token=df2746fe...",
  "statusUrl": "https://pdf.divineapi.com/api/v1/reports/f8624bc3-.../status?token=a1b2c3d4...",
  "status": "processing"
}
FieldDescription
reportIdUnique report identifier
htmlUrlURL to view the HTML report
pdfUrlURL to download the PDF report
statusUrlURL to poll for report completion status
statusInitial status (processing)

Error Responses

Missing Branding Fields (422)

If any required branding fields are missing:

{
  "error": "Missing required branding fields",
  "details": [
    "Please enter company name",
    "Please enter company url",
    "Please enter company email",
    "Please enter company mobile number",
    "Please enter company bio",
    "Please enter footer text",
    "Please enter logo url"
  ]
}

Invalid Color Format (400)

{
  "error": "Invalid color format for theme_color. Must be hex (#RRGGBB)."
}

Authentication Failed (401)

{
  "error": "Bearer token required"
}
{
  "error": "x-api-key header required"
}
{
  "error": "API key does not match authenticated user"
}

Insufficient Credits (402)

{
  "error": "Insufficient credits"
}

Rate Limit Exceeded (429)

{
  "error": "Rate limit exceeded. Maximum 100 reports per hour."
}

Check Report Status

GET /api/v1/reports/:reportId/status?token={token}

Poll this endpoint to check when a report is ready. The statusUrl is returned by the generate endpoint — use it directly.

Response

{
  "reportId": "f8624bc3-71d8-4e72-bd95-895a9778fbd1",
  "status": "completed",
  "htmlUrl": "https://pdf.divineapi.com/reports/html/84cd6e30.html?token=6adf39ad...",
  "pdfUrl": "https://pdf.divineapi.com/reports/pdfs/84cd6e30.pdf?token=df2746fe..."
}
StatusDescription
processingReport is being generated
completedReport is ready — HTML and PDF URLs are accessible

Available Reports

Vedic Astrology Reports

SlugReport Name
vedic-life-reportVedic Life Report
vedic-career-reportVedic Career Report
vedic-health-reportVedic Health Report
marriage-love-life-reportMarriage & Love Life Report
wealth-finance-reportWealth & Finance Report
education-academic-reportEducation & Academic Report
baby-child-reportBaby / Child Report (Bal Jyotish)
business-partnership-reportBusiness Partnership Report
nakshatra-analysis-reportNakshatra Analysis Report
sade-sati-reportSade Sati Report
mangal-dosha-reportMangal Dosha (Manglik) Report
kaal-sarp-dosha-reportKaal Sarp Dosha Report
pitra-dosha-reportPitra Dosha Report
comprehensive-dosha-remedies-reportComprehensive Dosha & Remedies Report

Numerology Reports

SlugReport Name
mobile-numerology-reportMobile Numerology Report
mobile-insight-reportMobile Insight Report

Numerology reports require fname, lname, and mobile_number instead of the standard birth data fields.


Font Pairings

ValueStyle
classicTraditional serif headings with clean body text
modernContemporary sans-serif throughout
elegantDecorative headings with refined body text
professionalBusiness-appropriate font combination
minimalClean, lightweight fonts
boldStrong, impactful heading fonts

Rate Limits

EndpointLimit
POST /reports/generate100 requests per hour per client
GET /reports/:id/status300 requests per minute per IP

Complete Flow Example

Step 1: Generate Report

curl -X POST https://pdf.divineapi.com/api/v1/reports/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer {api_acc_token}" \
  -H "x-api-key: {api_key}" \
  -d '{
    "report_type": "vedic-life-report",
    "full_name": "Priya Singh",
    "day": 22,
    "month": 3,
    "year": 1995,
    "hour": 8,
    "min": 15,
    "sec": 0,
    "gender": "female",
    "place": "Mumbai, India",
    "lat": 19.0760,
    "lon": 72.8777,
    "tzone": 5.5,
    "lan": "en",
    "company_name": "Astro Insights",
    "company_url": "https://astroinsights.com",
    "company_email": "info@astroinsights.com",
    "company_mobile": "+91 9876543210",
    "company_bio": "Your trusted source for Vedic astrology.",
    "footer_text": "© 2026 Astro Insights",
    "logo_url": "https://astroinsights.com/logo.png"
  }'

Response

{
  "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "htmlUrl": "https://pdf.divineapi.com/reports/html/xyz.html?token=abc123...",
  "pdfUrl": "https://pdf.divineapi.com/reports/pdfs/xyz.pdf?token=def456...",
  "statusUrl": "https://pdf.divineapi.com/api/v1/reports/f8624bc3-.../status?token=a1b2c3d4...",
  "status": "processing"
}

Step 2: Poll Status (wait for completion)

curl https://pdf.divineapi.com/api/v1/reports/a1b2c3d4-e5f6-7890-abcd-ef1234567890/status?token=abc123...

Response (while generating)

{
  "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "statusUrl": "https://pdf.divineapi.com/api/v1/reports/f8624bc3-.../status?token=a1b2c3d4...",
  "status": "processing"
}

Response (when ready)

{
  "reportId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "completed",
  "htmlUrl": "https://pdf.divineapi.com/reports/html/xyz.html?token=abc123...",
  "pdfUrl": "https://pdf.divineapi.com/reports/pdfs/xyz.pdf?token=def456..."
}

Step 3: Download or Display

  • Open htmlUrl in a browser to view the interactive HTML report
  • Open pdfUrl to download or embed the PDF report