Publish
One call that creates an artifact, uploads it and — depending on the plan — releases it.
bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
application/json- body
One-shot publish used by the MCP server and the CLI.
Either targets an existing artifact (artifact_id) or creates one
(kind required), and carries exactly one source: inline files for a
single HTML or JSX file, or an archive for a dist/ upload. Bytes are
base64 inline, so this path suits anything that fits comfortably in one
request; larger uploads use the explicit three-call flow, which takes the
archive as a raw body.
archive?|A zip or tar.gz, base64-encoded. This is how a dist/ upload arrives: one archive per publish, unpacked by the write service.
archive_format?|Required with archive.
artifact_id?|nulldescription?|One-paragraph summary. Shown in the built-in site index and used as the OG description fallback. Applied when this publish CREATES the artifact, the same as title and slug; use PATCH /v1/artifacts/{id} to change it afterwards.
files?array<>|Inline files. Use this for a single HTML or JSX file.
kind?|nullowner_id?|Which of your owners to act as. Defaults to your personal owner. Checked against your memberships before use: an owner you do not belong to returns FORBIDDEN, and a personal API token may only act as the owner it was minted for.
release?|Free owners always release. Pro owners default to a draft.
runtime?|nullslug?|nulltitle?|nullSuccessful Response
application/json- response
A successful publish, release or rollback. version is the human-facing sequence number; version_id is the opaque id used in URLs and in later API calls.
artifact_id*Artifact Iduuidcode*CodeThe artifact's short code, which is its live host label: the live URL is <code>.pl4m.site. Permanent and immutable, and not a credential — every request to it is still authorised. It sits next to url so a caller that needs the label does not have to take a URL apart to get it.
draft_host*Draft HostThe draft host label for this version. Always present, because a released version still has a draft host — that is how an owner previews exactly those bytes after the live pointer has moved on.
ok?Oktruepreview_url?|Set when the publish created a draft instead of releasing.
released*ReleasedTrue if live_version_id now points at this version.
url*UrlContent URL serving the live version.
version*Version1 <= valueversion_id*Version Iduuidwarnings?array<>curl -X POST 'https://app.pl4m.com/api/v1/publish' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{}'{ "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12", "code": "string", "draft_host": "string", "ok": true, "preview_url": "string", "released": true, "url": "string", "version": 1, "version_id": "9e94c502-ca41-4342-a7f7-af96b444512c", "warnings": [ { "code": "UNSUPPORTED_IMPORT", "column": 1, "file": "string", "hint": "string", "line": 1, "message": "string" } ]}