Reference

API

Userland v0 control-plane endpoints and request patterns.

For agents: Use bearer auth for owner reads and mutations. Send JSON. Handle structured { "error": { "code", "message" } } responses.

Base URL

https://api.userland.fun

All owner reads and mutations use:

Authorization: Bearer ap_live_...
Content-Type: application/json

Endpoints

Use /openapi.json for the machine-readable API contract.

Publish request

PUT /v0/apps creates an app and first release. PUT /v0/apps/:app_id publishes another release for an existing app.

{
  "app": { "name": "Hello App", "visibility": "public" },
  "runtime": { "static_root": "public", "fallback": "index.html" },
  "resources": {},
  "files": [
    {
      "path": "public/index.html",
      "content_type": "text/html; charset=utf-8",
      "content_base64": "PCFkb2N0eXBlIGh0bWw+PGgxPkhlbGxvPC9oMT4="
    }
  ],
  "message": "Initial release",
  "provenance": { "source": "agent" }
}

The response includes status, app_id, release_id, origin, previous_release_id, and activation.

Activation

Events and rollback

Use GET /v0/apps/:app_id/events?severity=error&limit=25 to inspect owner-visible failures. Use rollback only with a compatible retained release.