Add or override an entry in an org-owned pack
const url = 'https://api.pkgplease.com/api/v1/policy/example/packs/example/entries';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"package_name":"example","version_range":"example","reason":"example","override_of_pack_id":"example","expires_at":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pkgplease.com/api/v1/policy/example/packs/example/entries \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "package_name": "example", "version_range": "example", "reason": "example", "override_of_pack_id": "example", "expires_at": "example" }'The only writer of an org-authored pack's entries — replaces the removed blocklist/allowlist endpoints. Goes through a guarded write path: rejects a pack the caller's org does not own (403), rejects an overlapping range for the same package (409), and — when override_of_pack_id is set — validates the ceremony the overridden pack's block class demands (400 if it fails; a security override requires a permitting role, a written reason, and an expiry). Every write emits a ledger-grade audit event (pack, entry, range, reason, and for an override the overridden pack id and expiry).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”One of the org's configured registry types (npm is the one in active use).
Request Bodyrequired
Section titled “Request Bodyrequired”object
A semver range. Omitted or null means all versions.
Set when this entry is authored to override a specific block pack.
Required when overriding a block:security pack.
Examplegenerated
{ "package_name": "example", "version_range": "example", "reason": "example", "override_of_pack_id": "example", "expires_at": "example"}Responses
Section titled “Responses”Entry created
object
Examplegenerated
{}Missing package_name
object
Examplegenerated
{ "error": "example"}The resolved pack is not owned by the caller's org
object
Examplegenerated
{ "error": "example"}No pack matches the slug
object
Examplegenerated
{ "error": "example"}The range overlaps an existing entry for the same package
object
Examplegenerated
{ "error": "example"}