/// GUIDE

How do I make my first ASHDOCS API call?

Grab a sandbox API key, run a curl against /api/v1/tools/html-to-pdf, and receive your first PDF in under 60 seconds.

Published: Last updated:

Answer: You make your first ASHDOCS call by signing up, copying the auto-issued sandbox key, and firing a single curl against POST /api/v1/tools/html-to-pdf. Sandbox keys never bill — the full call round-trip takes under 60 seconds and produces a signed URL you can open in the browser.

1. Sign up and grab your sandbox key

Head to app.ashdocs.com/signup. On landing, a sandbox key (ash_test_...) is issued automatically and displayed in the dashboard.

2. Send your first request

The following curl converts a small HTML string to a PDF. Sandbox keys never bill.

curl -X POST https://www.ashdocs.com/api/v1/tools/html-to-pdf \
  -H "X-API-Key: ash_test_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "html": "<h1>Hi</h1>", "options": { "format": "A4" } }'

3. Inspect the response

The response includes job_id, status, and a signed URL under output_files[].

{
  "job_id": "job_01H...",
  "status": "completed",
  "credits_consumed": 0,
  "output_files": [
    { "url": "https://storage.ashdocs.com/...signed", "filename": "output.pdf", "size_bytes": 4231 }
  ]
}

4. Subscribe to webhooks (optional)

For async workflows, subscribe to job.completed so your app is notified as soon as a job finishes.

curl -X POST https://www.ashdocs.com/api/webhooks \
  -H "X-API-Key: ash_test_xxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://your.app/hook", "events": ["job.completed"] }'

How do I move from sandbox to live keys?

Once you're happy with the sandbox flow, generate a live key at /keys. Live keys have the prefix ash_live_ and deduct credits from your plan on every successful call. Test and live keys can coexist on the same account — nothing else changes about the request.

Frequently asked questions

Do I need to create a live API key to run the quickstart?

No. Signup issues a sandbox test key immediately (prefix ash_test_) — the quickstart works entirely on that key and never bills.

What is the base URL for the ASHDOCS API?

The base URL is https://www.ashdocs.com. Every endpoint under /api/v1/* is versioned and stable.

Do I need to include a Content-Type header?

Yes for JSON bodies (`Content-Type: application/json`). Multipart file uploads set their own boundary — do not set Content-Type manually for those.

What is returned on a successful HTML-to-PDF call?

A JSON response with job_id, status='completed', and output_files[] — each entry has a signed URL for downloading the rendered PDF. Signed URLs expire after 1 hour.

How do I switch from sandbox to live keys?

Generate a live key in the dashboard at /keys. Live keys have the prefix ash_live_ and deduct credits from your monthly plan on every successful call.