---
title: "Issue token"
method: POST
path: "/v1/issue-token"
tags: ["Authentication"]
---

# Issue token

`POST /v1/issue-token`

## Request

- Base URL: `https://api.emma.ms/external`
- URL: `https://api.emma.ms/external/v1/issue-token`
- Auth: none declared

Returns an access token and a refresh token for this API. The bearer access token enables you to get access and send requests to the endpoints in this API.

To get the tokens, you need to send a Client ID and a Client Secret, which you can obtain from the Service application in your project. First, create a Service app in your project (Project -> Settings -> Service apps).

To manage access rights to the API, select an appropriate access level for your app when creating the service app - **Read**, **Operate,** or **Manage**.

The Bearer access token is a text string, included in the request header, for example:

```
curl -X GET https://api.emma.ms/external/v1/locations -H "Authorization: Bearer YOUR-ACCESS-TOKEN-HERE"
```

## Request body

- Credentials
  - `clientId` string, required: Client ID from the Service application in the project
  - `clientSecret` string, required: Client secret from the Service application in the project

## Response `200`

Successful operation

- Token
  - `otherClaims` object
  - `accessToken` string: Access token
  - `expiresIn` integer: Seconds until access token expiration
  - `refreshExpiresIn` integer: Seconds until refresh token expiration
  - `refreshToken` string: Refresh token
  - `tokenType` string: Token type
  - `idToken` integer, nullable
  - `notBeforePolicy` integer: Timestamp before which the token is not valid
  - `sessionState` string

## Other responses

- `400`: Bad request
- `500`: Internal server error

---

[API](https://skmtc.dev/emma/apis/public-emma-api.md) - [All operations](https://skmtc.dev/emma/apis/public-emma-api/llms.txt) - [OpenAPI document](https://skmtc.dev/emma/apis/public-emma-api/revisions/9e55f0920078?raw)
