---
title: "Login as the specified user using the specified API key."
method: POST
path: "/api/Auth/loginKey"
tags: ["Auth"]
---

# Login as the specified user using the specified API key.

`POST /api/Auth/loginKey`

## Request body

- LoginApiKeyRequest
  - `userName` string, required
  - `apiKey` string, required

## Response `200`

OK

- LoginResponse
  - `success` boolean, required
  - `errorCode` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10, required — 0 = Success 1 = UserNotFound 2 = PasswordVerificationFailed 3 = InvalidCredentials 4 = AppNotFound 5 = AppVerificationFailed 6 = InvalidDevice 7 = AgreementsNotSigned 8 = UnknownError 9 = ApiSubscriptionNotFound 10 = ApiKeyAuthenticationDisabled
  - `errorMessage` string
  - `token` string

---

[API](https://skmtc.dev/topstepx/apis/projectx-gateway-api.md) · [All operations](https://skmtc.dev/topstepx/apis/projectx-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/topstepx/projectx-gateway-api/revisions/688252f4f704/schema)
