---
title: "Generate User Token"
method: GET
path: "/v2/coe/authentication"
---

# Generate User Token

`GET /v2/coe/authentication`

## Request

- Base URL: `https://onekyc-token-sandbox.gopayapi.com`
- URL: `https://onekyc-token-sandbox.gopayapi.com/v2/coe/authentication`
- Auth: none declared. Required headers: `client-id`, `pass-key`, `x-onboarding-partner`, `x-partner-user-id`, `x-partner-user-id-type`

Generates a user token that must be passed to the IAB native SDK. Note: This API is only needed for Native SDK integration, not for H5/Web integration.

## Headers

- `client-id` string, required
- `pass-key` string, required
- `x-onboarding-partner` string, required
- `x-partner-user-id` string, required
- `x-partner-user-id-type` string, required

## Response `200`

Successful user token generation

- object
  - `success` boolean: Status of the API call
  - `data` object: Metadata of the API call
    - `token` string: IAB user token for the specified flow and user
    - `expiry_seconds` string: Time period in seconds for which the generated token will be valid
    - `expires_at` string: End time value in epoch timestamp for which the generated token will be valid

## Other responses

- `400`: Bad Request - Missing or improperly formatted parameters
- `401`: Unauthorized - Invalid client credentials
- `500`: Internal Server Error

---

[API](https://skmtc.dev/midtrans/apis/get-user-token-api.md) - [All operations](https://skmtc.dev/midtrans/apis/get-user-token-api/llms.txt) - [OpenAPI document](https://skmtc.dev/midtrans/apis/get-user-token-api/revisions/43da519d0cad?raw)
