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

Get all sites

get
Authorizations
x-api-keystringRequired

You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys

Query parameters
pageinteger · min: 1Optional

Page number (≥ 1)

Default: 1
limitinteger · min: 1 · max: 100Optional

Number of items per page (1–100)

Default: 10
sortBystringOptional

Sort field

Default: name
sortOrderstring · enumOptional

Sort order

Default: ascendingPossible values:
searchstringOptional

Free text search term

Responses
200

Paginated list of sites

application/json
Responseall of
get
/sites
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
  }
}

Create a new site

post
Authorizations
x-api-keystringRequired

You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys

Body
namestring · min: 1Required

Site's name

pbjsVariableNamestringOptional

pbjs variable name. If not provided, it will be set to the default pbjsVariableName defined at scope level.

enablePrebidServerbooleanOptional

If true, initializes the site with prebidServerStatus 'to-configure'. If false or omitted, initializes with 'inactive'.

Default: false
createDefaultStackbooleanOptional

If 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.

Default: false
adManagementEnabledbooleanOptional

Indicates if Ad Management is enabled for this site

Default: false
Responses
post
/sites
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"
}

Get a site by ID

get
Authorizations
x-api-keystringRequired

You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys

Path parameters
siteIdstringRequired
Responses
200

Site found

application/json
Responseall of
get
/sites/{siteId}
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"
}

Update a site

put

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.

Authorizations
x-api-keystringRequired

You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys

Path parameters
siteIdstringRequired
Body

Schema for updating a site. Note that prebidServerStatus cannot be modified through this endpoint.

namestring · min: 1Required

Site's name

pbjsVariableNamestringRequired

pbjs variable name.

adManagementEnabledbooleanOptional

Indicates if Ad Management is enabled for this site. You are responsible to set pbjsVariableName to "kleanadsPbjs" when setting adManagementEnabled to true.

Default: false
Responses
200

Site updated

application/json
Responseall of
put
/sites/{siteId}
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"
}

Activate Prebid Server for multiple sites

post

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.

Authorizations
x-api-keystringRequired

You can generate and copy your API key from your account dashboard: https://app.pubstack.io/settings/api-keys

Body
siteIdsstring · uuid[] · min: 1Required

List of site IDs to activate for Prebid Server

createDefaultStackbooleanOptional

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.

Default: false
Responses
200

Sites activated successfully

application/json
post
/sites/pbs/activate
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