# createPartnerTenant

Source: /openapi/thomas-federated.openapi.json

## Operation

| Method | URL |
|---|---|
| POST | https://staging-api.thomas.co/v1/tenants |

| Field | Value |
|---|---|
| operationId | createPartnerTenant |
| method | POST |
| server | https://staging-api.thomas.co/v1 |
| path | /tenants |
| tags | `Partner Tenants` |
| summary | Create a customer tenant |
| badges | None |

## Request Parameters

| Name | In | Required | Schema | Description |
|---|---|---|---|---|
| Idempotency-Key | header | true | string | An opaque client-generated key, 1-255 visible ASCII characters excluding comma. Repeating a request with the same key and the same body is safe. |

## Request Body

| Content type | Schema refs |
|---|---|
| application/json | #/components/schemas/PartnerTenantCreateRequestDto |

## Responses

| Status | Description | Schema refs |
|---|---|---|
| 200 | The supplied customer identity matched existing evidence. The opaque outcome either requests the existing Customer access flow or requires platform-admin resolution. | #/components/schemas/PartnerTenantRequestAccessOutcomeDto, #/components/schemas/PartnerTenantAdminResolutionRequiredOutcomeDto |
| 201 | The Tenant was created and the calling Partner already has access to it. | #/components/schemas/PartnerTenantCreatedOutcomeDto |
| 400 | Request validation, idempotency-header, or customer-identity validation failed | #/components/schemas/ApiErrorResponseDto |
| 401 | Invalid or missing authentication token (AUTH_TOKEN_INVALID) | #/components/schemas/ApiErrorResponseDto |
| 403 | Only a provisioned Partner-owned API client may call this operation | #/components/schemas/ApiErrorResponseDto |
| 409 | Customer identity, idempotency state, or Partner tenant cap prevented creation | #/components/schemas/ApiErrorResponseDto |
| 429 | The per-Credential business rate limit was exceeded (60 requests per minute). | #/components/schemas/ApiErrorResponseDto |

### Response 409 headers

| Name | Description | Schema |
|---|---|---|
| Retry-After | Present as `1` only when an equivalent idempotent request is in progress | {"type":"string","example":"1"} |

### Response 429 headers

| Name | Description | Schema |
|---|---|---|
| Retry-After | Seconds until the rate-limit block expires before retrying. | {"type":"integer","minimum":0} |
| RateLimit-Limit | Configured request limit for the active rate-limit window. | {"type":"integer"} |
| RateLimit-Remaining | Requests remaining in the active rate-limit window; zero when blocked. | {"type":"integer"} |
| RateLimit-Reset | Seconds until the rate-limit block expires. | {"type":"integer","minimum":0} |

## Artifact Examples

### Response 401 example

```json
{
  "statusCode": 401,
  "message": "Invalid or missing authentication token",
  "error": "AUTH_TOKEN_INVALID"
}
```

### Response 403 example

```json
{
  "statusCode": 403,
  "message": "API client is not permitted to call this operation",
  "error": "PRINCIPAL_TYPE_NOT_ALLOWED"
}
```

### Response 429 example

```json
{
  "statusCode": 429,
  "message": "ThrottlerException: Too Many Requests",
  "error": "HTTP_TOO_MANY_REQUESTS"
}
```
