Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Barış Can Durak <[email protected]>
  • Loading branch information
stefannica and bcdurak authored Feb 7, 2025
1 parent 2f6f889 commit 2813725
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/book/getting-started/zenml-pro/pro-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ by being logged into ZenML Pro at [https://cloud.zenml.io](https://cloud.zenml.i

### Programmatic access with API tokens

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 a maximum of 1 hour. You can use the generated API tokens for programmatic access to the ZenML Pro REST API. This is the quickest way to access the ZenML Pro API programmatically.
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.

To generate a new API token for the ZenML Pro API:

1. Navigate to the OrganizationSettings page in your ZenML Pro dashboard
1. Navigate to the organization settings page in your ZenML Pro dashboard
2. Select "API Tokens" from the left sidebar

![API Tokens](../../.gitbook/assets/zenml-pro-api-token-01.png)
Expand Down Expand Up @@ -65,7 +65,7 @@ To generate a new API token for the ZenML Pro API:

### Tenant programmatic access

Programmatic access to the ZenML Pro tenant API is done essentially the same as for the ZenML OSS server API. You can use one of two methods:
Programmatic access to the ZenML Pro tenant API is achieved essentially the same way as the ZenML OSS server API. You can use one of these two methods:

* [Generate and use temporary API tokens](../../reference/api-reference.md#using-a-short-lived-api-token)
* [Create a service account and use its API key](../../reference/api-reference.md#using-a-service-account-and-an-api-key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ zenml login https://...

This command will start a series of steps to validate the device from where you are connecting that will happen in your browser. You can choose whether to mark your respective device as trusted or not. If you choose not to click `Trust this device`, a 24-hour token will be issued for authentication services. Choosing to trust the device will issue a 30-day token instead.

{% hint style="info" %}
{% hint style="warning" %}
When you are connecting to a ZenML Pro tenant, managing your authorized devices as described above is not yet supported. This feature is coming soon.
{% endhint %}

Expand Down
6 changes: 3 additions & 3 deletions docs/book/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ In the local case (i.e. using `zenml login --local`, the docs are available on `

## Using a bearer token to access the API programmatically

If you are using the ZenML server API using the above pages, it is enough to be logged in to your ZenML account in the same browser session. However, in order to do this programmatically, you can use one of the methods documented in the following sections.
If you are using the ZenML server API using the methods displayed above, it is enough to be logged in to your ZenML account in the same browser session. However, in order to do this programmatically, you can use one of the methods documented in the following sections.

### Using a short-lived API token

Expand All @@ -43,7 +43,7 @@ You can generate a short-lived (1 hour) API token from your ZenML dashboard. Thi
{% hint style="info" %}
**Important Notes**

- API tokens expire after 1 hour and cannot be retrieved after initial generation
- API tokens expire after 1 hour and cannot be retrieved after the initial generation
- Tokens are scoped to your user account and inherit your permissions
- For long-term programmatic access, it is recommended to [set up a service account and an API key](#using-a-service-account-and-an-api-key) instead
{% endhint %}
Expand Down Expand Up @@ -134,7 +134,7 @@ This will return a response like this:
{% hint style="info" %}
**Important notes**

* API tokens are scoped to the service account that created them and inherit its permissions
* API tokens are scoped to the service account that created them and inherit their permissions
* Tokens are temporary and will expire after a configured duration (typically 1 hour, but it depends on how the server is configured)
* You can request a new token at any time using the same API key
* For security reasons, you should handle API tokens carefully and never share them
Expand Down

0 comments on commit 2813725

Please sign in to comment.