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
| Parameter | Type | Required | Description |
|---|---|---|---|
handbookId | Int! | Yes | The handbook ID to list versions for |
handbookType | String | No | Handbook 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
| Field | Type | Description |
|---|---|---|
versions | [HandbookVersionListItem!]! | Array of version metadata records |
total | Int! | Total number of versions |
HandbookVersionListItem
| Field | Type | Description |
|---|---|---|
id | Int! | Version ID. -1 represents the current/latest version |
handbookId | Int! | Handbook ID this version belongs to |
handbookType | String! | Type of handbook (comprehensive or basic) |
createdAt | String! | ISO 8601 timestamp when this version was created |
versionNumber | Int! | Sequential version number |
user | HandbookVersionUser | User 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: -1always represents the current/latest handbook content - Versions are sorted newest first
- Content is not included in list results — use
getHandbookVersionto fetch content for a specific version