Skip to content

Preview the policy decision for a package/version

POST
/api/v1/policy/{registry_type}/check
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. Resolves the decision through the shared evaluator (evaluatePackage), the same code path the registry install uses, so a pre-flight check and the install it predicts cannot disagree. Read-only and scoped to the caller's org. On a block, searches for a remediation (a compliant version, or a cohort peer); when none exists, records an audit event and raises an org alert through the notification fan-out. The response is rendered by token type — a session (human) token gets the full render including override_eligibility and its ceremony flags; every other token type (agent, service, developer, provisioner) gets the agent-safe render, which never includes override_eligibility or any override vocabulary.

registry_type
required
string

One of the org's configured registry types (npm is the one in active use).

Media typeapplication/json
object
package_name
required
string
version
required
string
Examplegenerated
{
"package_name": "example",
"version": "example"
}

Either an unscored placeholder (enqueues scoring) or a full decision

Media typeapplication/json
One of:
object
decision
string
Allowed values: unknown
reason

"not yet scored" when scoring was enqueued (jobId is then present), otherwise why the package could not be evaluated at all — non-registry-spec, no-satisfying-version, package-not-found or upstream-unavailable.

string
jobId

Present only with reason "not yet scored".

string
Example
{
"decision": "unknown"
}

Missing package_name or version

Media typeapplication/json
object
error
required
string
Examplegenerated
{
"error": "example"
}