---
title: "Retrieves an access token."
method: POST
path: "/auth"
tags: ["Authorization"]
---

# Retrieves an access token.

`POST /auth`

This route returns an access `token` which is to be used for all subsequent requests in the Authorization header.

## Request body

- AuthRequestBody
  - `username` string, required
  - `password` string, required

## Response `200`

Status Code 200:  Successful Response - the request was successful!

- AuthResponse
  - `success` boolean
  - `token` string

## Other responses

- `400` — Status Code 400: Bad Request Response - the request header and/or body is invalid
- `500` — StatusCode 500: Internal Server Error Response - there's a problem with the Public API service

---

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