Sites
Your personal or org site: what is mounted where, the index, and 301s a move left behind.
bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
owner_id?|nullSuccessful Response
application/json- response
A site as the API returns it.
audience*SiteAudienceWho 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.
"public""org_members"created_at*Created Atdate-timedefault_description?string|nulldefault_title?string|nullhandle?|The owner's handle, which is the site's host label. Null means the site has no host yet and resolves to nothing.
id*Iduuidindex*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 Iduuidtoolbar_enabled?Toolbar EnabledWhether the pl4m button may appear anywhere on this site. Composed with each artifact's own switch; off on either hides it.
trueupdated_at*Updated Atdate-timeurl?|The site's canonical URL, https://<handle>.pl4m.site/. Null until a handle is claimed.
curl -X GET 'https://app.pl4m.com/api/v1/sites' \ -H 'Authorization: Bearer '{ "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"}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
application/json- 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?|nulldefault_title?|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.
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.
Successful Response
application/json- response
A site as the API returns it.
audience*SiteAudienceWho 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.
"public""org_members"created_at*Created Atdate-timedefault_description?string|nulldefault_title?string|nullhandle?|The owner's handle, which is the site's host label. Null means the site has no host yet and resolves to nothing.
id*Iduuidindex*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 Iduuidtoolbar_enabled?Toolbar EnabledWhether the pl4m button may appear anywhere on this site. Composed with each artifact's own switch; off on either hides it.
trueupdated_at*Updated Atdate-timeurl?|The site's canonical URL, https://<handle>.pl4m.site/. Null until a handle is claimed.
curl -X PATCH 'https://app.pl4m.com/api/v1/sites' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{}'{ "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"}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
application/json- 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?EnabledA built-in index answers at / by default. The owner can switch it off.
trueowner_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?PathWhere 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.
1 <= length <= 512"/"Successful Response
application/json- response
A site as the API returns it.
audience*SiteAudienceWho 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.
"public""org_members"created_at*Created Atdate-timedefault_description?string|nulldefault_title?string|nullhandle?|The owner's handle, which is the site's host label. Null means the site has no host yet and resolves to nothing.
id*Iduuidindex*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 Iduuidtoolbar_enabled?Toolbar EnabledWhether the pl4m button may appear anywhere on this site. Composed with each artifact's own switch; off on either hides it.
trueupdated_at*Updated Atdate-timeurl?|The site's canonical URL, https://<handle>.pl4m.site/. Null until a handle is claimed.
curl -X PUT 'https://app.pl4m.com/api/v1/sites/index' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{}'{ "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"}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
redirect_id*Redirect Iduuidowner_id?|nullSuccessful Response
application/json- response
A delete / revoke that succeeded.
deleted_at*Deleted Atdate-timeid*Iduuidok?Oktruecurl -X DELETE 'https://app.pl4m.com/api/v1/sites/redirects/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Authorization: Bearer '{ "deleted_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "ok": true}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
owner_id?|nullSuccessful Response
application/json- 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.
curl -X GET 'https://app.pl4m.com/api/v1/sites/routes' \ -H 'Authorization: Bearer '{ "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" }}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
application/json- 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 Iduuidowner_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*PathA 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 /.
1 <= length <= 512Successful Response
application/json- response
One mounted route.
artifact_code*Artifact CodeThe live content host's label: <code>.<content domain>.
^[0-9a-hjkmnp-tv-z]{10,12}$10 <= length <= 12artifact_id*Artifact Iduuidartifact_title?string|nullcreated_at*Created Atdate-timecreated_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*Iduuidpath*PathThe canonical mount prefix, always ending in /.
site_id*Site Iduuidupdated_at*Updated Atdate-timeupdated_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.
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"}'{ "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"}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
route_id*Route Iduuidowner_id?|nullSuccessful Response
application/json- response
A delete / revoke that succeeded.
deleted_at*Deleted Atdate-timeid*Iduuidok?Oktruecurl -X DELETE 'https://app.pl4m.com/api/v1/sites/routes/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Authorization: Bearer '{ "deleted_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "ok": true}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
route_id*Route Iduuidapplication/json- body
Move a route, leaving a 301 behind.
leave_redirect?Leave RedirectWhether 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.
trueowner_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*PathA 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 /.
1 <= length <= 512Successful Response
application/json- response
One mounted route.
artifact_code*Artifact CodeThe live content host's label: <code>.<content domain>.
^[0-9a-hjkmnp-tv-z]{10,12}$10 <= length <= 12artifact_id*Artifact Iduuidartifact_title?string|nullcreated_at*Created Atdate-timecreated_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*Iduuidpath*PathThe canonical mount prefix, always ending in /.
site_id*Site Iduuidupdated_at*Updated Atdate-timeupdated_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.
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"}'{ "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"}