GraphQL API Documentation
Welcome to the Handbooks GraphQL API documentation. We provide two separate APIs to serve different use cases: the Customer API (for end customers. Can be integrated with frontend directly) and the Reseller API (for resellers managing multiple customers. Should be integrated with backend).
API Overview
Customer API (Public)
The Customer API is designed for end customers who want to generate and manage their own employee handbooks.
Endpoint: /api/graphql-public
Authentication: JWT Bearer Token
Use Cases:
- Generate employee handbooks
- List and retrieve your own handbooks
- Access policy updates and compliance information
- Integration with frontend directly
Key Features:
- Self-service handbook generation
- Access to your own handbook data only
- Secure JWT-based authentication
- Multiple output formats (HTML, DOCX, TXT)
Reseller API
The Reseller API is designed for resellers and partners who manage multiple customers and their handbooks.
Endpoint: /api/graphql-reseller
Authentication: Admin API Key (X-Api-Token header)
Use Cases:
- Manage multiple customers (create, update, delete)
- Generate handbooks on behalf of customers
- List and retrieve handbooks for all customers
- Generate bearer tokens for customer authentication
- Manage customer handbook limits and subscriptions
- Access policy updates and compliance information
- Integration with backend directly
Key Features:
- Multi-customer management
- Customer lifecycle operations
- Bearer token generation for customers
- Subscription and limit management
- Comprehensive handbook operations
Key Features
Multiple Output Formats
Both APIs support generating handbooks in three formats:
- HTML (default) - Returns HTML content as a string
- DOCX - Returns base64-encoded DOCX file content
- TXT - Returns plain text version (strips HTML tags)
State-Specific Compliance
The APIs automatically include state-specific employment law content based on your company's primary state and any additional states where you operate.
Comprehensive Policy Management
Access real-time policy and compliance updates filtered by:
- State(s)
- Date ranges
- Specific compliance requirements
Quick Start
For Customers
- Get Your Bearer Token - Contact your reseller to obtain your JWT bearer token
- Use the Customer Endpoint -
/api/graphql-public - Make Your First Query - Try the health check query to verify your connection
query HealthCheck {
health {
status
timestamp
}
}
For Resellers
- Get Your API Key - Contact [email protected] to obtain your admin API key
- Use the Reseller Endpoint -
/api/graphql-reseller - Make Your First Query - Try the health check query to verify your connection
query HealthCheck {
health {
status
timestamp
}
}
Next Steps
- Learn about Customer Authentication or Reseller Authentication
- Explore the Customer Queries documentation
- Explore the Reseller Queries documentation
- Check out Customer Examples or Reseller Examples for common use cases