Deploy Endpoints
Create Deployment
POST /deployDeploy a site to a live URL. Supports single HTML file or multi-file site.
Authentication: Required.
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
html | string | No* | Full HTML content for single-file deploys |
files | array | No* | Files for multi-file deploys |
slug | string | No | Custom URL slug (lowercase, hyphens only). Auto-generated if omitted. |
title | string | No | Page title |
description | string | No | Meta description |
favicon | string | No | Favicon emoji |
is_spa | boolean | No | Enable 404→index.html fallback for SPA routing |
*Either html or files is required.
files array format
[
{
"path": "index.html",
"content": "<html>...</html>",
"contentType": "text/html"
},
{
"path": "css/style.css",
"content": "body { ... }",
"contentType": "text/css"
},
{
"path": "images/logo.png",
"content": "iVBORw0KGgo...",
"contentType": "image/png",
"encoding": "base64"
}
]Single-file example:
curl -X POST https://api.based.page/deploy \
-H "Authorization: Bearer bp_your_api_key" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Hello World</h1>", "slug": "my-page", "title": "Hello"}'Response (200):
{
"id": "dep_abc123",
"slug": "my-page",
"url": "https://my-page.based.page"
}Errors: 400 (missing/invalid fields), 401 (invalid API key), 409 (slug conflict), 403 (deployment limit reached)
Get Status
GET /deploy/:idRetrieve deployment metadata.
Authentication: Required.
Example:
curl https://api.based.page/deploy/dep_abc123 \
-H "Authorization: Bearer bp_your_api_key"Response (200):
{
"id": "dep_abc123",
"slug": "my-page",
"url": "https://my-page.based.page",
"status": "active",
"storage_type": "html",
"is_spa": false,
"title": "My Page",
"description": null,
"favicon": "⚡",
"created_at": "2026-03-01T10:30:00Z",
"updated_at": "2026-03-01T14:22:00Z"
}Errors: 401 (unauthorized), 404 (not found)
Update Deployment
PUT /deploy/:idReplace the content of an existing deployment. The URL and slug remain unchanged.
Authentication: Required.
Request body:
Same fields as POST /deploy, except slug cannot be changed. Pass html or files (but not both). Metadata fields (title, description, favicon, is_spa) are optional — omit to keep existing values.
Example:
curl -X PUT https://api.based.page/deploy/dep_abc123 \
-H "Authorization: Bearer bp_your_api_key" \
-H "Content-Type: application/json" \
-d '{"html": "<h1>Updated Content</h1>"}'Response (200):
{
"id": "dep_abc123",
"slug": "my-page",
"url": "https://my-page.based.page"
}Errors: 400 (missing/invalid fields), 401 (unauthorized), 404 (not found)
Delete Deployment
DELETE /deploy/:idDelete a deployment. The page goes offline immediately and the slug is freed.
Authentication: Required.
Example:
curl -X DELETE https://api.based.page/deploy/dep_abc123 \
-H "Authorization: Bearer bp_your_api_key"Response (200):
{
"id": "dep_abc123",
"message": "Deployment deleted successfully."
}Errors: 401 (unauthorized), 404 (not found)
List Deployments
GET /deploysList all active deployments for the authenticated user.
Authentication: Required.
Response (200):
{
"deployments": [
{
"id": "dep_abc123",
"slug": "my-page",
"url": "https://my-page.based.page",
"title": "My Page",
"updated_at": "2026-03-01T14:22:00Z"
}
]
}Errors: 401 (unauthorized)
Notes
- Slug rules: lowercase, hyphens only, globally unique.
- Deletion frees up a slot against your plan limit.
- Multi-file updates via
PUTreplace all existing files with the new set.