---
title: Provisioning
description: Provisioning protocol schemas
---

{/* ⚠️  AUTO-GENERATED — DO NOT EDIT. Run build-docs.ts to regenerate. Hand-written docs go in content/docs/guides/. */}

Tenant Provisioning Protocol

Defines the schemas for the "Register → Instant ObjectOS" provisioning pipeline:

1. User registers → ProvisioningRequest created

2. Turso database created → Schema synced → Seed data applied

3. Tenant status transitions: provisioning → active

Provisioning is designed to be:

- **Idempotent**: Re-running the same request produces the same result

- **Observable**: Each step has explicit status tracking

- **Fast**: Target 2-5 seconds for complete provisioning

<Callout type="info">
**Source:** `packages/spec/src/system/provisioning.zod.ts`
</Callout>

## TypeScript Usage

```typescript
import { ProvisioningStep, TenantPlan, TenantProvisioningRequest, TenantProvisioningResult, TenantProvisioningStatusEnum, TenantRegion } from '@objectstack/spec/system';
import type { ProvisioningStep, TenantPlan, TenantProvisioningRequest, TenantProvisioningResult, TenantProvisioningStatusEnum, TenantRegion } from '@objectstack/spec/system';

// Validate data
const result = ProvisioningStep.parse(data);
```

---

## ProvisioningStep

Individual provisioning step status

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Step name (e.g., create_database, sync_schema) |
| **status** | `Enum<'pending' \| 'running' \| 'completed' \| 'failed' \| 'skipped'>` | ✅ | Step status |
| **startedAt** | `string` | optional | Step start time |
| **completedAt** | `string` | optional | Step completion time |
| **durationMs** | `integer` | optional | Step duration in ms |
| **error** | `string` | optional | Error message on failure |


---

## TenantPlan

Tenant subscription plan

### Allowed Values

* `free`
* `pro`
* `enterprise`


---

## TenantProvisioningRequest

Tenant provisioning request

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **orgId** | `string` | ✅ | Organization ID |
| **plan** | `Enum<'free' \| 'pro' \| 'enterprise'>` | ✅ | Tenant subscription plan |
| **region** | `Enum<'us-east' \| 'us-west' \| 'eu-west' \| 'eu-central' \| 'ap-southeast' \| 'ap-northeast'>` | ✅ | Available deployment region |
| **displayName** | `string` | optional | Tenant display name |
| **adminEmail** | `string` | optional | Initial admin user email |
| **metadata** | `Record<string, any>` | optional | Additional metadata |


---

## TenantProvisioningResult

Tenant provisioning result

### Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **tenantId** | `string` | ✅ | Provisioned tenant ID |
| **connectionUrl** | `string` | ✅ | Database connection URL |
| **status** | `Enum<'provisioning' \| 'active' \| 'suspended' \| 'failed' \| 'destroying'>` | ✅ | Tenant provisioning lifecycle status |
| **region** | `Enum<'us-east' \| 'us-west' \| 'eu-west' \| 'eu-central' \| 'ap-southeast' \| 'ap-northeast'>` | ✅ | Available deployment region |
| **plan** | `Enum<'free' \| 'pro' \| 'enterprise'>` | ✅ | Tenant subscription plan |
| **steps** | `Object[]` | ✅ | Pipeline step statuses |
| **totalDurationMs** | `integer` | optional | Total provisioning duration |
| **provisionedAt** | `string` | optional | Provisioning completion time |
| **error** | `string` | optional | Error message on failure |


---

## TenantProvisioningStatusEnum

Tenant provisioning lifecycle status

### Allowed Values

* `provisioning`
* `active`
* `suspended`
* `failed`
* `destroying`


---

## TenantRegion

Available deployment region

### Allowed Values

* `us-east`
* `us-west`
* `eu-west`
* `eu-central`
* `ap-southeast`
* `ap-northeast`


---

