Multi-State Handbook Example
Generate a comprehensive employee handbook for a company operating in multiple states on behalf of a customer.
Example Request
mutation GenerateMultiStateHandbook(
$email: String
$userId: String
$input: HandbookRequest!
$format: HandbookFormat
$subscriptionType: SubscriptionType!
) {
generateHandbook(
email: $email
userId: $userId
input: $input
format: $format
subscriptionType: $subscriptionType
) {
content
contentType
subscriptionType
}
}
Note: Either email OR userId must be provided (but not both).
Variables
{
"email": "[email protected]",
"input": {
"companyName": "Multi-State Corporation",
"myState": "CA",
"numberOfEmployees": 150,
"multiState": true,
"multiStateSelectedStates": ["CA", "NY", "TX", "FL", "WA"],
"industry": "PROFESSIONAL",
"handbookName": "Employee Handbook 2025",
"fullTimeHours": 40,
"payPeriodFrequency": "EVERY_TWO_WEEKS",
"performanceReviewPeriod": "EVERY_6_MONTHS",
"trialPeriod": true,
"trialPeriodDays": 90,
"paidHolidays": true,
"paidHolidayNames": "New Year's Day, Martin Luther King Jr. Day, Presidents' Day, Memorial Day, Juneteenth, Independence Day (4th of July), Labor Day, Veterans Day, Thanksgiving Day, Christmas Day",
"vacationBenefits": true,
"vacationBenefitEligibleMonths": 1,
"vacationBenefitType": "ACCRUED_PTO",
"vacationHoursEarned": 40,
"vacationBenefitCarryover": true,
"vacationBenefitsTitle": true,
"sickLeave": true,
"sickHoursEarned": 24,
"maximumSickLeave": 80,
"sickLeaveTitle": true,
"workersComp": true,
"healthInsurance": true,
"healthInsurancePlans": ["Basic PPO", "Premium HMO", "High Deductible Plan"],
"healthInsuranceTitle": true,
"directDeposit": true,
"directDepositTitle": true,
"companyVehiclesPolicy": true,
"companyVehiclesPolicyTitle": true,
"socialMediaPolicy": true,
"socialMediaPolicyTitle": true,
"progressiveDisciplinePolicy": true,
"progressiveDisciplinePolicyTitle": true,
"recordingDevicePolicy": true,
"recordingDevicePolicyTitle": true,
"employeeDressPolicy": true,
"employeeDressPolicyTitle": true,
"travelAndExpensePolicy": true,
"travelAndExpensePolicyTitle": true,
"workFromHomePolicy": true,
"workFromHomePolicyTitle": true,
"virtualMeetingsPolicy": true,
"virtualMeetingsPolicyTitle": true,
"missionStatement": true,
"missionStatementTitle": true,
"missionStatementText": "Our company exists to create value for our customers by delivering world-class products and services while fostering an inclusive and innovative work environment."
},
"format": "HTML",
"subscriptionType": "SUBSCRIPTION"
}
Generate as DOCX
To generate a DOCX file instead:
{
"email": "[email protected]",
"input": { /* same as above */ },
"format": "DOCX",
"subscriptionType": "SUBSCRIPTION"
}
Complete JavaScript Example
const generateMultiStateHandbook = async (apiToken, customerEmail, handbookInput, format = 'HTML') => {
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!, $format: HandbookFormat, $subscriptionType: SubscriptionType!) {
generateHandbook(email: $email, input: $input, format: $format, subscriptionType: $subscriptionType) {
content
contentType
subscriptionType
}
}
`,
variables: {
email: customerEmail,
input: {
companyName: 'Multi-State Corporation',
myState: 'CA',
numberOfEmployees: 150,
multiState: true,
multiStateSelectedStates: ['CA', 'NY', 'TX', 'FL', 'WA'],
industry: 'PROFESSIONAL',
handbookName: 'Employee Handbook 2025',
fullTimeHours: 40,
payPeriodFrequency: 'EVERY_TWO_WEEKS',
trialPeriod: true,
trialPeriodDays: 90,
paidHolidays: true,
vacationBenefits: true,
sickLeave: true,
healthInsurance: true,
directDeposit: true,
companyVehiclesPolicy: true,
socialMediaPolicy: true,
progressiveDisciplinePolicy: true,
workFromHomePolicy: true,
missionStatement: true,
missionStatementText: 'Our company exists to create value...',
},
format: format,
subscriptionType: 'SUBSCRIPTION',
},
}),
});
const { data } = await response.json();
return data.generateHandbook;
};
// Generate HTML version
const handbook = await generateMultiStateHandbook(
'your_api_token',
'[email protected]',
{ /* handbook input */ },
'HTML'
);
// Generate DOCX version
const generateDOCX = async (apiToken, customerEmail, handbookInput) => {
const handbook = await generateMultiStateHandbook(
apiToken,
customerEmail,
handbookInput,
'DOCX'
);
const base64Content = handbook.content;
// Decode and download
const binaryString = atob(base64Content);
const bytes = new Uint8Array(binaryString.length);
for (let i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
const blob = new Blob([bytes], {
type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'handbook.docx';
a.click();
};
Using User ID Instead of Email
{
"userId": "external_user_123",
"input": { /* same as above */ },
"format": "HTML",
"subscriptionType": "SUBSCRIPTION"
}
What's Included
This multi-state handbook includes:
- Multi-State Compliance: Employment law requirements for CA, NY, TX, FL, and WA
- Comprehensive Policies: All standard policies enabled
- Full Benefits Package: Complete benefits configuration
- Custom Content: Mission statement and custom titles
- Professional Formatting: Ready for distribution
State-Specific Content
The handbook automatically includes:
- California: State-specific leave policies, wage and hour requirements
- New York: NY-specific employment laws, paid family leave
- Texas: TX employment regulations
- Florida: FL-specific requirements
- Washington: WA state employment laws
Notes
- Requires reseller API key authentication
- Either
emailoruserIdmust be provided to identify the customer - The customer must belong to the authenticated reseller
- When
multiStateistrue,multiStateSelectedStatesis required - The handbook will include compliance content for all selected states
- Primary state (
myState) determines the base compliance framework - Additional states add supplementary compliance sections
- The handbook is automatically saved to the database and associated with the customer