Set the default site

Make a site the workspace default. The default is the site the username subdomain serves, and the one default names wherever a path takes a {siteId}, as in GET /sites/default.

PATCH https://sitepaste.com/api/v1/public/workspace

Requires the settings scope.

Usage

curl -X PATCH "https://sitepaste.com/api/v1/public/workspace" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "defaultSiteId": "s7k2m0dq1p3z" }'

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Body

FieldTypeRequiredDescription
defaultSiteIdstringYesThe site to make the default, as a short ID.

Response

200 OK with the workspace as it now stands.

{
  "id": "wsb347dq94u7",
  "username": "studio",
  "defaultSiteId": "s7k2m0dq1p3z"
}

To read the default site’s settings, use GET /sites/default.

Errors

CodeMeaning
422defaultSiteId is missing or malformed
404No site with that ID in your workspace