Claim a custom subdomain
Moves the website's reporting endpoint to a subdomain of your choice, for example shop.reports.centralcsp.com, and returns the website with its new endpointUrl. Update your Reporting-Endpoints header afterwards. The subdomain you leave stays reserved for 90 days, and during that time only this workspace can claim it back.
Errors: subdomain_invalid_format (the label breaks a naming rule, which the error names), subdomain_reserved or subdomain_reserved_format (the name is reserved), subdomain_already_claimed (another website uses it), subdomain_quarantined (another workspace released it recently, and availableAt says when it frees up), subdomain_change_rate_limited or workspace_subdomain_change_rate_limited (the daily limit is spent), and subdomain_dns_failed (the change is saved but not live yet, so send the same request again).
Limited to 3 requests a day for each website and 10 a day for each workspace, after which it answers 429 with a Retry-After header. Sending the subdomain the website already uses is free, so a retry after subdomain_dns_failed costs nothing.
Requires the manager role on the website and the custom_subdomains plan feature.
AuthorizationBearer <JWT>An OpenID Connect access token from signing in to CentralCSP, acting as the signed-in user.
workspaceId*stringThe workspace's id.
websiteId*stringThe website's id.
application/json- body
The subdomain to move the endpoint to.
subdomain*stringA single label of lowercase letters, digits, and hyphens, at most 63 characters, not starting or ending with a hyphen. Labels of exactly 21 hexadecimal characters and common names such as www, admin, or mail are reserved.
1 <= length <= 253A website and the endpoint that collects its reports.
application/json- response
id*stringUnique identifier of the website.
workspaceId*stringThe workspace the website belongs to.
name*stringDisplay name.
url*|Address of the site. Empty when none was ever recorded.
endpointUrl*stringWhere browsers send this website's reports. Put it in your Reporting-Endpoints header.
uriendpointEnabled*booleanWhether 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*stringWhen the website was created.
date-timeupdatedAt*stringWhen the website was last changed.
date-timecurl -X PATCH 'https://api.centralcsp.com/v1/workspaces/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/websites/01936b7a-6f2e-7c31-9a4d-2f8e1c5b7d90/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://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"}