Skip to main content

Reseller API: Get Handbook Version

Get a single handbook version with full content. Use versionId: -1 to get the current/latest version.

Query​

query GetHandbookVersion($handbookId: Int!, $versionId: Int!, $handbookType: String) {
getHandbookVersion(handbookId: $handbookId, versionId: $versionId, handbookType: $handbookType) {
id
handbookId
handbookType
content
createdAt
versionNumber
user {
id
name
email
avatarUrl
}
}
}

Parameters​

ParameterTypeRequiredDescription
handbookIdInt!YesThe handbook ID
versionIdInt!YesThe version ID to retrieve. Use -1 for the current version
handbookTypeStringNoHandbook type filter. Defaults to "comprehensive"

Response​

{
"data": {
"getHandbookVersion": {
"id": 42,
"handbookId": 123,
"handbookType": "comprehensive",
"content": "<html><head><title>Employee Handbook</title></head><body>...</body></html>",
"createdAt": "2025-03-10T08:00:00Z",
"versionNumber": 3,
"user": {
"id": "abc-123",
"name": "John Doe",
"email": "[email protected]",
"avatarUrl": null
}
}
}
}

Examples​

Get Current Version​

query {
getHandbookVersion(handbookId: 123, versionId: -1) {
id
content
versionNumber
createdAt
}
}

Get Specific Version​

query {
getHandbookVersion(handbookId: 123, versionId: 42) {
id
content
versionNumber
createdAt
user {
name
}
}
}

With Variables​

query GetVersion($handbookId: Int!, $versionId: Int!) {
getHandbookVersion(handbookId: $handbookId, versionId: $versionId) {
id
content
versionNumber
createdAt
}
}

Variables:

{
"handbookId": 123,
"versionId": 42
}

Response Fields​

HandbookVersionDetail​

FieldTypeDescription
idInt!Version ID. -1 represents the current/latest version
handbookIdInt!Handbook ID this version belongs to
handbookTypeString!Type of handbook (comprehensive or basic)
contentString!Full HTML content of this version
createdAtString!ISO 8601 timestamp when this version was created
versionNumberInt!Sequential version number
userHandbookVersionUserUser who created this version

Error Responses​

Version Not Found​

{
"data": {
"getHandbookVersion": null
}
}

Access Denied​

{
"errors": [
{
"message": "Handbook not found or access denied"
}
]
}

Notes​

  • Requires reseller API key authentication
  • The handbook must belong to a customer of the authenticated reseller
  • Use versionId: -1 to always get the current/latest content
  • Returns null if the version ID does not exist
  • The content field contains the full HTML content of the handbook at that point in time