Basic Handbook Example
Generate a simple single-state employee handbook with basic policies on behalf of a customer.
Example Request
mutation GenerateBasicHandbook(
$email: String
$userId: String
$input: HandbookRequest!
$subscriptionType: SubscriptionType!
) {
generateHandbook(
email: $email
userId: $userId
input: $input
subscriptionType: $subscriptionType
) {
content
contentType
subscriptionType
}
}
Note: Either email OR userId must be provided (but not both).
Variables
{
"email": "[email protected]",
"input": {
"companyName": "Acme Corporation",
"myState": "CA",
"numberOfEmployees": 25,
"multiState": false,
"multiStateSelectedStates": [],
"industry": "OTHER",
"fullTimeHours": 40,
"payPeriodFrequency": "WEEKLY",
"performanceReviewPeriod": "EVERY_YEAR",
"trialPeriod": true,
"trialPeriodDays": 90,
"paidHolidays": true,
"paidHolidayNames": "New Year's Day, Memorial Day, Independence Day, Labor Day, Thanksgiving, Christmas",
"vacationBenefits": true,
"vacationBenefitEligibleMonths": 1,
"vacationBenefitType": "ACCRUED_PTO",
"vacationHoursEarned": 40,
"vacationBenefitCarryover": true,
"sickLeave": true,
"sickHoursEarned": 24,
"maximumSickLeave": 80,
"healthInsurance": true,
"directDeposit": true,
"socialMediaPolicy": true,
"progressiveDisciplinePolicy": true
},
"subscriptionType": "ONE_TIME"
}
Complete cURL Example
curl -X POST https://handbooks.io/api/graphql-reseller \
-H "Content-Type: application/json" \
-H "X-Api-Token: YOUR_API_TOKEN" \
-d '{
"query": "mutation($email: String, $input: HandbookRequest!, $subscriptionType: SubscriptionType!) { generateHandbook(email: $email, input: $input, subscriptionType: $subscriptionType) { content contentType subscriptionType } }",
"variables": {
"email": "[email protected]",
"input": {
"companyName": "Acme Corporation",
"myState": "CA",
"numberOfEmployees": 25,
"multiState": false,
"multiStateSelectedStates": [],
"industry": "PROFESSIONAL",
"fullTimeHours": 40,
"payPeriodFrequency": "weekly",
"trialPeriod": true,
"trialPeriodDays": 90,
"paidHolidays": true,
"vacationBenefits": true,
"sickLeave": true,
"healthInsurance": true,
"directDeposit": true
},
"subscriptionType": "ONE_TIME"
}
}'
JavaScript Example
const generateBasicHandbook = async (apiToken, customerEmail, handbookInput) => {
const response = await fetch('https://handbooks.io/api/graphql-reseller', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Api-Token': apiToken,
},
body: JSON.stringify({
query: `
mutation($email: String, $input: HandbookRequest!, $subscriptionType: SubscriptionType!) {
generateHandbook(email: $email, input: $input, subscriptionType: $subscriptionType) {
content
contentType
subscriptionType
}
}
`,
variables: {
email: customerEmail,
input: {
companyName: 'Acme Corporation',
myState: 'CA',
numberOfEmployees: 25,
multiState: false,
multiStateSelectedStates: [],
industry: 'OTHER',
fullTimeHours: 40,
payPeriodFrequency: 'WEEKLY',
trialPeriod: true,
trialPeriodDays: 90,
paidHolidays: true,
vacationBenefits: true,
sickLeave: true,
healthInsurance: true,
directDeposit: true,
},
subscriptionType: 'ONE_TIME',
},
}),
});
const { data } = await response.json();
return data.generateHandbook;
};
// Usage with email
const handbook = await generateBasicHandbook(
'your_api_token',
'[email protected]',
{ /* handbook input */ }
);
console.log(handbook.content);
// Usage with userId
const handbookByUserId = await generateBasicHandbook(
'your_api_token',
null, // email
{ /* handbook input */ }
);
// In variables, use userId instead of email
Using User ID Instead of Email
{
"userId": "external_user_123",
"input": { /* same as above */ },
"subscriptionType": "ONE_TIME"
}
Response
{
"data": {
"generateHandbook": {
"content": "<html><head><title>Employee Handbook - Acme Corporation</title></head><body>...</body></html>",
"contentType": "text/html",
"subscriptionType": "ONE_TIME"
}
}
}
What's Included
This basic handbook includes:
- State-Specific Compliance: California employment law requirements
- Core Policies: Trial period, pay frequency, performance reviews
- Basic Benefits: Paid holidays, vacation/PTO, sick leave, health insurance, direct deposit
- Standard Policies: Social media policy, progressive discipline policy
Notes
- Requires reseller API key authentication
- Either
emailoruserIdmust be provided to identify the customer - The customer must belong to the authenticated reseller
- The handbook is automatically saved to the database and associated with the customer
- See Multi-State Handbook Example for companies operating in multiple states