---
title: "Obtain JWT Authentication token for user."
method: POST
path: "/_open/auth"
tags: ["Authentication"]
---

# Obtain JWT Authentication token for user.

`POST /_open/auth`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_open/auth/post.ts> (a function with typed inputs; its response is checked against the schema)

Obtain a JWT Authentication for a user.

After obtaining the token, REST API calls may be invoked by passing the obtained token in the REST header. Either email or both tenant and username are required. Add the following to your header when you make REST calls: *"Authorization: bearer TOKEN"*

## Request body

- AuthToken
  - `email` string: The email of the user for whom we want the auth token.
  - `password` string, required: The user password.
  - `tenant` string: The name of the tenant for whose user we want the auth token.
  - `username` string: The id of the user for whom we want the auth token.

## Response `200`

Successfully created token.

- AuthenticationExamplesRc200
  - `jwt` string: JWT authentication token.
  - `tenant` string: Name of the tenant.
  - `username` string: Username of the tenant.

## Other responses

- `401`: Failed because you do not have administrator permissions.
- `429`: Requests count from this IP exceeds the rate limit.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
