Okteto API
The Okteto API gives you programmatic access to the resources that Okteto manages, such as Namespaces, applications, and users. It's defined with OpenAPI. Combine it with the Okteto CLI or other tools to automate workflows, such as deleting unused development volumes in a Namespace or redeploying applications.
The Okteto API is in beta:
- Endpoints, request and response formats, and authentication mechanisms can change as we refine the API.
- Backward-incompatible changes can happen before the API reaches general availability (GA).
Send feedback or report issues to support@okteto.com.
API Reference
The Swagger documentation of the Okteto API lists every endpoint with its request parameters, request format, response structure, and errors. You can also send requests from it to see example responses. To open it:
- Go to Admin > Integrations > Admin Access Tokens in the Admin Dashboard.
- Click the public API reference link.
Authentication
Every request to the Okteto API needs a bearer token in its Authorization header. Admin Access Tokens and Personal Access Tokens authenticate requests. The Namespaces, Applications, and Users endpoints require Admin permissions, so call them with an Admin Access Token or with an Admin's Personal Access Token.
Endpoints
The Okteto API has operations for:
- Namespaces: list the Namespaces in your instance, including the Namespaces of Preview Environments.
- Applications: list the applications deployed in a Namespace.
- Users: list and delete the users of your Okteto instance.
The API reference has the request parameters, response structures, and error handling for each one.
Automation Examples
These examples combine the Okteto API with the Okteto CLI:
- Report the status of Namespaces and applications
- Redeploy applications to keep them up to date
- Sleep Namespaces with your own rules
The okteto-api topic on GitHub lists every example.