Site 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
Authorizations
Path parameters
organizationIdstringrequired

The unique id of the organization

siteIdstringrequired

The unique id of the site

Body
statusstring · enumoptionalAvailable options:
topicstring · enumoptional

Topic of the content

Available options:
Responses
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-reviewAvailable options:
Header parameters
X-GitBook-Partner-Keystringrequired
Responses
application/json
all ofoptional
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
Responses
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

Was this helpful?