---
title: "Create sub-tenant"
method: POST
path: "/resources/hierarchy/v1"
tags: ["Account Hierarchy"]
---

# Create sub-tenant

`POST /resources/hierarchy/v1`

## Request

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

Assign an existing tenant to the hierarchy as a sub-tenant of a given parent tenant. A vendor token is required for this route, it can be obtained from the vendor authentication route.

## Request body

- CreateSubTenantRequestDto
  - `parentTenantId` string
  - `childTenantId` string

## Other responses

- `400`: When:a) given parameters do not pass validationb) or parent and child tenant are equalc) or child tenant is already a subtenant in other organization's hierarchy

---

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