Skip to Content
API reference

Shares

Give a named person or an org access to one artifact.

GET
/v1/artifacts/{artifact_id}/shares

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 shares, pending invites included.

Invites are listed on purpose: an owner has to be able to see that an address was offered access and has not taken it, which is the only visible difference between "shared" and "offered".

artifact_id*Artifact Id
Formatuuid
page*

Cursor pagination envelope metadata.

shares*array<>
Example Request
curl -X GET 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/shares' \  -H 'Authorization: Bearer '
Example Response
{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "page": {    "limit": 1,    "next_cursor": "string"  },  "shares": [    {      "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",      "claimed_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",      "expires_at": "2019-08-24T14:15:22Z",      "grantee_email": "string",      "grantee_owner_id": "0cd79b93-54b9-4172-ab55-f3665e28eb8b",      "grantee_user_email": "string",      "grantee_user_id": "391d8157-10cc-4b34-9fdd-904b6fd0a51c",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "pending": true,      "permission": "string"    }  ]}

Share an artifact

POST
/v1/artifacts/{artifact_id}/shares

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

Grant read access to exactly one target. By email is the usual call: an address that already belongs to a confirmed account is resolved to that person and shared directly, while an unknown or unconfirmed one becomes a pending invite. That is not an error, and it grants nothing until it is claimed on a first sign-in with that address verified.

owner_id is accepted but is only an assertion — an artifact already determines its own owner, so there is nothing for this field to select. It is here so an agent that passes it everywhere is not told it is unexpected. A value that disagrees with the artifact's owner is FORBIDDEN.

grantee_email?|

Share with an address. Resolved to a user if it already has a confirmed account; otherwise a pending invite that expires (30 days by default), is revocable, and grants NOTHING until claimed.

grantee_owner_id?|

Share with an owner: every member of it can read, whatever their role. Membership is checked live, so someone joining later gains access and someone leaving loses it.

grantee_user_id?|null
owner_id?|

Optional assertion that the artifact belongs to this owner. The artifact already determines its owner, so this only ever confirms it; a mismatch returns FORBIDDEN. 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.

Response Body

Successful Response

application/json
  1. response

A share. All three target fields are optional and exactly one is set. A share that began as an email invite and was claimed has grantee_user_id set, grantee_email null and claimed_at stamped.

artifact_id*Artifact Id
Formatuuid
claimed_at?|

When an email invite became this user share.

created_at*Created At
Formatdate-time
created_by?|null
expires_at?|

Always set on an email invite — the database requires it, because an invite that waits forever for a sign-up is an unbounded pending grant. It survives claiming, so the grant an invite produced is bounded too.

grantee_email?|

Set only while this is a PENDING invite. It grants nothing yet.

grantee_owner_id?|

Every member of this owner can read.

grantee_user_email?|

Display only: the address of the account named by grantee_user_id.

grantee_user_id?|null
id*Id
Formatuuid
pending*Pending

True while this is an unclaimed email invite, which grants no access.

permission*Permission

Phase 1 shares are view-only.

Example Request
curl -X POST 'https://app.pl4m.com/api/v1/artifacts/497f6eca-6276-4993-bfeb-53cbbbba6f08/shares' \  -H 'Authorization: Bearer ' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "artifact_id": "b7bd6bbb-c7f1-4314-8742-2aeeeece9d12",  "claimed_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",  "expires_at": "2019-08-24T14:15:22Z",  "grantee_email": "string",  "grantee_owner_id": "0cd79b93-54b9-4172-ab55-f3665e28eb8b",  "grantee_user_email": "string",  "grantee_user_id": "391d8157-10cc-4b34-9fdd-904b6fd0a51c",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "pending": true,  "permission": "string"}

Unshare

DELETE
/v1/artifacts/{artifact_id}/shares/{share_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
share_id*Share 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/shares/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}