Skip to Content
API reference

Link tokens

Unlisted links to one artifact, shown once and revocable.

GET
/v1/artifacts/{artifact_id}/link-tokens

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
include_inactive?Include Inactive
Defaulttrue

Header Parameters

authorization?string|null

Response Body

Successful Response

application/json
  1. response

A page of an artifact's link tokens, including revoked ones.

artifact_id*Artifact Id
Formatuuid
link_tokens*array<>
page*

Cursor pagination envelope metadata.

Example Request
curl -X GET 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/link-tokens' \  -H 'Authorization: Bearer '
Example Response
{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "link_tokens": [    {      "active": true,      "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "expires_at": "2019-08-24T14:15:22Z",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "label": "string",      "revoked_at": "2019-08-24T14:15:22Z"    }  ],  "page": {    "limit": 1,    "next_cursor": "string"  }}
POST
/v1/artifacts/{artifact_id}/link-tokens

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

Mint a share link for an artifact.

expires_at?|

Absent means it lasts until revoked.

label?|

For the owner's own bookkeeping.

path?|

Where inside the artifact a recipient lands — /about, say, so you can share the About page rather than /. Validated like a viewer token's path.

Response Body

Successful Response

application/json
  1. response

Creation response — the only time the plaintext token is returned.

link_token*

A share link, without the link itself. It is returned once, when it is created.

ok?Ok
Defaulttrue
token*Token

Shown once. Only its sha256 hash is stored; pl4m cannot show it again.

Length32 <= length
url*Url

The shareable link, with the token in the URL fragment (/l/<slug>#<token>) so it is never sent to a server and so never reaches an access log or a Referer header. The slug is cosmetic — derived from the title so a recipient can see what they are about to open. The credential is the fragment.

Example Request
curl -X POST 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/link-tokens' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "link_token": {    "active": true,    "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",    "created_at": "2019-08-24T14:15:22Z",    "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",    "expires_at": "2019-08-24T14:15:22Z",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "label": "string",    "revoked_at": "2019-08-24T14:15:22Z"  },  "ok": true,  "token": "stringstringstringstringstringst",  "url": "string"}
DELETE
/v1/artifacts/{artifact_id}/link-tokens/{link_token_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/link-tokens/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}