---
title: "JWT Login"
method: POST
path: "/api/auth/login"
tags: ["Auth"]
---

# JWT Login

`POST /api/auth/login`

CarAPI uses JSON Web Tokens (JWT) to authenticate requests. You can generate a JWT using your API Token and
API Secret in SwaggerUI (this page) with the following steps:

- Click the "Try Out" button
- Enter API Token and API Secret in the JSON payload.
- Click Execute
- A JWT will be returned if the credentials are correct
- Next click the "Authorize" button at the top-right of Swagger UI (this page) and paste in the JWT.

Your JWT will now be sent with any request you make in Swagger until you refresh the page.

In your application code, Postman or cURL, you will need to pass the token in the HTTP Header as:

```
Authorization: Bearer {TOKEN_VALUE_HERE}
```

You should cache your JWT to avoid having to authenticate on each request. You must check the token's
expiration value to determine when you need to generate a new token. Please refer to
[https://jwt.io/](https://jwt.io/) to learn more about JSON Web Tokens.

Your email address and password cannot be used to generate a JWT. You must use your API token and secret.

If you don't yet have API credentials you must first [register](/register) and then generate a secret.
Users without a subscription will have limited data access.

For additional documentation please review [https://carapi.app/docs](https://carapi.app/docs).

## Request body

- object
  - `api_token` string, required
  - `api_secret` string, required

## Response `200`

## Other responses

- `400` — BadRequestException
- `401` — Authentication Failed
- `405` — MethodNotAllowedException
- `429` — TooManyRequestsException - Max Per Minute: 20
- `500` — ServiceUnavailableException
- `503` — ServiceUnavailableException

---

[API](https://skmtc.net/carapi/apis/car-api-documentation.md) · [All operations](https://skmtc.net/carapi/apis/car-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/carapi/car-api-documentation/revisions/5331e15a22af/schema)
