---
title: "Sync Inventory Cluster Playbooks"
method: POST
path: "/api/admin/inventory/{cluster_id}/playbooks-sync"
tags: ["admin-inventory"]
---

# Sync Inventory Cluster Playbooks

`POST /api/admin/inventory/{cluster_id}/playbooks-sync`

Render the cluster's inventory.ini and open (or update) its PR on
infra-playbooks.

Side-effecting rather than a write of inventory data, so it is gated on
``inventory:execute`` scoped to the cluster — the same verb as certificate
signing. ``?dryRun=true`` returns the rendered diff and touches nothing;
it overrides the body flag.

## Path parameters

- `cluster_id` string, required

## Query parameters

- `dryRun` boolean

## Request body

- PlaybooksSyncRequest — Render this cluster's inventory.ini and open/update its infra-playbooks PR.
  - `dryRun` boolean
  - `resetBranch` boolean

## Response `200`

Successful Response

- GenericResponsePlaybooksSyncResult
  - `data` PlaybooksSyncResult
    - `operationId` string, required
    - `targetId` string, nullable
    - `targetName` string, nullable
    - `message` string, required
    - `created` integer, nullable
    - `updated` integer, nullable
    - `assigned` integer, nullable
    - `detached` integer, nullable
    - `retired` integer, nullable
    - `dryRun` boolean, required
    - `changed` boolean, required
    - `repoConfigured` boolean
    - `repo` string, required
    - `path` string, required
    - `branch` string, required
    - `baseBranch` string, required
    - `summary` string[]
    - `warnings` string[]
    - `diff` string, nullable
    - `content` string, nullable
    - `commitSha` string, nullable
    - `prNumber` integer, nullable
    - `prUrl` string, nullable
    - `prAction` string, nullable
  - `status` string, nullable — Response status

## Other responses

- `401` — Authorization failed
- `403` — Insufficient permissions
- `422` — Invalid request data

## Changes

- **2026-08-25** `bde6f9b78655` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/primeintellect/apis/pi-api/changes/api/admin/inventory/:cluster_id/playbooks-sync/post.md)

---

[API](https://skmtc.dev/primeintellect/apis/pi-api.md) · [All operations](https://skmtc.dev/primeintellect/apis/pi-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primeintellect/pi-api/revisions/08d946cba60c/schema)
