Skip to Content
API reference

Sites

Your personal or org site: what is mounted where, the index, and 301s a move left behind.

GET
/v1/sites

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?|null

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

A site as the API returns it.

audience*SiteAudience

Who may read the site. Not settable: it is the owner's kind. A user site is public; an org site is org_members, and there are no public parts on an org site in phase 2.

Value in"public""org_members"
created_at*Created At
Formatdate-time
default_description?string|null
default_title?string|null
handle?|

The owner's handle, which is the site's host label. Null means the site has no host yet and resolves to nothing.

id*Id
Formatuuid
index*

The built-in index: on by default at /, listing the site's artifacts.

artifact_ids is null for "all", which is not the same as an empty list -- an empty list is refused, because "show nothing" is what enabled: false means and two spellings of one state is how a resolver comes to disagree with itself.

"All" is the site's MOUNTED artifacts, in path order, and not the owner's artifacts. An index entry is a link; an artifact with no route on this site has nowhere on it to link to, so listing one would produce a 404 with the owner's title on it.

owner_id*Owner Id
Formatuuid
toolbar_enabled?Toolbar Enabled

Whether the pl4m button may appear anywhere on this site. Composed with each artifact's own switch; off on either hides it.

Defaulttrue
updated_at*Updated At
Formatdate-time
url?|

The site's canonical URL, https://<handle>.pl4m.site/. Null until a handle is claimed.

