Getting Started with the OpenShift REST API
The OpenShift REST API is the nerve center of the platform. Every object, every pod, every deployment flows through it. If you want control, you speak its language.
OpenShift exposes its REST API over HTTPS. It follows Kubernetes conventions but adds its own extensions. Resources are organized by API groups and versions. You interact by sending HTTP requests: GET to list, POST to create, PUT or PATCH to update, DELETE to remove. Authentication runs through OAuth tokens, and RBAC decides what’s allowed.
The /api endpoint holds core Kubernetes resources. /oapi contains the older OpenShift-specific ones, though newer features often live under /apis/<group>/<version>. Each resource has a defined schema in JSON. The API paths map to namespaces, letting you target specific projects or clusters. Responses are clean JSON payloads, ready for parsing or direct consumption.
Paging and watch queries are built in. Use limit and continue to page through large data sets. Append ?watch=true to stream changes in real time. This is essential when building controllers or tools that react fast to events in OpenShift.
Error codes follow HTTP standards. 200 means success. 401 means authentication failed. 403 means permission denied. 404 means the resource isn’t there. The API won’t lie to you—if something fails, you know why.
Versioning is explicit. When APIs change, the stable version stays for a while, giving you room to migrate. Always check /version and the OpenShift release notes before relying on a feature in production.
To work efficiently with the OpenShift REST API, use a solid HTTP client or a wrapper library. Curl works for quick tests. For larger projects, Go, Python, or Java clients can handle authentication flows and JSON marshalling automatically. Tight, reusable code saves time and avoids errors.
The REST API is more than a control plane—it is the sum of OpenShift’s capabilities, exposed in a predictable, scriptable form. If you need automation, integration, or visibility beyond the web console, this is your gateway.
Start using the OpenShift REST API in a real workflow. See it live with a working example in minutes at hoop.dev.