---
name: turadb
version: 1.1.0
description: Managed infrastructure provisioning API. Spin up Postgres instances and object storage buckets, get connection strings and storage endpoints, automate backups. No ops required.
homepage: https://www.turadb.com
metadata: {"category":"infrastructure","api_base":"https://www.turadb.com/api/v1"}
---

# TuraDB

**Managed database and object storage provisioning via API.**

Provision Postgres instances and object storage buckets, retrieve connection strings and storage endpoints, monitor queries, and configure backups — all over REST. No ops overhead. Part of Tura Cloud. Authentication uses TuraLogin API keys (Bearer token).

TuraDB is the infrastructure layer. It gives you raw resources. If you want a higher-level API (schema-first data, file uploads without connection strings), use [TuraBase](https://www.turabase.com/SKILL.md) which builds on TuraDB.

## Skill Files

| File | URL |
|------|-----|
| **SKILL.md** (this file) | `https://www.turadb.com/SKILL.md` |
| **AGENTS.md** | `https://www.turadb.com/AGENTS.md` |
| **API.md** | `https://www.turadb.com/API.md` |
| **QUICKSTART.md** | `https://www.turadb.com/QUICKSTART.md` |
| **skill.json** (metadata) | `https://www.turadb.com/skill.json` |

**Base URL:** `https://www.turadb.com/api/v1`

**Authentication:** `Authorization: Bearer <API_KEY>` — Use TuraLogin API keys from https://www.turalogin.com/dashboard/keys

---

## Overview

TuraDB provisions two types of infrastructure:

**Postgres (structured data)**

✅ **Provisioning** — Create a database instance with one API call  
✅ **Connection strings** — Retrieve pooled and direct connection URLs  
✅ **Backups** — Automatic daily snapshots, point-in-time restore  
✅ **Monitoring** — Slow query logs, connection pool stats  

**Object storage (files and blobs)**

✅ **Buckets** — Provision an S3-compatible bucket with one API call  
✅ **Endpoints** — Get storage endpoint and access credentials back immediately  
✅ **Stats** — Object count and storage usage per bucket  

You handle:
- Your schema, migrations, and query logic
- Your application's file upload and retrieval logic
- Access control for your users

---

## Quick Start

### 1. Get Your API Key

TuraDB uses **TuraLogin API keys**. Get one at https://www.turalogin.com/dashboard/keys

- Test: `tl_test_xxxxxxxxxxxxxxxx`
- Production: `tl_live_xxxxxxxxxxxxxxxx`

### 2. Provision a Database

```bash
curl -X POST https://www.turadb.com/api/v1/db/instances \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-app-db",
    "engine": "postgres",
    "tier": "starter"
  }'
```

**Response:**
```json
{
  "id": "db_abc123xyz",
  "name": "my-app-db",
  "engine": "postgres",
  "tier": "starter",
  "status": "provisioning",
  "connectionUrl": "postgresql://user:pass@host:5432/my-app-db?sslmode=require",
  "pooledUrl": "postgresql://user:pass@pooler.host:5432/my-app-db",
  "createdAt": "2026-02-22T10:00:00Z"
}
```

### 3. Provision an Object Storage Bucket

```bash
curl -X POST https://www.turadb.com/api/v1/storage/buckets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-app-files",
    "region": "us-east-1"
  }'
```

**Response:**
```json
{
  "id": "bkt_xyz789abc",
  "name": "my-app-files",
  "region": "us-east-1",
  "status": "active",
  "endpoint": "https://my-app-files.storage.turadb.com",
  "accessKeyId": "AKIAXXXXXXXXXXXXXXXX",
  "secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "createdAt": "2026-02-22T10:00:00Z"
}
```

---

## Full API Reference

### Postgres Instances

#### POST /api/v1/db/instances

Provision a new database instance.

**Request Body:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Database name (alphanumeric, hyphens) |
| `engine` | string | Yes | `postgres` |
| `tier` | string | No | `starter`, `standard`, `pro` (default: `starter`) |
| `region` | string | No | `us-east-1`, `eu-west-1` (default: `us-east-1`) |

---

#### GET /api/v1/db/instances

List all database instances.

```bash
curl https://www.turadb.com/api/v1/db/instances \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Success Response (200):**
```json
{
  "instances": [
    {
      "id": "db_abc123",
      "name": "my-app-db",
      "engine": "postgres",
      "tier": "starter",
      "status": "active",
      "createdAt": "2026-02-22T10:00:00Z"
    }
  ]
}
```

---

#### GET /api/v1/db/instances/:id

Get instance details including connection strings.

---

#### DELETE /api/v1/db/instances/:id

Deprovision an instance (irreversible).

---

#### GET /api/v1/db/instances/:id/stats

Query monitoring stats.

**Success Response (200):**
```json
{
  "connections": { "active": 12, "idle": 3, "max": 25 },
  "slowQueries": [
    { "query": "SELECT ...", "avgMs": 450, "count": 12 }
  ],
  "storageUsedMb": 128
}
```

---

### Object Storage Buckets

#### POST /api/v1/storage/buckets

Provision a new object storage bucket.

**Request Body:**

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | Bucket name (alphanumeric, hyphens, globally unique) |
| `region` | string | No | `us-east-1`, `eu-west-1` (default: `us-east-1`) |
| `public` | boolean | No | Allow unauthenticated GET requests (default: `false`) |

**Success Response (201):**
```json
{
  "id": "bkt_xyz789abc",
  "name": "my-app-files",
  "region": "us-east-1",
  "public": false,
  "status": "active",
  "endpoint": "https://my-app-files.storage.turadb.com",
  "accessKeyId": "AKIAXXXXXXXXXXXXXXXX",
  "secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "createdAt": "2026-02-22T10:00:00Z"
}
```

---

#### GET /api/v1/storage/buckets

List all buckets.

```bash
curl https://www.turadb.com/api/v1/storage/buckets \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Success Response (200):**
```json
{
  "buckets": [
    {
      "id": "bkt_xyz789abc",
      "name": "my-app-files",
      "region": "us-east-1",
      "public": false,
      "status": "active",
      "createdAt": "2026-02-22T10:00:00Z"
    }
  ]
}
```

---

#### GET /api/v1/storage/buckets/:id

Get bucket details including credentials and endpoint.

---

#### DELETE /api/v1/storage/buckets/:id

Deprovision a bucket and all its contents (irreversible).

---

#### GET /api/v1/storage/buckets/:id/stats

Get bucket usage stats.

**Success Response (200):**
```json
{
  "objectCount": 4821,
  "storageUsedMb": 2048,
  "storageUsedBytes": 2147483648
}
```

---

## Framework Examples

### Next.js (App Router) — Provision database

```typescript
// app/api/db/provision/route.ts
export async function POST(request: Request) {
  const body = await request.json();

  const res = await fetch('https://www.turadb.com/api/v1/db/instances', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.TURADB_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(body),
  });

  return Response.json(await res.json(), { status: res.status });
}
```

### Next.js (App Router) — Provision storage bucket

```typescript
// app/api/storage/provision/route.ts
export async function POST(request: Request) {
  const { name, region, isPublic } = await request.json();

  const res = await fetch('https://www.turadb.com/api/v1/storage/buckets', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.TURADB_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ name, region, public: isPublic }),
  });

  return Response.json(await res.json(), { status: res.status });
}
```

---

## Error Codes

| Status | Error | Description |
|--------|-------|-------------|
| 400 | `name is required` | Missing resource name |
| 400 | `Invalid engine` | Must be `postgres` |
| 401 | `Unauthorized` | Missing or invalid API key |
| 404 | `Instance not found` | Invalid instance or bucket ID |
| 409 | `Name already in use` | Instance or bucket name taken |
| 429 | `Too many requests` | Rate limit exceeded |

---

## Support & Resources

- 🌐 Website: https://www.turadb.com
- 🔑 API Keys: https://www.turalogin.com/dashboard/keys
- 🏗️ Higher-level BaaS: https://www.turabase.com/SKILL.md
