Generate a site search pass

Exchanges the content token of a published site's visitor for a short-lived search pass, which lets the visitor's browser call the site search operation directly. The reply has no pass when search passes are not enabled for the site, or when the visitor token of an authenticated visitor is missing, invalid or expired.

post
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
organizationIdstringRequired

A unique entity identifier

Pattern: ^[a-zA-Z0-9_-]+$
siteIdstringRequired

The unique id of the site

Body
visitorTokenstringOptional

Visitor token of the session the content token was resolved for. Required for a pass on a site with visitor authentication or for an authenticated visitor; the pass never outlives it.

Responses
200

The search pass, when one was issued.

application/json
post/orgs/{organizationId}/sites/{siteId}/search/pass
POST /v1/orgs/{organizationId}/sites/{siteId}/search/pass HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 23

{
  "visitorToken": "text"
}
200

The search pass, when one was issued.

{
  "searchPass": {
    "token": "text",
    "expiresAt": "2026-01-01T00:00:00.000Z"
  }
}

Last updated

Was this helpful?

Powered by GitBook