Skip to main content
POST
Attach a policy to every selected, eligible project

Authorizations

Authorization
string
header
required

An Earnie API key, sent as Authorization: Bearer sk_earnie_.... Create one under Settings > API keys. The key's scopes decide which operations it may call.

Body

application/json

Shared request body for all four fan-out verbs. project_ids is the caller's explicit selection (checkbox ticks) — never a query or a filter scope, so eligibility is a per-item outcome (skipped), not a reason to reject the request.

project_ids
string<uuid>[]
required

The explicitly selected projects, in no particular order.

Minimum array length: 1
policy_id
integer<int64> | null

The policy to attach. Required by :apply-policy; ignored by the other three verbs.

include
enum<string>[]

The sections each snapshot holds: oss (SBOM), crypto (CBOM), ai (AIBOM), all three (xBOM). Read by :generate-sbom only and ignored by the other verbs. Omitted, each snapshot holds the default sections. A section the organization has not enabled or the caller does not see is refused (module_disabled, module_scope_forbidden); an unknown or repeated one is invalid_include.

Minimum array length: 1
Available options:
oss,
crypto,
ai

Response

Every selected project's outcome, including any skipped/failed.

Terminal result of a synchronous fan-out (request-scan, apply-policy). Always 200, even when every item failed — 4xx/5xx is reserved for the request itself being malformed or unauthorized, never for a per-project outcome.

items
object[]
required