Create a site
Create a site. A request beyond the sites your plan has paid for returns 402 with the current counts and charges nothing.
POST https://sitepaste.com/api/v1/public/sites
Requires the settings scope.
Usage
curl -X POST "https://sitepaste.com/api/v1/public/sites" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Portfolio" }'
Authorizations
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | The site’s name, up to 100 characters. Leading and trailing spaces are removed. The new site is not made the default; use set the default site for that. |
Errors
422 when name is missing, empty after trimming, or longer than 100 bytes; fields names it.
A 402 names the reason and the capacity, in the standard error envelope with the counts alongside:
{
"error": "Site limit reached. Add more sites to your plan.",
"code": "site_limit_reached",
"limit": 2,
"used": 2
}
Nothing is created when the request is refused. Buy the capacity in the dashboard, then retry.
Response
201 Created with the new site’s full settings document, in the same shape read a site returns, and a Location header naming it.