Skip to content

Deploy Endpoints

Create Deployment

POST /deploy

Deploy a site to a live URL. Supports single HTML file or multi-file site.

Authentication: Required.

Request body:

FieldTypeRequiredDescription
htmlstringNo*Full HTML content for single-file deploys
filesarrayNo*Files for multi-file deploys
slugstringNoCustom URL slug (lowercase, hyphens only). Auto-generated if omitted.
titlestringNoPage title
descriptionstringNoMeta description
faviconstringNoFavicon emoji
is_spabooleanNoEnable 404→index.html fallback for SPA routing

*Either html or files is required.

files array format

json
[
  {
    "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:

bash
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):

json
{
  "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/:id

Retrieve deployment metadata.

Authentication: Required.

Example:

bash
curl https://api.based.page/deploy/dep_abc123 \
  -H "Authorization: Bearer bp_your_api_key"

Response (200):

json
{
  "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/:id

Replace 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:

bash
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):

json
{
  "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/:id

Delete a deployment. The page goes offline immediately and the slug is freed.

Authentication: Required.

Example:

bash
curl -X DELETE https://api.based.page/deploy/dep_abc123 \
  -H "Authorization: Bearer bp_your_api_key"

Response (200):

json
{
  "id": "dep_abc123",
  "message": "Deployment deleted successfully."
}

Errors: 401 (unauthorized), 404 (not found)


List Deployments

GET /deploys

List all active deployments for the authenticated user.

Authentication: Required.

Response (200):

json
{
  "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 PUT replace all existing files with the new set.

Deploy apps from conversation.