Introduction
In this article, we will learn about the puppet v4 API overview. We will see the different catalogs and schemas in JSON. We can implement several services with the Puppet server via API, and the ‘Puppet agent application’ uses these services to retrieve file data, resolve a node's credentials, and submit reports. We will see the complete Overview of Puppet v4 API.

POST /puppet/v4/catalog
Here we will discuss this for the puppet v4 API. The catalog for the input data to be compiled is submitted as a JSON body with the following form:
{
"certname": "<node name>",
"persistence": { "facts": <true/false>, "catalog": <true/false> },
"environment": "<environment name>",
# The rest are optional:
"facts": { "values": { "<fact name>": <fact value>, ... } },
"trusted_facts": { "values": { "<fact name>": <fact value>, ... } },
"transaction_uuid": "<uuid string>",
"job_id": "<id string>",
"options": { "prefer_requested_environment": <true/false>,
"capture_logs": <true/false>,
"log_level": <err/warning/info/debug> }
}
certname (required)
To compile the catalog, the name of the node is required.
persistence (required)
Persistence is vital to enterprise applications because of the required access to relational databases.
environment (required)
To compile the catalog, the name of the environment is required. If prefer_requested_environemnt is true, override the classified environment with this param. If it is false, only respect this if the classifier allows an agent-specified environment.
facts
A hash with a required values key, containing a hash of all the facts for the node. If not provided, Puppet will attempt to fetch facts for the node from PuppetDB.
trusted_facts
A hash with the key of a required value containing a hash of the trusted facts for a node. In a normal agent's catalog request, these would be extracted from the cert, but this endpoint does not require a cert for the node whose catalog is being compiled. If not provided, Puppet will attempt to fetch the trusted facts for the node from PuppetDB or from the provided facts hash.
transaction_uuid
In the puppet v4 API, This id is for tracking the catalog compilation and report submission.
job_id
This id is for the orchestrator job that triggered this run in the puppet v4 API.





