Skip to Content
API reference

Overview

The base URL, the credential, the error envelope, and what this reference leaves out.

Beta: subject to change. Endpoints, fields and error codes may change without a version bump. The one thing that holds today is the failure shape: every error is the same envelope, with a machine-readable code.

Every write to artifacts, versions, shares, sites and tokens goes through this API. The MCP server, the CLI and the dashboard all call these endpoints — there are no separate code paths behind them, so anything an agent can do, a caller here can do.

Base URL

https://app.pl4m.com/api

So GET /v1/artifacts is https://app.pl4m.com/api/v1/artifacts.

Authentication

Authorization: Bearer pl4m_pat_…

A personal API token. It is pinned to one owner, carries a set of scopes, and is stored hashed — it is shown once, when it is created.

TODO — minting a token has no self-serve screen yet. POST /v1/tokens exists and needs a signed-in session, but the dashboard has no page for it.

An OAuth token from the MCP flow does not work here. It is bound to /mcp as its resource, and honouring it on the REST API too would make that binding decorative. See Other MCP clients.

Two rules that hold everywhere

The owner comes from your credential, never from the request. owner_id is optional wherever it appears, and where it appears it is a choice among the owners your credential already belongs to — checked before it is used. Naming one you do not belong to is FORBIDDEN, not a way in.

Every failure is the same envelope, so a calling agent can fix the problem and retry rather than parse a message:

{
  "ok": false,
  "stage": "build",
  "errors": [
    {
      "code": "UNSUPPORTED_IMPORT",
      "message": "…",
      "file": "App.jsx",
      "line": 3,
      "column": 1,
      "hint": "…"
    }
  ],
  "warnings": []
}

code is the field to branch on. ErrorCode in any operation's error response lists every value.

What this reference leaves out

It is generated from a snapshot of the service's own contract, with a documented list of exclusions — 40 operations are published and 17 are withheld. The withheld ones fall into four groups:

Why
Livenesstells a load balancer the process is up, and nothing a caller can act on
The OAuth consent step, and share-link redemptiondriven by a signed-in browser, not by an API credential
Viewer-token mintingreached through get_preview_url and pl4m open, which hand you a URL. The URL format is not a contract
The dashboard's own reads, the three-phase upload, and custom domainsinternal, in flux, or switched off on every plan

The list, with a reason for each entry, is one file in this repository. It is applied by a script that prints what it kept and what it dropped, so an endpoint cannot quietly appear or disappear from this reference.

The MCP server is not described here either: its tools and their schemas are discovered over the protocol itself. Connect your agent is its guide.

On this page