About GitBook
GitBook is a documentation and knowledge base platform. The Serval GitBook integration connects to GitBook with a personal access token, giving Serval workflows read-only access to GitBook content through Serval’s authenticated proxy. The integration includes a ready-to-use workflow, Search and Read GitBook Pages, that searches a space and reads matching pages as Markdown. Authentication: API token. GitBook calls these personal access tokens. Serval stores the token securely and attaches it to requests automatically; the token is only sent to GitBook’s API host (api.gitbook.com), and workflow code never sees it.
Data sync: On demand only. Workflows read from GitBook at run time. There is no background sync or webhook setup in this integration.
What the GitBook integration enables
| Capability | Description |
|---|---|
| GitBook API requests from workflows | Workflows can call the modeled GitBook API surface through Serval’s built-in GitBook action, with your token injected automatically. |
| Search and read pages | The Search and Read GitBook Pages workflow searches one GitBook space, reads up to 10 matching pages, and returns each page’s title, path, URL when available, excerpt, and Markdown content. |
| Health checks | Two checks verify that the token can read the current user and list spaces visible to that user. |
Get your credentials
You need a GitBook personal access token. GitBook tokens are tied to the user account that creates them and have the same access that user has in GitBook.Open Developer settings
In GitBook, open your user account’s Developer settings. GitBook documents token management under API authentication.
Create a personal access token
Create a new access token for Serval. Copy it immediately and store it securely.
Connect in Serval
Paste your API token
Paste the personal access token into the API Token field. The field is a password field, so the value is hidden as you type.
Find your GitBook space ID
The Search and Read GitBook Pages workflow requires aspaceId.
You can find a space ID in either place:
- In a GitBook space URL:
https://app.gitbook.com/o/<organizationId>/s/<spaceId>. The value after/s/is the space ID. - In GitBook’s space menu, use Copy space ID when it is available.
Verifying the connection
After connecting, run the integration’s health checks from the integration page:- Get GitBook Current User - verifies that the token authenticates by reading the current GitBook user.
- Success: “Successfully connected to GitBook as [display name].” If GitBook returns an email address, the message includes it in parentheses.
- Failure: “Unable to read the current GitBook user. Please verify your API token is valid.”
- List GitBook Spaces - verifies that the token can list spaces visible to the current user.
- Success: “Successfully listed [number] GitBook space(s).”
- Failure: “Unable to list GitBook spaces. Please verify your API token has read access.”
Gotchas and troubleshooting
Search returns no pages
Search returns no pages
Confirm the
spaceId belongs to the space you want to search and that the token’s GitBook user can read that space. Also try a shorter search query. GitBook’s space search can be strict about matching all words in a query.The workflow cannot read a page that appears in GitBook
The workflow cannot read a page that appears in GitBook
The token reads as the GitBook user who created it. If that user cannot open the page in GitBook, Serval cannot read it either. Grant the user access or create the token from a user with the right access.
The workflow asks for a space ID, not a site URL
The workflow asks for a space ID, not a site URL
Use the internal GitBook space ID, not the published docs URL. In
https://app.gitbook.com/o/<organizationId>/s/<spaceId>, copy only the value after /s/.Editing credentials requires the complete new token
Editing credentials requires the complete new token
When rotating the token, paste the complete replacement token into Serval and save. Do not save a blank or partial value; Serval will use exactly what you submit.
Need help? Contact support@serval.com for assistance with your GitBook integration.

