---
title: "Create tenant access token"
method: POST
path: "/resources/tenants/access-tokens/v1"
tags: ["API (tenant) tokens"]
---

# Create tenant access token

`POST /resources/tenants/access-tokens/v1`

## Request

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

## Headers

- `frontegg-tenant-id` string, required

## Request body

- CreateTenantAccessTokenRequest
  - `description` string
  - `expiresInMinutes` number: Token expiration time in minutes. In case of undefined, the token won't be expired
  - `roleIds` string[]: Array of role IDs to attach to the token

## Response `201`

- TenantAccessTokenResponse
  - `id` string, required
  - `description` string
  - `createdAt` string, date-time, required
  - `secret` string
  - `expires` string, date-time
  - `roleIds` string[], required: Array of role ids
  - `createdByUserId` string, nullable, 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)
