> This page is for Multi-Tenant, version v3.0 (default).
> For other versions, use one of these documentation indexes:
> - v3.0 (default): https://docs.nvidia.com/run-ai/multi-tenant/v3.0/llms.txt
> - v2.26: https://docs.nvidia.com/run-ai/multi-tenant/v2.26/llms.txt
> - v2.25: https://docs.nvidia.com/run-ai/multi-tenant/v2.25/llms.txt
> - v2.24: https://docs.nvidia.com/run-ai/multi-tenant/v2.24/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/run-ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/run-ai/_mcp/server.

# Create tenant

POST http://localhost:8080/api/v1/tenants
Content-Type: application/json

Reference: https://docs.nvidia.com/run-ai/multi-tenant/reference/rest-api/endpoints/organizations/tenant/create-tenant

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication

## Request

### Body (application/json)

This endpoint expects a TenantCreationRequest.

- `name` (string, required) — The name of the tenant.
- `email` (string, required) — The email of the tenant's admin user.
- `alias` (string, optional, nullable) — An optional alias for the tenant. Must be unique across all tenant names and aliases.
- `password` (string, optional, nullable) — The password for the tenant's admin user. Must contain at least 1 special character, 1 uppercase letter, 1 lowercase letter, 1 digit, and be at least 8 characters long.
- `contractType` (enum, optional)
  - Allowed values: `normal`, ``
- `role` (enum, optional) — The role assigned to the tenant's admin user. Possible value: System administrator.
  - Allowed values: `System administrator`, `Cloud operator`
- `metricStore` (MetricStore, optional, nullable)

## Response

### 201

Created

- `tenant` (Tenant, required)
- `additionalData` (TenantCreationResponseAdditionalData, optional, nullable) — additional data for tenant creation

## Errors

### 400 Bad Request Error

Bad request.

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 401 Unauthorized Error

Unauthorized

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 403 Forbidden Error

Forbidden

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 404 Not Found Error

The specified resource was not found

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 409 Conflict Error

The specified resource already exists

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 500 Internal Server Error

unexpected error

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

### 503 Service Unavailable Error

unexpected error

- `code` (integer, required)
- `message` (string, required)
- `details` (string, optional)

## Types

### MetricStore

- `read` (MetricStoreEndpoint, required)
- `write` (MetricStoreEndpoint, required)

### Tenant

- `id` (integer, required) — The id of the tenant.
- `uuid` (string, required) — The universally unique identifier of the tenant.
- `name` (string, required) — The internal system name of the tenant.
- `smg` (boolean, required)
- `status` (enum, required) — The current status of the tenant. Possible values: - Creating - Failed - Updating - Deleted - Deleting - Ready
  - Allowed values: `Creating`, `Failed`, `Updating`, `Deleted`, `Deleting`, `Ready`
- `createdAt` (datetime, required) — The date and time when the tenant was created.
- `updatedAt` (datetime, required) — The date and time when the tenant was last updated.
- `contractType` (enum, required)
  - Allowed values: `normal`, `trial`
- `mimirId` (string, optional)
- `displayName` (string, optional) — The name of the tenant as shown to users within the tenant.
- `alias` (string, optional) — An optional alias for the tenant.
- `diagnostics` (string, optional) — Most recent provisioning failure message. Only populated by GET /tenants/\{id} when status is Failed.

### TenantCreationResponseAdditionalData

additional data for tenant creation

### MetricStoreEndpoint

- `url` (string, required)
- `auth` (MetricStoreEndpointAuth, optional, nullable)
- `headers` (map from string to string, optional, nullable)

### MetricStoreEndpointAuth

- `basic` (MetricStoreEndpointAuthBasic, optional, nullable)

### MetricStoreEndpointAuthBasic

- `username` (string, optional)
- `password` (string, optional)

## Examples

**Request**

```json
{
  "name": "name",
  "email": "admin@example.com"
}
```

**Response**

```json
{
  "tenant": {
    "id": 1,
    "uuid": "string",
    "name": "example",
    "smg": true,
    "status": "Ready",
    "createdAt": "2024-01-15T09:30:00Z",
    "updatedAt": "2024-01-15T09:30:00Z",
    "contractType": "normal",
    "displayName": "Example",
    "created_at": "2020-01-01T00:00:00Z",
    "deleted_at": null,
    "tenantId": 123,
    "updated_at": "2020-01-02T00:00:00Z"
  },
  "additionalData": {
    "customerUser": {
      "user@tenant": "Abc!23"
    },
    "tenantDomain": "tenant.example.com"
  }
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/api/v1/tenants"

payload = {
    "name": "name",
    "email": "admin@example.com"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:8080/api/v1/tenants';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"name","email":"admin@example.com"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:8080/api/v1/tenants"

	payload := strings.NewReader("{\n  \"name\": \"name\",\n  \"email\": \"admin@example.com\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:8080/api/v1/tenants")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"name\",\n  \"email\": \"admin@example.com\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("http://localhost:8080/api/v1/tenants")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"name\",\n  \"email\": \"admin@example.com\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8080/api/v1/tenants', [
  'body' => '{
  "name": "name",
  "email": "admin@example.com"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8080/api/v1/tenants");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"name\",\n  \"email\": \"admin@example.com\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "name",
  "email": "admin@example.com"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8080/api/v1/tenants")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```