Sites
Operations related to site resources
You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys
You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys
Page number (≥ 1)
1Number of items per page (1–100)
10Sort field
nameSort order
ascendingPossible values: Free text search term
Paginated list of sites
Missing or invalid API key
Internal Server Error
GET /public/v1/sites HTTP/1.1
Host: api.pubstack.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"data": [
{
"name": "text",
"pbjsVariableName": "text",
"prebidServerStatus": "to-configure",
"adManagementEnabled": true,
"env": "web",
"id": "text",
"script": "text"
}
],
"pagination": {
"page": 1,
"limit": 1,
"total": 1,
"totalPages": 1
}
}You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys
Site's name
pbjs variable name. If not provided, it will be set to the default pbjsVariableName defined at scope level.
If true, initializes the site with prebidServerStatus 'to-configure'. If false or omitted, initializes with 'inactive'.
falseIf true and enablePrebidServer is also true, a default stack will be created automatically for the site. The default stack will use the "All active bidders" bidder rule. If a stack already exists for this site, no action will be taken. This option has no effect if enablePrebidServer is false or omitted.
falseIndicates if Ad Management is enabled for this site
falseSite created
Bad Request - Input does not match schema
Missing or invalid API key
Internal Server Error
POST /public/v1/sites HTTP/1.1
Host: api.pubstack.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 52
{
"name": "My Node website",
"enablePrebidServer": true
}{
"id": "UUID",
"name": "My Node website",
"script": "https://boot.pubstack.io/v1/tag/UUID",
"pbjsVariableName": "pbjs",
"prebidServerStatus": "to-configure"
}You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys
Site found
Missing or invalid API key
Internal Server Error
GET /public/v1/sites/{siteId} HTTP/1.1
Host: api.pubstack.io
x-api-key: YOUR_API_KEY
Accept: */*
{
"name": "text",
"pbjsVariableName": "text",
"prebidServerStatus": "to-configure",
"adManagementEnabled": true,
"env": "web",
"id": "text",
"script": "text"
}Updates a site's properties. Note: The prebidServerStatus field cannot be modified through this endpoint. Use POST /sites/pbs/activate to activate Prebid Server for sites.
You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys
Schema for updating a site. Note that prebidServerStatus cannot be modified through this endpoint.
Site's name
pbjs variable name.
Indicates if Ad Management is enabled for this site. You are responsible to set pbjsVariableName to "kleanadsPbjs" when setting adManagementEnabled to true.
falseSite updated
Bad Request - Input does not match schema
Missing or invalid API key
Internal Server Error
PUT /public/v1/sites/{siteId} HTTP/1.1
Host: api.pubstack.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 69
{
"name": "text",
"pbjsVariableName": "text",
"adManagementEnabled": false
}{
"name": "text",
"pbjsVariableName": "text",
"prebidServerStatus": "to-configure",
"adManagementEnabled": true,
"env": "web",
"id": "text",
"script": "text"
}Updates the prebidServerStatus to 'to-configure' for the specified sites. Only affects sites that currently have status 'inactive'. Sites that are already activated (to-configure, to-deploy, or up-to-date) are ignored. Only sites belonging to the authenticated scope will be updated.
Optionally, you can set createDefaultStack to true to automatically create a default stack for each activated site using the "All active bidders" bidder rule. If a stack already exists for a site, it will not create a duplicate.
You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys
List of site IDs to activate for Prebid Server
If true, a default stack will be created automatically for each activated site. The default stack will use the "All active bidders" bidder rule. If a stack already exists for a site, no action will be taken for that site.
falseSites activated successfully
Bad Request - Invalid input
Missing or invalid API key
Internal Server Error
POST /public/v1/sites/pbs/activate HTTP/1.1
Host: api.pubstack.io
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"siteIds": [
"uuid-1",
"uuid-2",
"uuid-3"
]
}{
"count": 2,
"updatedSites": [
{
"id": "uuid-1",
"name": "My Site 1",
"prebidServerStatus": "to-configure"
},
{
"id": "uuid-2",
"name": "My Site 2",
"prebidServerStatus": "to-configure"
}
]
}Last updated
