Welcome to WhatDoc API
The WhatDoc API enables you to programmatically generate, manage, and customize documentation for your GitHub repositories. This REST API uses JWT authentication and returns JSON responses.Base URL
All API requests should be made to:API Routes Structure
The API is organized into the following route groups:/auth- Authentication and user management/projects- Project creation and management/payment- Payment and subscription handling
Response Format
Success Response
All successful API responses follow this structure:Error Response
Error responses include an error message and appropriate HTTP status code:HTTP Status Codes
The API uses standard HTTP status codes:| Status Code | Description |
|---|---|
200 | Success - Request completed successfully |
201 | Created - Resource created successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing authentication |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource not found |
409 | Conflict - Resource already exists |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error - Server error |
Rate Limiting
API endpoints are rate-limited to prevent abuse:- Generation endpoints: 30 requests per minute
- Standard headers are included in rate limit responses
- When rate limited, you’ll receive a
429status code
CORS
The API supports CORS for:- Whitelisted origins configured in
CORS_ORIGINS - Subdomains of
whatdoc.xyz - Custom domains configured in project settings
Content Type
All requests with a body should include theContent-Type header:
Bring Your Own Key (BYOK)
For LLM API calls, you can optionally provide your own API key: Headers:X-Custom-Api-Key- Your LLM provider API keyX-Target-Model- Target model (default:gemini-2.5-flash-lite)
Payment Endpoints
Create Order
Create a Razorpay payment order for upgrading to Pro.Plan tier to upgrade to. Options:
"499" (₹499/month - 10 repos) or "999" (₹999/month - 25 repos)Razorpay order ID to be used in payment verification
Amount in smallest currency unit (paise for INR)
Razorpay key ID for client-side payment integration
Verify Payment
Verify Razorpay payment and activate Pro subscription.Order ID from create-order response
Payment ID from Razorpay client callback
Payment signature from Razorpay client callback
Plan tier being purchased (
"499" or "999")Pro subscriptions are valid for 30 days from the payment verification date.
Next Steps
Authentication
Learn how to authenticate API requests
Projects
Create and manage documentation projects
Generation
Monitor documentation generation status
Customization
Customize your documentation site
