Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 13 additions & 6 deletions CHARTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ ChittyID is the **authoritative identity management foundation** for the ChittyO
### Core Endpoints
| Endpoint | Method | Purpose |
|----------|--------|---------|
| `/api/v2/chittyid/mint` | POST | Generate new ChittyID |
| `/api/v2/chittyid/verify` | POST | Verify ChittyID validity |
| `/api/v2/chittyid/audit` | POST | Get audit trail |
| `/api/v2/chittyid/mint/batch` | POST | Batch generation |
| `/api/v2/fallback/request` | POST | Fallback service |
| `/mint` | POST | **Canonical** — generate a new ChittyID (body: `{entityType:"P"\|"L"\|"T"\|"E"\|"A"}`) |
| `/api/validate` | POST | Verify ChittyID validity (body: `{id}`) |
| `/api/spec` | GET | OpenAPI specification |
| `/health` | GET | Service health |

### Deprecated Aliases (sunset 2027-05-27)
These remain for backward compatibility and 308-redirect / proxy to the canonical `POST /mint`. Do not build new integrations against them.

| Endpoint | Method | Replacement |
|----------|--------|-------------|
| `/v1/mint` | POST | `POST /mint` |
| `/generate` | GET | `POST /mint` with `{entityType:"P"}` |
| `/api/get-chittyid` | GET | `POST /mint` |

### ChittyID Format
```
VV-G-LLL-SSSS-T-YYMM-C-XX
Expand Down Expand Up @@ -131,4 +138,4 @@ This charter is part of a synchronized documentation triad. Changes to shared fi
**Related docs**: [CHITTY.md](CHITTY.md) (badge/one-pager) | [CLAUDE.md](CLAUDE.md) (developer guide)

---
*Charter Version: 1.0.0 | Last Updated: 2026-02-23*
*Charter Version: 1.0.1 | Last Updated: 2026-05-28*
9 changes: 4 additions & 5 deletions CHITTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,10 @@ Version, Geographic region, Jurisdiction, Sequential ID, Entity Type (P/L/T/E/A)
| Path | Method | Auth | Purpose |
|------|--------|------|---------|
| `/health` | GET | No | Health check |
| `/api/v2/chittyid/mint` | POST | Yes | Generate new ChittyID |
| `/api/v2/chittyid/verify` | POST | Yes | Verify ChittyID validity |
| `/api/v2/chittyid/audit` | POST | Yes | Get audit trail |
| `/api/v2/chittyid/mint/batch` | POST | Yes | Batch generation |
| `/api/v2/fallback/request` | POST | Yes | Fallback service |
| `/mint` | POST | Yes | **Canonical** — generate a new ChittyID |
| `/api/validate` | POST | Yes | Verify ChittyID validity |
| `/api/spec` | GET | No | OpenAPI specification |
| `/v1/mint`, `/generate`, `/api/get-chittyid` | — | — | Deprecated aliases → `POST /mint` (sunset 2027-05-27) |

## Document Triad

Expand Down
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ This is the **authoritative ChittyID Foundation service** that defines HOW Chitt

## 🚀 API Endpoints

### v2 API (Current)
- `POST /api/v2/chittyid/mint` - Generate new ChittyID
- `POST /api/v2/chittyid/verify` - Verify ChittyID validity
- `POST /api/v2/chittyid/audit` - Get audit trail
- `POST /api/v2/chittyid/mint/batch` - Batch generation
- `POST /api/v2/fallback/request` - Fallback service
### Canonical API
- `POST /mint` - Generate a new ChittyID (body: `{entityType:"P"|"L"|"T"|"E"|"A"}`)
- `POST /api/validate` - Verify ChittyID validity
- `GET /api/spec` - OpenAPI specification
- `GET /health` - Service health

### Deprecated Aliases (sunset 2027-05-27)
- `POST /v1/mint` → use `POST /mint`
- `GET /generate` → use `POST /mint` with `{entityType:"P"}`
- `GET /api/get-chittyid` → use `POST /mint`
Comment on lines +38 to +39
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don't document GET aliases as compatible redirects

The current worker returns a 308 for /generate and /api/get-chittyid, and 308 preserves the original HTTP method, while the canonical /mint route only handles POST (worker.js lines 467-497). Any client following the documented GET /generate alias will therefore arrive at GET /mint and get a 404 instead of minting, so these aliases are not backward-compatible as described.

Useful? React with 👍 / 👎.


### Authentication
All endpoints require Bearer token authentication:
Expand All @@ -44,17 +48,13 @@ Authorization: Bearer your_chitty_id_token

### Request a ChittyID
```javascript
const response = await fetch('https://id.chitty.cc/api/v2/chittyid/mint', {
const response = await fetch('https://id.chitty.cc/mint', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_chitty_id_token'
},
body: JSON.stringify({
entity: 'PERSON',
name: 'John Doe',
format: 'official'
})
body: JSON.stringify({ entityType: 'P' })
});

const result = await response.json();
Expand All @@ -63,15 +63,13 @@ console.log(result.chitty_id); // CP-A-001-1234-P-2509-I-82

### Verify a ChittyID
```javascript
const response = await fetch('https://id.chitty.cc/api/v2/chittyid/verify', {
const response = await fetch('https://id.chitty.cc/api/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer your_chitty_id_token'
},
body: JSON.stringify({
chittyId: 'CP-A-001-1234-P-2509-I-82'
})
body: JSON.stringify({ id: 'CP-A-001-1234-P-2509-I-82' })
});

const result = await response.json();
Expand Down
9 changes: 4 additions & 5 deletions chittyid.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,18 @@ class ChittyIDClient {
}

try {
const response = await fetch(`${this.serverUrl}/api/v2/chittyid/mint`, {
const response = await fetch(`${this.serverUrl}/mint`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.apiKey}`,
"X-ChittyOS-Pipeline": "Router→Intake→Trust→Authorization→Generation",
},
body: JSON.stringify({
entityType,
region,
jurisdiction,
entity: entityType,
trustLevel,
Comment on lines 59 to 61
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve mint parameters when switching endpoints

When generate(region, jurisdiction, entityType, trustLevel) uses the new POST /mint route, the worker only reads entityType from the JSON body and takes region, jurisdiction, and trust from query parameters before forwarding to ChittyMint (worker.js lines 128-150). As a result, callers that pass explicit geography or trust level through this SDK now silently mint with defaults/inferred values instead of the requested region, jurisdiction, and trustLevel.

Useful? React with 👍 / 👎.

format: "official",
}),
});

Expand Down Expand Up @@ -94,13 +93,13 @@ class ChittyIDClient {
}

try {
const response = await fetch(`${this.serverUrl}/api/v2/chittyid/verify`, {
const response = await fetch(`${this.serverUrl}/api/validate`, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${this.apiKey}`,
},
body: JSON.stringify({ chittyId }),
body: JSON.stringify({ id: chittyId }),
});

if (!response.ok) {
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default [
"_worker.js",
"node_modules/**",
"research/**",
"chitty-cli.js",
".archive-2026-05-27/**",
"coverage/**",
".nyc_output/**",
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@chittyfoundation/chittyid",
"version": "2.0.0",
"description": "Official ChittyID Foundation Service - Authoritative identity management for ChittyOS ecosystem",
"main": "chittyid-service-worker.js",
"main": "worker.js",
"type": "module",
"repository": {
"type": "git",
Expand Down
Loading