# CNA API Reference (v1.1)

RESTful API for managing cards, edges, compositions, and suggested edges.

## Base URL

```
https://api.cardnetwork.dev/v1
```

---

## Cards

### List Cards
```http
GET /cards
```

**Query Parameters:**
| Parameter | Type | Description |
|-----------|------|-------------|
| `type` | string | Filter by card type |
| `tags` | string | Comma-separated tag filter |
| `status` | string | Filter by card status (draft, review, validating, published, archived) |
| `namespace` | string | Filter by namespace (default: @personalos) |
| `limit` | integer | Results per page (default: 50) |
| `offset` | integer | Pagination offset |

### Get Card
```http
GET /cards/:id
```

### Create Card
```http
POST /cards
```

### Update Card
```http
PUT /cards/:id
```

### Delete Card
```http
DELETE /cards/:id
```

---

## Edges

### List Edges
```http
GET /edges
```

### Get Edge
```http
GET /edges/:id
```

### Create Edge
```http
POST /edges
```

### Delete Edge
```http
DELETE /edges/:id
```

---

## Suggested Edges

### List Suggested Edges
```http
GET /edges/suggested
```

### Create Suggested Edge
```http
POST /edges/suggested
```

### Confirm Suggested Edge
```http
PUT /edges/suggested/:id/confirm
```

### Reject Suggested Edge
```http
PUT /edges/suggested/:id/reject
```

---

## Compositions

### List Compositions
```http
GET /compositions
```

### Get Composition
```http
GET /compositions/:id
```

### Create Composition
```http
POST /compositions
```

### Delete Composition
```http
DELETE /compositions/:id
```

---

## Graph Traversal

### Traverse from Card
```http
GET /cards/:id/traverse
```

### Get Connected Cards
```http
GET /cards/:id/connected
```

---

## Search

### Semantic Search
```http
POST /search
```

---

## Authentication

Include API key in header:
```http
Authorization: Bearer <api_key>
```

Or use x402 payment protocol for pay-per-query access.

## Rate Limits

| Tier | Requests/min | Traversal depth |
|------|-------------|-----------------|
| Free | 60 | 3 |
| Pro | 600 | 10 |
| Enterprise | Unlimited | Unlimited |