Skip to main content

List Handbook Versions

List all versions for a handbook. Returns version metadata without content, sorted newest first. The latest/current version has id: -1.

Query

query ListHandbookVersions($handbookId: Int!, $handbookType: String) {
listHandbookVersions(handbookId: $handbookId, handbookType: $handbookType) {
versions {
id
handbookId
handbookType
createdAt
versionNumber
user {
id
name
email
avatarUrl
}
}
total
}
}

Parameters

ParameterTypeRequiredDescription
handbookIdInt!YesThe handbook ID to list versions for
handbookTypeStringNoHandbook type filter. Defaults to "comprehensive"

Response

{
"data": {
"listHandbookVersions": {
"versions": [
{
"id": -1,
"handbookId": 123,
"handbookType": "comprehensive",
"createdAt": "2025-03-15T10:30:00Z",
"versionNumber": 4,
"user": {
"id": "abc-123",
"name": "John Doe",
"email": "[email protected]",
"avatarUrl": null
}
},
{
"id": 42,
"handbookId": 123,
"handbookType": "comprehensive",
"createdAt": "2025-03-10T08:00:00Z",
"versionNumber": 3,
"user": {
"id": "abc-123",
"name": "John Doe",
"email": "[email protected]",
"avatarUrl": null
}
}
],
"total": 2
}
}
}

Examples

List All Versions

query {
listHandbookVersions(handbookId: 123) {
versions {
id
versionNumber
createdAt
}
total
}
}

With Variables

query ListVersions($handbookId: Int!) {
listHandbookVersions(handbookId: $handbookId) {
versions {
id
versionNumber
createdAt
user {
name
email
}
}
total
}
}

Variables:

{
"handbookId": 123
}

Response Fields

HandbookVersionsList

FieldTypeDescription
versions[HandbookVersionListItem!]!Array of version metadata records
totalInt!Total number of versions

HandbookVersionListItem

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

Error Responses

Handbook Not Found

{
"errors": [
{
"message": "Handbook not found"
}
]
}

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
  • The version with id: -1 always represents the current/latest handbook content
  • Versions are sorted newest first
  • Content is not included in list results — use getHandbookVersion to fetch content for a specific version