Example Request
curl -X GET 'https://app.pl4m.com/api/v1/sites' \  -H 'Authorization: Bearer '
Example Response
{  "audience": "public",  "created_at": "2019-08-24T14:15:22Z",  "default_description": "string",  "default_title": "string",  "handle": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "index": {    "artifact_ids": [      "6f888f5b-43a6-445b-b585-d59aaf6e5beb"    ],    "enabled": true,    "path": "/"  },  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",  "toolbar_enabled": true,  "updated_at": "2019-08-24T14:15:22Z",  "url": "string"}
PATCH
/v1/sites

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

The site-level title and description, and the site's toolbar switch. There is no audience field, and that is the point: a site's audience follows from whether its owner is a person or an org, so an org site cannot be made public by a request. The two text fields are a full replacement — omitting one clears it.

default_description?|null
default_title?|null
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.

toolbar_enabled?|

Whether the pl4m button may appear anywhere on this site. Default true. Unlike the two fields above, omitting this leaves it unchanged rather than resetting it: a boolean has no null to mean clear, so absent is the only way to say do not touch. Off here hides the button on every path, whatever each artifact says.

Response Body

Successful Response

application/json
  1. response

A site as the API returns it.

audience*SiteAudience

Who may read the site. Not settable: it is the owner's kind. A user site is public; an org site is org_members, and there are no public parts on an org site in phase 2.

Value in"public""org_members"
created_at*Created At
Formatdate-time
default_description?string|null
default_title?string|null
handle?|

The owner's handle, which is the site's host label. Null means the site has no host yet and resolves to nothing.

id*Id
Formatuuid
index*

The built-in index: on by default at /, listing the site's artifacts.

artifact_ids is null for "all", which is not the same as an empty list -- an empty list is refused, because "show nothing" is what enabled: false means and two spellings of one state is how a resolver comes to disagree with itself.

"All" is the site's MOUNTED artifacts, in path order, and not the owner's artifacts. An index entry is a link; an artifact with no route on this site has nowhere on it to link to, so listing one would produce a 404 with the owner's title on it.

owner_id*Owner Id
Formatuuid
toolbar_enabled?Toolbar Enabled

Whether the pl4m button may appear anywhere on this site. Composed with each artifact's own switch; off on either hides it.

Defaulttrue
updated_at*Updated At
Formatdate-time
url?|

The site's canonical URL, https://<handle>.pl4m.site/. Null until a handle is claimed.

Example Request
curl -X PATCH 'https://app.pl4m.com/api/v1/sites' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "audience": "public",  "created_at": "2019-08-24T14:15:22Z",  "default_description": "string",  "default_title": "string",  "handle": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "index": {    "artifact_ids": [      "6f888f5b-43a6-445b-b585-d59aaf6e5beb"    ],    "enabled": true,    "path": "/"  },  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",  "toolbar_enabled": true,  "updated_at": "2019-08-24T14:15:22Z",  "url": "string"}
PUT
/v1/sites/index

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

Configure the built-in index.

artifact_ids?array<>|

Null means every artifact mounted on the site, ordered by mount path. A list means exactly these, in this order. Every entry must be a live artifact of the site's owner.

enabled?Enabled

A built-in index answers at / by default. The owner can switch it off.

Defaulttrue
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.

path?Path

Where the index answers. Its own path only, never as a tree: a path under it with no route is a 404. <path>index.json is the same listing as JSON.

Length1 <= length <= 512
Default"/"

Response Body

Successful Response

application/json
  1. response

A site as the API returns it.

audience*SiteAudience

Who may read the site. Not settable: it is the owner's kind. A user site is public; an org site is org_members, and there are no public parts on an org site in phase 2.

Value in"public""org_members"
created_at*Created At
Formatdate-time
default_description?string|null
default_title?string|null
handle?|

The owner's handle, which is the site's host label. Null means the site has no host yet and resolves to nothing.

id*Id
Formatuuid
index*

The built-in index: on by default at /, listing the site's artifacts.

artifact_ids is null for "all", which is not the same as an empty list -- an empty list is refused, because "show nothing" is what enabled: false means and two spellings of one state is how a resolver comes to disagree with itself.

"All" is the site's MOUNTED artifacts, in path order, and not the owner's artifacts. An index entry is a link; an artifact with no route on this site has nowhere on it to link to, so listing one would produce a 404 with the owner's title on it.

owner_id*Owner Id
Formatuuid
toolbar_enabled?Toolbar Enabled

Whether the pl4m button may appear anywhere on this site. Composed with each artifact's own switch; off on either hides it.

Defaulttrue
updated_at*Updated At
Formatdate-time
url?|

The site's canonical URL, https://<handle>.pl4m.site/. Null until a handle is claimed.

Example Request
curl -X PUT 'https://app.pl4m.com/api/v1/sites/index' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "audience": "public",  "created_at": "2019-08-24T14:15:22Z",  "default_description": "string",  "default_title": "string",  "handle": "string",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "index": {    "artifact_ids": [      "6f888f5b-43a6-445b-b585-d59aaf6e5beb"    ],    "enabled": true,    "path": "/"  },  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",  "toolbar_enabled": true,  "updated_at": "2019-08-24T14:15:22Z",  "url": "string"}
DELETE
/v1/sites/redirects/{redirect_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

redirect_id*Redirect Id
Formatuuid

Query Parameters

owner_id?|null

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/sites/redirects/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}
GET
/v1/sites/routes

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?|null

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

Everything routed on a site, plus the index and the redirects a move left behind. One response rather than three calls, because they are one answer — and because three calls would be three chances to render a list of routes that disagrees with itself.

redirects*array<>

301s left by moves, in path order. A live route at the same path wins.

routes*array<>

Mounted routes, in path order -- which is also index order.

site*

A site as the API returns it.

Example Request
curl -X GET 'https://app.pl4m.com/api/v1/sites/routes' \  -H 'Authorization: Bearer '
Example Response
{  "redirects": [    {      "created_at": "2019-08-24T14:15:22Z",      "from_path": "string",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",      "to_path": "string"    }  ],  "routes": [    {      "artifact_code": "stringstri",      "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",      "artifact_title": "string",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "path": "string",      "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",      "updated_at": "2019-08-24T14:15:22Z",      "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"    }  ],  "site": {    "audience": "public",    "created_at": "2019-08-24T14:15:22Z",    "default_description": "string",    "default_title": "string",    "handle": "string",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "index": {      "artifact_ids": [        "6f888f5b-43a6-445b-b585-d59aaf6e5beb"      ],      "enabled": true,      "path": "/"    },    "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",    "toolbar_enabled": true,    "updated_at": "2019-08-24T14:15:22Z",    "url": "string"  }}
POST
/v1/sites/routes

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

Mount an artifact at a path on the site. This is the one call that creates a public address: on a personal site the path is readable by anyone, with no credential; on an org site, by every member. The artifact must belong to the site's owner.

artifact_id*Artifact Id
Formatuuid
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.

path*Path

A path prefix on the site. Normalised to a leading and trailing slash, because every mount is a tree: /about, about and /about/ all mean /about/, which serves /about, /about/ and everything under it. The root is /.

Length1 <= length <= 512

Response Body

Successful Response

application/json
  1. response

One mounted route.

artifact_code*Artifact Code

The live content host's label: <code>.<content domain>.

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

Who mounted it. Null only when that account has since been deleted: the route stays mounted and loses its attribution, because unmounting an org's home page over a departed admin would be worse.

id*Id
Formatuuid
path*Path

The canonical mount prefix, always ending in /.

site_id*Site Id
Formatuuid
updated_at*Updated At
Formatdate-time
updated_by?|

Who last moved it. Null if it has never moved, or if that account has since been deleted. This is the field the database authorises on a move, not created_by: checking the role of whoever mounted a route rather than whoever is changing it let a plain member repoint an admin's route.

Example Request
curl -X POST 'https://app.pl4m.com/api/v1/sites/routes' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "path": "string"}'
Example Response
{  "artifact_code": "stringstri",  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "artifact_title": "string",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "path": "string",  "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",  "updated_at": "2019-08-24T14:15:22Z",  "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"}
DELETE
/v1/sites/routes/{route_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

route_id*Route Id
Formatuuid

Query Parameters

owner_id?|null

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/sites/routes/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}
POST
/v1/sites/routes/{route_id}/move

Authorization

bearerAuth
headerAuthorizationBearer <token>

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

Path Parameters

route_id*Route Id
Formatuuid

Header Parameters

authorization?string|null

Request Body

application/json
  1. body

Move a route, leaving a 301 behind.

leave_redirect?Leave Redirect

Whether the old path keeps 301-redirecting to the new one. Default yes, because somebody has the old link; the owner can delete the redirect afterwards.

Defaulttrue
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.

path*Path

A path prefix on the site. Normalised to a leading and trailing slash, because every mount is a tree: /about, about and /about/ all mean /about/, which serves /about, /about/ and everything under it. The root is /.

Length1 <= length <= 512

Response Body

Successful Response

application/json
  1. response

One mounted route.

artifact_code*Artifact Code

The live content host's label: <code>.<content domain>.

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

Who mounted it. Null only when that account has since been deleted: the route stays mounted and loses its attribution, because unmounting an org's home page over a departed admin would be worse.

id*Id
Formatuuid
path*Path

The canonical mount prefix, always ending in /.

site_id*Site Id
Formatuuid
updated_at*Updated At
Formatdate-time
updated_by?|

Who last moved it. Null if it has never moved, or if that account has since been deleted. This is the field the database authorises on a move, not created_by: checking the role of whoever mounted a route rather than whoever is changing it let a plain member repoint an admin's route.

Example Request
curl -X POST 'https://app.pl4m.com/api/v1/sites/routes/497f6eca-6276-4993-bfeb-53cbbbba6f08/move' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{  "path": "string"}'
Example Response
{  "artifact_code": "stringstri",  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "artifact_title": "string",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "path": "string",  "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",  "updated_at": "2019-08-24T14:15:22Z",  "updated_by": "deea00dc-b6b6-4412-a483-26ac61e1f6fe"}