---
title: "Create an inventory sync job"
method: POST
path: "/v1/inventory-sync-job"
tags: ["Inventory"]
---

# Create an inventory sync job

`POST /v1/inventory-sync-job`

## Request

- Base URL: `https://help.puppet.com/api/public`
- URL: `https://help.puppet.com/api/public/v1/inventory-sync-job`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/puppet/apis/puppet-comply-api/docs/v1/inventory-sync-job/post.ts> (a function with typed inputs; its response is checked against the schema)

Create an inventory sync job. If there is not an inventory sync job currently running, a new job will be created and
start running immediately. If there is an inventory sync job currently running, a new job will not be created.

To use this endpoint, you must have one of the following roles:
`comply-admin`
`comply-operator`

## Response `201`

CreateInventoryJobResponse represents the response to a create inventory sync job request.

- object
  - `created_at` string, date-time, required: The time at which the inventory sync job was created.
  - `finished_at` string, date-time, nullable: The time at which the inventory sync job finished.
  - `id` integer, required: The ID of the inventory sync job.
  - `nodes_deleted` integer, required: The number of nodes deleted as part of the inventory sync job.
  - `nodes_synced` integer, required: The number of nodes synced as part of the inventory sync job.
  - `reason` string, required: The reason for failure of inventory sync job, if any.
  - `status` 'started' | 'successful' | 'failed' | 'aborted', required: The status of the inventory sync job.
  - `total_nodes` integer, required: The total number of nodes in the inventory.

## Other responses

- `429`: TooManyInventoryRequestsResponse is returned when inventory sync is already in progress
- `default`: ErrorResponse is the default error response.

---

[API](https://skmtc.dev/puppet/apis/puppet-comply-api.md) - [All operations](https://skmtc.dev/puppet/apis/puppet-comply-api/llms.txt) - [OpenAPI document](https://skmtc.dev/puppet/apis/puppet-comply-api/revisions/0a7ac90117d7?raw)
