---
title: "Create client credentials token"
method: POST
path: "/resources/tenants/api-tokens/v1"
tags: ["API (tenant) tokens"]
deprecated: true
---

# Create client credentials token

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

## Request

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

> **Deprecated.**

Do not use. Instead, use v2 of this route.

## Headers

- `frontegg-tenant-id` string, required

## Request body

- CreateTenantApiTokenDto
  - `metadata` object: Extra data that will be encoded as part of the JWT
  - `description` string
  - `roleIds` string[]: Array of role ids. Either this or permissionIds must be provided, but not both.
  - `permissionIds` string[]: Array of permission ids. Either this or roleIds must be provided, but not both. roleIds will override permissionIds.

## Response `201`

- CreateTenantApiTokenResponseDto
  - `clientId` string, required
  - `description` string, nullable, required
  - `tenantId` string, required
  - `secret` string, required
  - `createdByUserId` string, nullable, required
  - `metadata` object, required: Extra data that will be encoded as part of the JWT
  - `createdAt` string, date-time, required
  - `permissionIds` string[]: Array of permission ids
  - `roleIds` string[]: Array of role ids
  - `expires` string, date-time

---

[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)
