---
title: "Create Tenant"
method: POST
path: "/_api/tenant"
tags: ["Administration"]
---

# Create Tenant

`POST /_api/tenant`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_api/tenant/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new tenant.

**Note**: Requires *administrator* permissions.

## Request body

- TenantCreate
  - `email` string, required: Email address of tenant.
  - `displayName` string: The name of the tenant.
  - `passwd` string: The user password.
  - `plan` string: The billing plan name.
  - `attribution` string: The attribution.
  - `dcList` string, required: A comma-separated string containing the data center names on which this tenant is to be created. If an empty string is passed in, the tenant is assumed to be global to the federation and is created on all current data centers in the federation.
  - `metadata` GetTenantMetadataObjectExample
    - `key1` string, string: Name of metadata key 1.
    - `key2` string, string: Name of metadata key 2.
  - `contact` CreateTenantContactObjectExample
    - `firstname` string: First name of user.
    - `lastname` string: Last name of user.
    - `email` string: Email address of user.
    - `phone` string: Phone number of user.
    - `line1` string: First line of address of user.
    - `line2` string: Second line of address of user.
    - `city` string: Name of the city.
    - `state` string: Name of state.
    - `country` string: Name of country.
    - `zipcode` string: Zip code of user.

## Response `201`

Successfully created tenant.

- AdministrationTenantCreateRc201
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `result` object
    - `displayName` string: The name of the tenant.
    - `email` string: Email address of tenant.
    - `attribution` string: The attribution.
    - `plan` string: The billing plan name.
    - `dcList` string: A comma-separated string containing the data center names on which this tenant is to be created. If an empty string is passed in, the tenant is assumed to be global to the federation and is created on all current data centers in the federation.
    - `tenant` string: The tenant name.
    - `metadata` GetTenantMetadataObjectExample
      - `key1` string, string: Name of metadata key 1.
      - `key2` string, string: Name of metadata key 2.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed because you do not have administrator permissions.
- `403`: Failed to validate because you do not have access to the server.
- `409`: Failed because tenant already exists.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
