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 new endpointUrl is returned once its DNS record exists. Update your Reporting-Endpoints header afterwards. 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 3 a day per website and 10 a day per workspace. Every rejection carries its own error code: subdomain_invalid_format with the rule that was broken, subdomain_reserved for a common infrastructure name, subdomain_reserved_format for a label shaped like an automatically assigned hostname, subdomain_already_claimed when it is in use, subdomain_quarantined with the availableAt date when a previous holder released it, subdomain_change_rate_limited or workspace_subdomain_change_rate_limited when a daily budget runs out, and subdomain_dns_failed when the change is saved but its DNS record could not be created, which repeating the request fixes.

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, at most 63 characters, not starting or ending with a hyphen. A label of exactly 21 hexadecimal characters is reserved for automatically assigned hostnames and is rejected, as are common infrastructure names such as www, admin, or mail.

Length1 <= length <= 253

Response Body

application/json

curl -X PATCH "https://example.com/v1/workspaces/string/websites/string/subdomain" \  -H "Content-Type: application/json" \  -d '{    "subdomain": "acme"  }'
{  "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://shop.example.com"    ],    "dropQueryAndFragments": true,    "dropReferrer": true,    "dropReportsFromExtensions": true  },  "role": "viewer",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}