---
title: "Authenticate using API token"
method: POST
path: "/resources/auth/v2/api-token"
tags: ["API token"]
---

# Authenticate using API token

`POST /resources/auth/v2/api-token`

## Request

- Base URL: `http://localhost:8181`
- URL: `http://localhost:8181/resources/auth/v2/api-token`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/docs/resources/auth/v2/api-token/post.ts> (a function with typed inputs; its response is checked against the schema)

This route authenticates a tenant’s or user’s API token. The clientId and secret key are in Admin Portal ➜ API Tokens. Send these values as params in the POST body and authenticate to your Frontegg domain by replacing api.frontegg.com with your Frontegg domain.</br>**NOTE**: This route enforces(by default) a rotation mechanism for refresh tokens associated with the API token. It limits each token to a maximum of 100 refresh tokens simultaneously. When a client authenticates using the same API token for the 101th time, the earliest refresh token is automatically invalidated.

## Request body

- AuthApiTokenDto
  - `clientId` string, required
  - `secret` string, required

## Response `200`

- ApiTokenAuthV2Response
  - `access_token` string, required
  - `refresh_token` string, required
  - `expires_in` number, required
  - `expires` string, required

---

[API](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp.md) - [All operations](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/llms.txt) - [OpenAPI document](https://skmtc.dev/frontegg/apis/entitlements-agent-pdp/revisions/c496ae9e1c3e?raw)
