Use the container-tools API
Interact with Podman programmatically by using its REST-based API. This API supports both Libpod and Docker-compatible endpoints, allowing integration with external tools and clients.
Podman 2.0’s new REST-based API, replacing the old varlink remote API, provides both rootful and rootless support. It includes the Libpod API for Podman and a Docker-compatible API to call Podman from platforms such as cURL, Postman, Google’s Advanced REST client, and others.
Because the Podman service relies on socket activation, it cannot run unless connections are active. You must manually start the podman.socket service to enable this feature. When a connection is established, the Podman service starts, runs the requested API action, then ends and returns to an inactive state.