Skip to Content
API reference

Versions

Every publish is a version. Release one to make it live, or roll the live pointer back.

Release a ready version

POST
/v1/artifacts/{artifact_id}/release

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.

Path Parameters

artifact_id*Artifact Id
Formatuuid

Header Parameters

authorization?string|null

Request Body

application/json
  1. body

Move live_version_id forward to a specific ready version.

version_id*Version Id
Formatuuid

Response Body

Successful Response

application/json
  1. 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 Id
Formatuuid
code*Code

The 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 Host

The 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?Ok
Defaulttrue
preview_url?|

Set when the publish created a draft instead of releasing.

released*Released

True if live_version_id now points at this version.

url*Url

Content URL serving the live version.

version*Version
Range1 <= value
version_id*Version Id
Formatuuid
warnings?array<>
Example Request
curl -X POST 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/release' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{  "version_id": "9e94c502-ca41-4342-a7f7-af96b444512c"}'
Example Response
{  "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"    }  ]}
POST
/v1/artifacts/{artifact_id}/rollback

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.

Path Parameters

artifact_id*Artifact Id
Formatuuid

Header Parameters

authorization?string|null

Request Body

application/json
  1. body

Move live_version_id back.

With no to_version_id, rolls back to the previous live version. Free owners keep the live version plus one previous, so exactly one step back is available to them.

to_version_id?|null

Response Body

Successful Response

application/json
  1. 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 Id
Formatuuid
code*Code

The 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 Host

The 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?Ok
Defaulttrue
preview_url?|

Set when the publish created a draft instead of releasing.

released*Released

True if live_version_id now points at this version.

url*Url

Content URL serving the live version.

version*Version
Range1 <= value
version_id*Version Id
Formatuuid
warnings?array<>
Example Request
curl -X POST 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/rollback' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "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"    }  ]}
GET
/v1/artifacts/{artifact_id}/versions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.

Path Parameters

artifact_id*Artifact Id
Formatuuid

Query Parameters

limit?Limit
Range1 <= value <= 200
Default50
cursor?string|null

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

A page of an artifact's versions, newest first.

artifact_id*Artifact Id
Formatuuid
page*

Cursor pagination envelope metadata.

versions*array<>
Example Request
curl -X GET 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions' \  -H 'Authorization: Bearer '
Example Response
{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "page": {    "limit": 1,    "next_cursor": "string"  },  "versions": [    {      "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "draft_host": "string",      "file_count": 0,      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "is_live": true,      "preview_url": "string",      "ready_at": "2019-08-24T14:15:22Z",      "runtime": "string",      "seq": 1,      "size_bytes": 0,      "status": "pending"    }  ]}

Get one version

GET
/v1/artifacts/{artifact_id}/versions/{version_id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.

Path Parameters

artifact_id*Artifact Id
Formatuuid
version_id*Version Id
Formatuuid

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

One version of an artifact.

artifact_id*Artifact Id
Formatuuid
created_at*Created At
Formatdate-time
created_by?|null
draft_host?|

The draft host label for this version. Absent while the version is pending: there are no bytes behind it yet.

file_count*File Count
Range0 <= value
id*Id
Formatuuid
is_live*Is Live
preview_url?|

Owner-only draft host <version_uuid>--draft, one subdomain level deep so Universal SSL covers it, and 43 octets so it fits a DNS label. Always authenticated, never publicly cached. Absent while the version is pending.

ready_at?|null
runtime?string|null
seq*Seq
Range1 <= value
size_bytes*Size Bytes
Range0 <= value
status*VersionStatus

A version is pending while its bytes are on their way and ready once they have been validated and stored. Only a ready version can be released.

Value in"pending""ready"
Example Request
curl -X GET 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/versions/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Authorization: Bearer '
Example Response
{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "draft_host": "string",  "file_count": 0,  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "is_live": true,  "preview_url": "string",  "ready_at": "2019-08-24T14:15:22Z",  "runtime": "string",  "seq": 1,  "size_bytes": 0,  "status": "pending"}