API ReferenceREST /api/v1Sign in

Kiwi Host is a REST control plane at /api/v1. Resources use plural nouns, cursor pagination (?cursor= and limit=), and RFC 9457 problem details. Mutations that change infrastructure return 202 Accepted with { jobId, statusUrl }.

This reference covers routes that exist in the running API. Demo-only staff drills are omitted.

Base URL

The origin comes from the environment the client is built with (NEXT_PUBLIC_API_URL). Local development defaults to http://localhost:3001. There is no hardcoded shop or tenant hostname in this product.

Conventions

Send Content-Type: application/json on POST bodies. Echo X-Correlation-Id when you set it. For order creation, send Idempotency-Key. Cross-tenant reads return 404, not 403.

Markdown source
---
title: API Reference
nav: Introduction
group: Get started
order: 10
---

# API Reference

Kiwi Host is a REST control plane at `/api/v1`. Resources use plural nouns, cursor pagination (`?cursor=` and `limit=`), and RFC 9457 problem details. Mutations that change infrastructure return `202 Accepted` with `{ jobId, statusUrl }`.

This reference covers routes that exist in the running API. Demo-only staff drills are omitted.

## Base URL

The origin comes from the environment the client is built with (`NEXT_PUBLIC_API_URL`). Local development defaults to `http://localhost:3001`. There is no hardcoded shop or tenant hostname in this product.

```curl
curl {{API}}/health
```

```node
const api = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:3001";
await fetch(`${api}/health`);
```

```python
import os, urllib.request
api = os.environ.get("NEXT_PUBLIC_API_URL", "http://localhost:3001")
urllib.request.urlopen(f"{api}/health")
```

## Conventions

Send `Content-Type: application/json` on POST bodies. Echo `X-Correlation-Id` when you set it. For order creation, send `Idempotency-Key`. Cross-tenant reads return `404`, not `403`.

```curl
curl -H "X-Correlation-Id: 11111111-1111-1111-1111-111111111111" {{API}}/api/v1/plans
```

```node
await fetch(`${api}/api/v1/plans`, {
  headers: { "X-Correlation-Id": crypto.randomUUID() },
});
```

```python
req = urllib.request.Request(f"{api}/api/v1/plans", headers={"X-Correlation-Id": "11111111-1111-1111-1111-111111111111"})
```