# SoulInTime API v1

Stable URL of this page: https://soulintime.com/api-v1.md · OpenAPI 3.1: https://soulintime.com/.well-known/openapi-v1.yaml · Last updated 2026-11-24 · Full page: https://soulintime.com/integrate · Spec: https://soulintime.com/sit-statement-0.1.md

For any app, agent or AI platform. JSON, CORS (`Access-Control-Allow-Origin: *`), signed out, no key. Only a SHA-256 is sent; the file never leaves your machine.
Base44 serves backend functions only at `/functions/<name>` (no custom `/api/...` routes, no path parameters), so the API lives at the URLs below. There is no `/api/v1/` path.

## Create a receipt

```sh
curl -s -X POST https://soulintime.com/functions/apiV1Receipts -H "Content-Type: application/json" -d "{\"hash\":\"$(sha256sum yourfile | cut -c1-64)\",\"source\":\"yourapp\"}"
```

`POST https://soulintime.com/functions/apiV1Receipts` with `{"hash":"<64 hex>","source":"<optional name>"}`. `source` is self-declared and stored internally only (no IP, user agent or referrer). The optional `X-SoulInTime-Api-Key` header is accepted and ignored for now.

- 201: a receipt, not yet a statement:

```json
{"receipt_id": "moment-abcd1234", "hash": "<sha256>", "status": "in_calendar", "height": null, "statement_url": "https://soulintime.com/statement?hash=<sha256>", "cite": null, "proof_file": "https://soulintime.com/functions/v1Proof?id=moment-abcd1234&ots=1", "next_action": {"do": "verify_later", "url": "https://soulintime.com/functions/apiV1Verify?hash=<sha256>", "after_seconds": 600, "note": "Pending is not a statement. Bitcoin confirmation usually takes 1 to 6 hours. Do not cite yet."}}
```

- 409 `already_exists`: the hash already has a receipt. Nothing new is created. Carries `receipt_id` and `status`; `cite` only once anchored with a signed statement.
- 429 `rate_limited`: nothing was created, so there is no `receipt_id`, no `statement_url` and no `cite` (no receipt, no link). The body is only the error, a pricing link and the reset time, `{"error":"rate_limited","note":"…","pricing":"Free limit reached. Pricing: https://soulintime.com/pricing","reset_at":"<UTC>","reset_unix":N,"retry_after_seconds":N}`, with headers `Retry-After`, `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix seconds) and `X-SoulInTime-Request-Id`. 201 and 409 also carry `X-RateLimit-*` when the limiter reports them.
- Free rule, same as everywhere: your first statement is free; one fresh hash per network per hour.

## Verify a hash (no key)

```sh
curl -s "https://soulintime.com/functions/apiV1Verify?hash=<sha256>"
```

Anchored (HTTP 200):

```json
{"anchored": true, "receipt_id": "a-hash-is-a-door-that-2026-019bd305", "hash": "019bd3056ae35f6eee3f61fcabdaabcfe5f374c07168a7e4d6fa38a828cbac2f", "height": 965906, "timestamp": null, "status": "anchored", "statement_url": "https://soulintime.com/statement?hash=019bd3056ae35f6eee3f61fcabdaabcfe5f374c07168a7e4d6fa38a828cbac2f", "cite": "sha256 019bd3056ae35f6eee3f61fcabdaabcfe5f374c07168a7e4d6fa38a828cbac2f existed by Bitcoin block 965906. Statement: https://soulintime.com/statement?hash=019bd3056ae35f6eee3f61fcabdaabcfe5f374c07168a7e4d6fa38a828cbac2f", "proof_file": "https://soulintime.com/functions/v1Proof?id=a-hash-is-a-door-that-2026-019bd305&ots=1", "next_action": {"do": "cite", "cite": "sha256 019bd3056ae35f6eee3f61fcabdaabcfe5f374c07168a7e4d6fa38a828cbac2f existed by Bitcoin block 965906. Statement: https://soulintime.com/statement?hash=019bd3056ae35f6eee3f61fcabdaabcfe5f374c07168a7e4d6fa38a828cbac2f", "note": "Paste the cite line as-is, on one line."}}
```

Never seen: HTTP 404 `{"anchored":false,"status":"not_found","height":null,"statement_url":null,"cite":null,...}`. No receipt: do not cite. Anchored answers also carry `card_url`, a shareable card. A receipt by id: `GET https://soulintime.com/functions/apiV1Receipts?id=<receipt_id>` (same shape).

## Rules

- `status` is `pending`, `in_calendar` or `anchored` (`not_found` on verify). `height` is set only when anchored: a real block height and an https `.ots`. Never the chain tip.
- `timestamp` is the Bitcoin block time (UTC) when anchored and known, else null.
- The create answer never waits for Bitcoin. Status changes on its own when the calendar's attestation reaches a block (usually 1 to 6 hours).
- `cite` is the one-line cite: `sha256 <hash> existed by Bitcoin block <N>. Statement: <url>`. Paste it as-is. It says only that these exact bytes existed by that block.
- `next_action` tells an agent what to do next: `cite`, `verify_later` (with `url` and `after_seconds`), `create`, or `retry_after`.
- Every answer carries `X-SoulInTime-Request-Id`.
- The statement stays verifiable offline with the public key and the `.ots`, even if this site disappears: https://github.com/SoulinTime/soulintime-client/tree/main/verifier

The older URLs (`/functions/createMoment`, `/functions/v1Verify`, `/functions/v1Statement`, MCP tool `stamp`) keep working unchanged.

## Above 1 receipt per hour: the Merkle-root pattern

There is no batch endpoint. Hash each item on your side, build a Merkle tree (SHA-256 of left+right, sorted or in a fixed order you record), and create one receipt for the root. Keep each item's path (its sibling hashes). Once the root is anchored, any item proves it existed by that block: recompute the root from the item and its path, then verify the root. One receipt dates them all.

## Limits

- Create: one fresh hash per network per hour on the free path (your first one is free). Confirmation takes hours.
- Verify: no key and never creates anything; best effort. The older `/functions/v1Verify` allows 120 requests per IP per 60 s per server instance.
- The limit exists so a free, signed-out service cannot be used to flood Bitcoin calendars.
- Verify is free forever. Create is free for light use and paid at volume: https://soulintime.com/pricing
