Sitepaste API Documentation
The Sitepaste API lets you manage pages, upload media, and trigger builds programmatically. It is available to Pro plan users.
You can use it from a GitHub Action, an iPhone shortcut, a CLI script, or any HTTP client.
Base URL
https://sitepaste.com/api/v1/public
All requests must use HTTPS.
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /pages | Create, update, or delete pages in batch |
GET | /pages | List page metadata for a site |
DELETE | /pages/{slug} | Delete a single page by slug |
POST | /media | Upload a standalone media file |
POST | /builds | Trigger a site build |
GET | /builds/latest | Get the most recent build status |
Authentication
Every request requires a bearer token in the Authorization header:
Authorization: Bearer sp_your_token_here
Tokens are created from the dashboard under Settings > API tokens. See authentication for details.
Quick example
TOKEN="sp_your_token_here"
# Create a page and trigger a build in one request
curl -X POST https://sitepaste.com/api/v1/public/pages \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pages": [
{
"title": "Hello world",
"content": "# Hello world\n\nPublished via the API.",
"tags": ["first-post"]
}
],
"build": true
}'
Response format
All responses return JSON. Successful responses use 200, 202, or 204 status codes. Error responses include an error field:
{
"error": "validation failed",
"pages": {
"0": { "title": "title is required for new pages" }
}
}
Status codes
| Code | Meaning |
|---|---|
200 | Success |
202 | Accepted (builds) |
204 | No content (deletes) |
400 | Invalid request |
401 | Missing or invalid token |
402 | Storage or build quota exceeded |
404 | Resource not found |
413 | Request body too large |
429 | Rate limit or cooldown active |
500 | Server error |
503 | Server busy (retry shortly) |
Rate limiting
API requests are limited to 120 per minute per IP address. Batch operations count as a single request, so prefer sending multiple pages in one call rather than making separate requests.