---
title: "Login with API Key"
method: GET
path: "/api/v1/auth/login"
tags: ["Api Authentication"]
---

# Login with API Key

`GET /api/v1/auth/login`

## Access Login

Using a [StackHawk API Key](https://app.stackhawk.com/settings/apikeys), this endpoint returns an *access token* which can then be used in the `authorization` header of subsequent API requests.
The access token returned is an [RFC-7519](https://datatracker.ietf.org/doc/html/rfc7519) compliant [jwt access token](https://jwt.io/).

Access tokens have an expiration of *30 minutes* and are issued on behalf of the requesting user.

An access token can only be used to interact with StackHawk resources that belong to the user, or to organizations that user is a part of and permissioned for.

For best practices, use the `/login` route only when starting a new access session to the StackHawk API, and use the `/refresh` route to request a fresh token to extend an API session.

## Headers

- `X-ApiKey` string, required

## Response `200`

* A [JSON Web Token](https://jwt.io/) used to authenticate requests to the StackHawk API

- UserJWT — * A [JSON Web Token](https://jwt.io/) used to authenticate requests to the StackHawk API
  - `token` string — the bearer token value

---

[API](https://skmtc.net/stackhawk/apis/stackhawk-public-api.md) · [All operations](https://skmtc.net/stackhawk/apis/stackhawk-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/stackhawk/stackhawk-public-api/versions/ad3dfd54cb63/schema)
