---
title: "Create JWT token after MFA request"
method: POST
path: "/jwt#2"
tags: ["Authentication/JWT (JSON Web Token)"]
---

# Create JWT token after MFA request

`POST /jwt#2`

This API will accept username and password along with a passcode generated via a authenticator application and generate a JWT token. Please recall that on the endpoint notation here in the docs, the "#2" after "/jwt" should be removed and is only there to facilitate naming.

## Request body

- AuthRequestMFA
  - `grant_type` 'mfa' | 'password' | 'refresh_token', required — This is the type of authentication request being made. 'mfa' would be needed in the second request with MFA passcode.
  - `client_id` string, required — This is the client_id provided to the developer for accessing the api. Will match with the client_secret
  - `client_secret` string, required — This is the client_secret provided to the developer for accessing the api. Will match with the client_id
  - `username` string, required — This is the username and logic for the user. This may look like a uid (user@domain) or could be something else if setup diffferent including a email address potentially.
  - `password` string, password, required — This is the password for the user requesting access.
  - `mfa_type` string, required — This value will be provided in response to a auth request if MFA is needed. Move value from that token to this request. Likely will be 'authenticator'
  - `mfa_vendor` string, required — This value will be provided in response to a auth request if MFA is needed. Move value from that token to this request. Likely will be 'google'
  - `ns_id_type` 'subscriber' | 'level1', required — Will likely be subscriber as the value here to defierentiate between authenticator for api/portal and mfa with admin ui
  - `passcode` string, required — This will be the 6 digit numberic passcode provided by a
  - `access_token` string, required — This will be the access_token or jwt that was given with the scope of mfa_required

## Response `200`

- JwtRequestSuccess
  - `token` string, jwt, required — This is the JWT token that would need to be saved for use in addtional requests.
  - `refresh` string, jwt, required — This is a JWT but only capable of being used to regenerate a new JWT token and not for authenticated requests.

## Other responses

- `400`
- `401`
- `403`
- `404`
- `x-400-2`

---

[API](https://skmtc.net/ns-api/apis/netsapiens-api-v2.md) · [All operations](https://skmtc.net/ns-api/apis/netsapiens-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ns-api/netsapiens-api-v2/revisions/d37f65b5b886/schema)
