API tokens
Personal API tokens: mint, list and revoke.
bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
owner_id?|nulllimit?Limit1 <= value <= 20050cursor?string|nullinclude_inactive?Include InactivetrueSuccessful Response
application/json- response
A page of the caller's tokens.
api_tokens*array<>page*Cursor pagination envelope metadata.
curl -X GET 'https://app.pl4m.com/api/v1/tokens' \ -H 'Authorization: Bearer '{ "api_tokens": [ { "active": true, "created_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "last_used_at": "2019-08-24T14:15:22Z", "name": "string", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "prefix": "string", "revoked_at": "2019-08-24T14:15:22Z", "scopes": [ "artifacts:read" ], "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ], "page": { "limit": 1, "next_cursor": "string" }}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
application/json- body
Mint a personal API token, scoped to one of the caller's owners.
A token is pinned to the owner it is minted for and can never act as another, so which owner is part of the credential rather than part of each call made with it.
expires_at?|nullname*Name1 <= length <= 100owner_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.
scopes*array<>1 <= itemsSuccessful Response
application/json- response
Creation response — the only time the secret is returned.
api_token*A personal API token, without the secret. The token itself is returned once, when it is created, and never again.
ok?Oktruetoken*TokenShown once. Only its sha256 hash is stored; pl4m cannot show it again.
32 <= lengthcurl -X POST 'https://app.pl4m.com/api/v1/tokens' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "scopes": [ "artifacts:read" ]}'{ "api_token": { "active": true, "created_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "last_used_at": "2019-08-24T14:15:22Z", "name": "string", "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", "prefix": "string", "revoked_at": "2019-08-24T14:15:22Z", "scopes": [ "artifacts:read" ], "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" }, "ok": true, "token": "stringstringstringstringstringst"}bearerAuthAuthorizationBearer <token>A personal API token (pl4m_pat_…). The owner is resolved from the credential, never claimed by the caller.
token_id*Token IduuidSuccessful Response
application/json- response
A delete / revoke that succeeded.
deleted_at*Deleted Atdate-timeid*Iduuidok?Oktruecurl -X DELETE 'https://app.pl4m.com/api/v1/tokens/497f6eca-6276-4993-bfeb-53cbbbba6f08' \ -H 'Authorization: Bearer '{ "deleted_at": "2019-08-24T14:15:22Z", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "ok": true}