CentralCSP
APIWebsites

Claim a custom subdomain

Moves the website's ingestion endpoint to a subdomain of your choice, for example shop.reports.centralcsp.com. The DNS record is created before the change is saved, and the new endpointUrl is returned. Update your Reporting-Endpoints header afterwards. A subdomain already taken by another website is rejected, and so is one that looks like an automatically assigned hostname. The subdomain you move away from is held for 90 days before anyone else can take it, and during that time only this workspace can claim it back. Changes are limited to a few per website and per workspace each day.

Requires the manager role on the website and the custom_subdomains plan feature.

PATCH
/v1/workspaces/{workspaceId}/websites/{websiteId}/subdomain

Authorization

AuthorizationBearer <token>

An OpenID Connect access token issued by Keycloak, acting as the signed-in user.

In: header

Path Parameters

workspaceId*string
websiteId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

subdomain*string

A single DNS label of lowercase letters, digits, and hyphens, not starting or ending with a hyphen. A label of exactly 21 hexadecimal characters is reserved for automatically assigned hostnames and is rejected.

Match^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$
Length1 <= length <= 63

Response Body

application/json

curl -X PATCH "https://api-next.centralcsp.com/v1/workspaces/string/websites/string/subdomain" \  -H "Content-Type: application/json" \  -d '{    "subdomain": "acme"  }'
{  "id": "string",  "workspaceId": "string",  "name": "Acme Shop",  "url": "https://shop.example.com",  "endpointUrl": "https://acme.reports.centralcsp.com",  "endpointEnabled": true,  "usageLimit": 0,  "settings": {    "allowedOrigins": [      "https://shop.example.com"    ],    "dropQueryAndFragments": true,    "dropReferrer": true,    "dropReportsFromExtensions": true  },  "role": "viewer",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}