---
title: "Api Token"
method: GET
path: "/api/v1/api_token"
tags: ["auth"]
---

# Api Token

`GET /api/v1/api_token`

Get a workload API token for the current user.

Args:
    pipeline_id: The ID of the pipeline to get the API token for.
    schedule_id: The ID of the schedule to get the API token for.
    expires_minutes: The number of minutes for which the API token should
        be valid. If not provided, the API token will be valid indefinitely.
    auth_context: The authentication context.

Returns:
    The API token.

Raises:
    HTTPException: If the user is not authenticated.
    AuthorizationException: If trying to scope the API token to a different
        pipeline/schedule than the token used to authorize this request.

## Query parameters

- `pipeline_id` string, uuid, nullable
- `schedule_id` string, uuid, nullable
- `expires_minutes` integer, nullable

## Response `200`

Successful Response

- string

## Other responses

- `401` — Unauthorized
- `422` — Validation Error

---

[API](https://skmtc.net/zenml-io/apis/zenml-2.md) · [All operations](https://skmtc.net/zenml-io/apis/zenml-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/zenml-io/zenml-2/versions/febb01b8bce3/schema)
