CentralCSP
APIWebsites

Create a website

Creates a website and returns the endpoint browsers send its reports to, as endpointUrl. Point your Reporting-Endpoints header at that URL to start collecting. Counts against your plan's website limit. Send tagIds to tag it from the start; an id that is not a tag of this workspace answers 404 website_tag_not_found and nothing is created.

Requires the admin role on the workspace.

POST
/v1/workspaces/{workspaceId}/websites

Authorization

headerAuthorizationBearer <JWT>

An OpenID Connect access token from signing in to CentralCSP, acting as the signed-in user.

Path Parameters

workspaceId*string

The workspace's id.

Request Body

application/json
  1. body

The website to create.

name*string

Display name for the website.

Length1 <= length <= 255
url*string

Address of the site.

Formaturi
Lengthlength <= 2048
settings?

Initial ingestion settings. Defaults apply to anything left out.

tagIds?array<>

Ids of tags from this workspace, up to 10. Repeated ids count once.

Itemsitems <= 10

Response Body

A website and the endpoint that collects its reports.

application/json
  1. response
id*string

Unique identifier of the website.

workspaceId*string

The workspace the website belongs to.

name*string

Display name.

url*|

Address of the site. Empty when none was ever recorded.

endpointUrl*string

Where browsers send this website's reports. Put it in your Reporting-Endpoints header.

Formaturi
endpointEnabled*boolean

Whether the endpoint accepts reports right now. It turns off when the website or its workspace reaches its usage limit, and back on at the start of the next period.

legacyEndpointUrl*|

An older reporting endpoint that still forwards to endpointUrl for now, or null. Move your headers to endpointUrl.

usageLimit*||

Cap on reports accepted per period for this website. null means only the workspace limit applies.

settings*

How incoming reports are filtered and cleaned.

role*|

Your role on this website.

tags*array<>

The workspace tags this website carries, by name.

usage*

Reports accepted in the current calendar month (UTC).

createdAt*string

When the website was created.

Formatdate-time
updatedAt*string

When the website was last changed.

Formatdate-time
Example Request
curl -X POST 'https://api.centralcsp.com/v1/workspaces/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/websites' \  -H 'Content-Type: application/json' \  -d '{  "name": "Acme Shop",  "url": "https://shop.example.com"}'
Example Response
{  "id": "string",  "workspaceId": "string",  "name": "Acme Shop",  "url": "",  "endpointUrl": "https://acme.reports.centralcsp.com",  "endpointEnabled": true,  "legacyEndpointUrl": "https://report.centralcsp.com/64f1c2e8a1b2c3d4e5f60718",  "usageLimit": 0,  "settings": {    "allowedOrigins": [      "https://example.com",      "https://*.example.com"    ],    "dropQueryAndFragments": true,    "dropReferrer": true,    "dropReportsFromExtensions": true  },  "role": "viewer",  "tags": [    {      "id": "string",      "name": "production",      "color": "slate",      "description": "Sites customers reach today."    }  ],  "usage": {    "value": 12840,    "limit": 0  },  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}