Skip to Content
API reference

Artifacts

The things you publish. List, read, rename and delete them.

GET
/v1/artifacts

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Query Parameters

owner_id?|

Which of your owners to list.

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

Filter by artifact kind.

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

A page of the caller's owner's artifacts.

artifacts*array<>
page*

Cursor pagination envelope metadata.

Example Request
curl -X GET 'https://app.pl4m.com/api/v1/artifacts' \  -H 'Authorization: Bearer '
Example Response
{  "artifacts": [    {      "access": "member",      "code": "stringstri",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "description": "string",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "kind": "html",      "live_version_id": "94fda5ab-a776-479a-85d1-7f981090a9fd",      "live_version_seq": 1,      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",      "slug": "string",      "title": "string",      "toolbar_enabled": true,      "updated_at": "2019-08-24T14:15:22Z",      "url": "string",      "version_count": 0    }  ],  "page": {    "limit": 1,    "next_cursor": "string"  }}

Create an artifact

POST
/v1/artifacts

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Header Parameters

authorization?string|null

Request Body

application/json
  1. body

Create an empty artifact. Versions are added separately.

description?|

One-paragraph summary. Shown in the built-in site index and used as the OG description fallback.

kind*ArtifactKind

What was published: a single HTML file (html), a single JSX or TSX component (jsx), or a prebuilt directory (vite).

Value in"html""jsx""vite"
owner_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.

slug?|

Unique per owner. A path on your site can be mapped to it.

title?|null

Response Body

Successful Response

application/json
  1. response

An artifact as the API returns it.

access*ArtifactAccess

How the caller reaches this artifact: member of its owner, or a user_share or org_share naming them. A grantee gets a reduced response — no created_by, and version_count counts only what they may see — and GET /v1/artifacts/{id}/shares, .../link-tokens and .../versions answer NOT_FOUND for them, because those are the owner's view of the artifact.

Value in"member""user_share""org_share"
code*Code

The artifact's content-host label: <code>.pl4m.site. Immutable, unique, and not a secret — every request to it is still authorised, so a guessed code buys a 403. It stands in for the artifact's id in the host, which was 36 characters of noise in every share and every screenshot.

Match^[0-9a-hjkmnp-tv-z]{10,12}$
Length10 <= length <= 12
created_at*Created At
Formatdate-time
created_by?|

Null for a share grantee: who published it is the owner's.

description?|

One-paragraph summary. Shown in the built-in site index and used as the OG description fallback.

id*Id
Formatuuid
kind*ArtifactKind

What was published: a single HTML file (html), a single JSX or TSX component (jsx), or a prebuilt directory (vite).

Value in"html""jsx""vite"
live_version_id?|

The version viewers see. Always a ready version of this artifact.

live_version_seq?|

Human-facing number of the live version.

owner_id*Owner Id
Formatuuid
slug?string|null
title?string|null
toolbar_enabled?Toolbar Enabled

Whether the pl4m button may appear on this artifact's pages. Default true. It is shown to owners and editors; on a public page it waits for phase 3's comments. A site has the same switch, and off on either hides it.

Defaulttrue
updated_at*Updated At
Formatdate-time
url*Url

Canonical content URL of the live version, https://<code>.pl4m.site/. Private by default: opening it needs a viewer token, a share or a link.

version_count*Version Count

Versions the CALLER may see. For a member of the owner that is every version; for a share grantee it is the live one or nothing, because version history beyond live is owner-only — an unreleased draft is owner-only work, and version_count > live_version_seq is exactly the fact that one exists.

Range0 <= value
Example Request
curl -X POST 'https://app.pl4m.com/api/v1/artifacts' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{  "kind": "html"}'
Example Response
{  "access": "member",  "code": "stringstri",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "html",  "live_version_id": "94fda5ab-a776-479a-85d1-7f981090a9fd",  "live_version_seq": 1,  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",  "slug": "string",  "title": "string",  "toolbar_enabled": true,  "updated_at": "2019-08-24T14:15:22Z",  "url": "string",  "version_count": 0}

Get one artifact

GET
/v1/artifacts/{artifact_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

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

An artifact as the API returns it.

access*ArtifactAccess

How the caller reaches this artifact: member of its owner, or a user_share or org_share naming them. A grantee gets a reduced response — no created_by, and version_count counts only what they may see — and GET /v1/artifacts/{id}/shares, .../link-tokens and .../versions answer NOT_FOUND for them, because those are the owner's view of the artifact.

Value in"member""user_share""org_share"
code*Code

The artifact's content-host label: <code>.pl4m.site. Immutable, unique, and not a secret — every request to it is still authorised, so a guessed code buys a 403. It stands in for the artifact's id in the host, which was 36 characters of noise in every share and every screenshot.

Match^[0-9a-hjkmnp-tv-z]{10,12}$
Length10 <= length <= 12
created_at*Created At
Formatdate-time
created_by?|

Null for a share grantee: who published it is the owner's.

description?|

One-paragraph summary. Shown in the built-in site index and used as the OG description fallback.

id*Id
Formatuuid
kind*ArtifactKind

What was published: a single HTML file (html), a single JSX or TSX component (jsx), or a prebuilt directory (vite).

Value in"html""jsx""vite"
live_version_id?|

The version viewers see. Always a ready version of this artifact.

live_version_seq?|

Human-facing number of the live version.

owner_id*Owner Id
Formatuuid
slug?string|null
title?string|null
toolbar_enabled?Toolbar Enabled

Whether the pl4m button may appear on this artifact's pages. Default true. It is shown to owners and editors; on a public page it waits for phase 3's comments. A site has the same switch, and off on either hides it.

Defaulttrue
updated_at*Updated At
Formatdate-time
url*Url

Canonical content URL of the live version, https://<code>.pl4m.site/. Private by default: opening it needs a viewer token, a share or a link.

version_count*Version Count

Versions the CALLER may see. For a member of the owner that is every version; for a share grantee it is the live one or nothing, because version history beyond live is owner-only — an unreleased draft is owner-only work, and version_count > live_version_seq is exactly the fact that one exists.

Range0 <= value
Example Request
curl -X GET 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Authorization: Bearer '
Example Response
{  "access": "member",  "code": "stringstri",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "html",  "live_version_id": "94fda5ab-a776-479a-85d1-7f981090a9fd",  "live_version_seq": 1,  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",  "slug": "string",  "title": "string",  "toolbar_enabled": true,  "updated_at": "2019-08-24T14:15:22Z",  "url": "string",  "version_count": 0}
PATCH
/v1/artifacts/{artifact_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

Header Parameters

authorization?string|null

Request Body

application/json
  1. body

Rename an artifact, or switch its toolbar off.

Kind is immutable: it decides how bytes are built.

Every field here means "leave this alone" when absent — the route uses exclude_unset, so {"slug": null} clears the slug and an absent slug does not. toolbar_enabled has no null to clear, so absent is the only way it can mean "leave it".

description?|

One-paragraph summary. Shown in the built-in site index and used as the OG description fallback.

slug?|null
title?|null
toolbar_enabled?|

Whether the pl4m button may appear on this artifact's pages. Default true. It is shown to owners and editors; on a public page it waits for phase 3's comments. A site has the same switch, and off on either hides it.

Response Body

Successful Response

application/json
  1. response

An artifact as the API returns it.

access*ArtifactAccess

How the caller reaches this artifact: member of its owner, or a user_share or org_share naming them. A grantee gets a reduced response — no created_by, and version_count counts only what they may see — and GET /v1/artifacts/{id}/shares, .../link-tokens and .../versions answer NOT_FOUND for them, because those are the owner's view of the artifact.

Value in"member""user_share""org_share"
code*Code

The artifact's content-host label: <code>.pl4m.site. Immutable, unique, and not a secret — every request to it is still authorised, so a guessed code buys a 403. It stands in for the artifact's id in the host, which was 36 characters of noise in every share and every screenshot.

Match^[0-9a-hjkmnp-tv-z]{10,12}$
Length10 <= length <= 12
created_at*Created At
Formatdate-time
created_by?|

Null for a share grantee: who published it is the owner's.

description?|

One-paragraph summary. Shown in the built-in site index and used as the OG description fallback.

id*Id
Formatuuid
kind*ArtifactKind

What was published: a single HTML file (html), a single JSX or TSX component (jsx), or a prebuilt directory (vite).

Value in"html""jsx""vite"
live_version_id?|

The version viewers see. Always a ready version of this artifact.

live_version_seq?|

Human-facing number of the live version.

owner_id*Owner Id
Formatuuid
slug?string|null
title?string|null
toolbar_enabled?Toolbar Enabled

Whether the pl4m button may appear on this artifact's pages. Default true. It is shown to owners and editors; on a public page it waits for phase 3's comments. A site has the same switch, and off on either hides it.

Defaulttrue
updated_at*Updated At
Formatdate-time
url*Url

Canonical content URL of the live version, https://<code>.pl4m.site/. Private by default: opening it needs a viewer token, a share or a link.

version_count*Version Count

Versions the CALLER may see. For a member of the owner that is every version; for a share grantee it is the live one or nothing, because version history beyond live is owner-only — an unreleased draft is owner-only work, and version_count > live_version_seq is exactly the fact that one exists.

Range0 <= value
Example Request
curl -X PATCH 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "access": "member",  "code": "stringstri",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "description": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "html",  "live_version_id": "94fda5ab-a776-479a-85d1-7f981090a9fd",  "live_version_seq": 1,  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",  "slug": "string",  "title": "string",  "toolbar_enabled": true,  "updated_at": "2019-08-24T14:15:22Z",  "url": "string",  "version_count": 0}

Delete an artifact

DELETE
/v1/artifacts/{artifact_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

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

A delete / revoke that succeeded.

deleted_at*Deleted At
Formatdate-time
id*Id
Formatuuid
ok?Ok
Defaulttrue
Example Request
curl -X DELETE 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Authorization: Bearer '
Example Response
{  "deleted_at": "2019-08-24T14:15:22Z",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "ok": true}