Skip to main content
PUT
Attach a policy directly to a 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.

Headers

If-Match
string
required

The policy revision the caller last read. Required: a policy mutation is never last-write-wins. Omitted → 428 precondition_required; no longer current → 409 policy_conflict.

The bare digest, its quoted form and its weak form all mean the same revision. * is refused with 409 rather than honoured as "any current representation", which would be exactly the unconditional write this exists to prevent. A comma-separated list of entity tags is refused with 400: a policy has one current revision, so offering several is not meaningful here, and saying so beats answering 409 for a request that was not understood.

Path Parameters

projectId
string<uuid>
required
policyId
integer<int64>
required

Response

Policy attached, or already attached