The 2026 State of Docs survey is live 📝 Whether you write, edit, or just rely on docs, we want to hear from you!
Take the survey
LogoLogo
ProductPricingLog inSign up
  • Documentation
  • Developers
  • Guides
  • Changelog
  • Developer documentation
  • Build an integration
    • Quickstart
    • Install the CLI
      • CLI reference
    • Configure your integration
    • Develop your integration
      • ContentKit
        • Component reference
        • Markdown
      • Integration runtime
      • Client library
        • GitBook methods
    • Publish your integration
    • Submit your integration for review
    • Concepts
    • Guides
      • Create a custom unfurl action
      • Create interactive blocks
      • Receive webhook notifications
      • Work with HTTP requests
  • GitBook API
    • Quickstart
    • API reference
      • Organizations
        • Organization members
        • Organization invites
        • Organization AI ask
      • Docs sites
        • Site share links
        • Site structure
        • Site auth
        • Site preview
        • Site customization
        • Site spaces
        • Site sections
        • Site section groups
        • Site redirects
        • Site MCP servers
        • Site ads
        • Site users
        • Site insights
        • Site AI
        • Site AI ask
      • Collections
        • Collection users
        • Collection teams
      • Spaces
        • Space content
        • Space comments
        • Space embeds
        • Space users
        • Space teams
        • Space integrations
        • Git
      • Change requests
        • Change request content
        • Change request contributors
        • Change request reviewers
        • Change request comments
      • Translations
        • Glossary
      • Imports
      • Integrations
      • URLs
      • OpenAPI
        • OpenAPI spec versions
      • Conversations
      • Custom fonts
      • Subdomains
      • Users
      • Teams
        • Team members
      • SSO
      • Storage
      • Custom hostnames
      • System info
      • Download OpenAPI spec
    • Authentication
    • Rate limiting
    • Pagination
    • Errors
    • Concepts
    • Guides
      • Track advanced analytics with GitBook's Events Aggregation API
  • Resources
    • ContentKit playground
    • GitHub examples
Powered by GitBook
On this page
  1. GitBook API
  2. API reference
  3. Docs sites

Site ads

Control and customize ad placements on your docs site.

Last updated 16 hours ago

Was this helpful?

LogoLogo

Resources

  • Showcase
  • Enterprise
  • Status

Company

  • Careers
  • Blog
  • Community

Policies

  • Subprocessors
  • Terms of Service
CtrlK
  • POSTUpdate a site ads settings
  • GETList all the sites with ads configured
  • PATCHUpdate the Ads configuration for a site

Was this helpful?

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
Authorizations
Path parameters
organizationIdstringRequired

The unique id of the organization

siteIdstringRequired

The unique id of the site

Body
statusstring · enumOptionalPossible values:
topicstring · enumOptional

Topic of the content

Possible values:
Responses
204

OK

post
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"
}
204

OK

No content

List all the sites with ads configured

get
Authorizations
Query parameters
pagestringOptional

Identifier of the page results to fetch.

limitnumber · max: 1000Optional

The number of results per page

statusstring · enumOptional

Filter sites by their ads review status

Default: in-reviewPossible values:
Header parameters
X-GitBook-Partner-KeystringRequired
Responses
200

OK

application/json
Responseall of
get
GET /v1/ads/sites HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
X-GitBook-Partner-Key: text
Accept: */*
200

OK

{
  "next": {
    "page": "text"
  },
  "count": 1,
  "items": [
    {
      "id": "text",
      "url": "text",
      "email": "text",
      "topic": "webdev",
      "status": "in-review"
    }
  ]
}

Update the Ads configuration for a site

patch
Authorizations
Path parameters
siteIdstringRequired

The unique id of the site

Header parameters
X-GitBook-Partner-KeystringRequired
Body
one ofOptional
or
or
Responses
204

OK

patch
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"
}
204

OK

No content