GitBook API API reference Docs sitesSite ads Control and customize ad placements on your docs site.
Manage the advertisement strategy within your docs. You can specify ad placements, track usage, and adjust settings to best fit your organization’s needs.
Update a site ads settings
post
https://api.gitbook.com/v1 /orgs/ {organizationId} /sites/ {siteId} /ads
organizationId string Required The unique id of the organization
siteId string Required The unique id of the site
status string · enum Optional Possible values: in-review
disabled
topic string · enum Optional Possible values: webdev
crypto
Copy POST /v1/orgs/{organizationId}/sites/{siteId}/ads HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 39
{
"status": "in-review",
"topic": "webdev"
}
List all the sites with ads configured
get
https://api.gitbook.com/v1 /ads/sites
page string Optional Identifier of the page results to fetch.
limit number · max: 1000 Optional The number of results per page
status string · enum Optional Filter sites by their ads review status
Default: in-review
Possible values: in-review
live
rejected
X-GitBook-Partner-Key string Required
Response all of
object Optional
Show properties
Copy GET /v1/ads/sites HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-GitBook-Partner-Key: text
Accept: */*
Update the Ads configuration for a site
patch
https://api.gitbook.com/v1 /ads/sites/ {siteId}
siteId string Required The unique id of the site
X-GitBook-Partner-Key string Required
one of Optional
object Optional
Show properties
or object Optional
Show properties
or object Optional
Show properties
Copy PATCH /v1/ads/sites/{siteId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-GitBook-Partner-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 54
{
"status": "live",
"zoneId": "text",
"reportingId": "text"
}