---
title: "Apply Contract"
method: POST
path: "/api/v1/contracts/{asset_public_id}/apply"
tags: ["contracts"]
---

# Apply Contract

`POST /api/v1/contracts/{asset_public_id}/apply`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/contracts/{asset_public_id}/apply`
- Auth: none declared

Apply an ODCS YAML to an asset's live config.

Request body is raw YAML. Validation failures short-circuit before
any DB touch; on success, the orchestrator opens a single
transaction spanning every selected domain's import step.

## Path parameters

- `asset_public_id` string, uuid, required

## Query parameters

- `prune` boolean: When true, existing state missing from the incoming YAML is deleted. Default false keeps the apply warn-only.
- `include` string, nullable: Comma-separated domains to apply (others skipped).
- `exclude` string, nullable: Comma-separated domains to skip.

## Headers

- `Authorization` string

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
