---
title: "Get Access Token From Auth Code"
method: POST
path: "/authCode"
tags: ["Authentication/Access Token (Oauth - Username/Password)"]
---

# Get Access Token From Auth Code

`POST /authCode`

## Request

- Base URL: `https://ns-api.com/ns-api/v2`
- URL: `https://ns-api.com/ns-api/v2/authCode`
- Auth: none required

## Headers

- `Authorization` string

## Request body

- AuthRequest
  - `grant_type` 'password' | 'refresh_token' | 'mfa', required: This is the type of authentication request being made. 'password' is most common if using username and password from end user to grant access.
  - `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.

## Response `200`

- AccessToken
  - `username` string, required
  - `user` string, required
  - `territory` string, required
  - `domain` string, required
  - `site` string
  - `group` string
  - `department` string, required
  - `uid` string, required
  - `login` string, required
  - `scope` string, required
  - `user_email` string, required
  - `displayName` string, required
  - `access_token` string, required
  - `expires_in` integer, required
  - `token_type` string, required
  - `refresh_token` string, required
  - `client_id` string, required
  - `apiversion` string, required

## Other responses

- `400`
- `403`

## Changes

- **2026-11-03** `bce16087d479`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ns-api/apis/netsapiens-api-v2/changes/authCode/post.md)

---

[API](https://skmtc.dev/ns-api/apis/netsapiens-api-v2.md) - [All operations](https://skmtc.dev/ns-api/apis/netsapiens-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/ns-api/apis/netsapiens-api-v2/revisions/bce16087d479?raw)
