Getting Started
Last updated
Was this helpful?
Last updated
Was this helpful?
The ZenML Pro API extends the open-source API with additional features designed for enterprise users, including:
Enhanced team collaboration features
Advanced role-based access control
Enterprise-grade security features
Whether you're using the or a self-hosted ZenML Pro instance, you can leverage the API to manage workspaces, organizations, users, roles, and more.
ZenML Pro includes two distinct APIs:
Workspace API: This is similar to the but includes additional endpoints like Run Templates. Each workspace in ZenML Pro has its own API.
ZenML Pro API: This is the management API for ZenML Pro and handles organization-level resources like workspaces, users, and roles.
For OSS users: The server_url
is the root URL of your ZenML server deployment.
For Pro users: The server_url
for the Workspace API is the URL of your workspace, which can be found in the ZenML Pro dashboard:
Note: The workspace URL can be found in the ZenML Pro dashboard and typically looks like https://1bfe8d94-zenml.cloudinfra.zenml.io
.
The ZenML Pro API is a RESTful API that follows OpenAPI 3.1.0 specifications. It provides endpoints for various resources and operations, including:
Workspace management
Organization management
User management
Role-based access control (RBAC)
Authentication and authorization
To use the ZenML Pro API, you need to authenticate your requests. If you are logged in to your ZenML Pro account, you can use the same browser window to authenticate requests to your ZenML Pro API, directly in the OpenAPI docs.
To generate a new API token for the ZenML Pro API:
Navigate to the organization settings page in your ZenML Pro dashboard
Select "API Tokens" from the left sidebar
Click the "Create new token" button. Once generated, you'll see a dialog showing your new API token.
Simply use the API token as the bearer token in your HTTP requests. For example, you can use the following command to check your current user:
using curl:
using wget:
using python:
Programmatic access to the ZenML Pro workspace API is achieved essentially the same way as the ZenML OSS server API. This is because the Workspace API in ZenML Pro is an extension of the OSS API with some additional endpoints like Run Templates.
You can use one of these two methods to authenticate with your workspace API:
When making requests to the Workspace API, make sure to use your workspace URL as the base URL. This is different from the ZenML Pro API URL (cloudapi.zenml.io), which is used for organization-level operations.
Please consult the indicated sections for more information.
Here are some important endpoints you can use with ZenML Pro:
These endpoints are available at the ZenML Pro API (e.g., https://cloudapi.zenml.io):
List organizations: GET /organizations
Create an organization: POST /organizations
Get organization details: GET /organizations/{organization_id}
Update an organization: PATCH /organizations/{organization_id}
List workspaces: GET /workspaces
Create a workspace: POST /workspaces
Get workspace details: GET /workspaces/{workspace_id}
Update a workspace: PATCH /workspaces/{workspace_id}
List users: GET /users
Get current user: GET /users/me
Update user: PATCH /users/{user_id}
Create a role: POST /roles
Assign a role: POST /roles/{role_id}/assignments
Check permissions: GET /permissions
The Workspace API includes all OSS API endpoints plus some additional Pro-specific endpoints. These are available at your workspace URL at the /docs
path (e.g., https://1bfe8d94-zenml.cloudinfra.zenml.io/docs):
List run templates: GET /run_templates
Create a run template: POST /run_templates
Get run template details: GET /run_templates/{template_id}
Update a run template: PATCH /run_templates/{template_id}
The API uses standard HTTP status codes to indicate the success or failure of requests. In case of errors, the response body will contain more details about the error, including a message and sometimes additional information.
Be aware that the ZenML Pro API may have rate limiting in place to ensure fair usage. If you exceed the rate limit, you may receive a 429 (Too Many Requests) status code. Implement appropriate backoff and retry logic in your applications to handle this scenario.
The SaaS version of ZenML Pro API is hosted at .
For example, for the SaaS variant, you can access the docs here: . You can make requests by being logged into ZenML Pro at .
Similar to , API tokens provide a way to authenticate with the ZenML Pro API for temporary automation tasks. These tokens are scoped to your user account and are valid for 1 hour by default. You can use the generated API tokens for programmatic access to the ZenML Pro REST API.
Remember to refer to the complete API documentation available at for detailed information about all available endpoints, request/response schemas, and additional features.
For a complete list of API endpoints available in the Workspace API, refer to the .