Preview the policy decision for a package/version
POST
/api/v1/policy/{registry_type}/check
const url = 'https://api.pkgplease.com/api/v1/policy/example/check';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"package_name":"example","version":"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/check \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "package_name": "example", "version": "example" }'Backs the MCP check_package tool. Runs the same evaluatePolicy logic the registry proxy uses, read-only, scoped to the caller's org.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”registry_type
required
string
One of the org's configured registry types (npm is the one in active use).
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
package_name
required
string
version
required
string
Examplegenerated
{ "package_name": "example", "version": "example"}Responses
Section titled “Responses”Either an unscored placeholder (enqueues scoring) or a full decision
Media typeapplication/json
One of:
object
decision
string
reason
string
jobId
string
object
decision
string
reason
string
askable
boolean
trust
number
threat
number
signals
Array<object>
One scoring-rule contribution to a package's trust or threat score.
object
axis
string
points
number
possible
number
reason
string
abstained
boolean
newer_version_available
string
note
string
Example
{ "decision": "unknown"}Missing package_name or version
Media typeapplication/json
object
error
required
string
Examplegenerated
{ "error": "example"}