> ## Documentation Index
> Fetch the complete documentation index at: https://docs.haus25.live/llms.txt
> Use this file to discover all available pages before exploring further.

# API Endpoints

> Complete reference for haus²⁵ autonomous curation service REST API endpoints.

The curation service provides REST API endpoints for multi-agent event optimization and promotional content generation. All endpoints use JSON request/response format and support CORS for browser integration.

## Base Configuration

**Base URL**: `http://localhost:3001` (development) / `https://curation.haus25.live` (production)\
**Content-Type**: `application/json`\
**Body Limit**: 50MB\
**CORS**: Enabled for haus25.live domains

## Health & Service Information

### Get Service Health

```http theme={"dark"}
GET /health
```

### Get Curation Scopes

```http theme={"dark"}
GET /scopes
```

## Planner Scope

### Generate Event Plan

```http theme={"dark"}
POST /plan
```

**Response**: Initial AI-generated optimization plan stored on-chain.

### Iterate Plan Aspect

```http theme={"dark"}
POST /iterate
```

**Request Body**:

```json theme={"dark"}
{
  "eventId": "string",
  "aspect": "title | description | pricing | schedule | banner",
  "feedback": "string",
  "userAddress": "0x..."
}
```

**Response**: Refined aspect based on user feedback.

```json theme={"dark"}
{
  "success": true,
  "aspect": "title",
  "result": {
    "title": "Refined title based on feedback",
    "reasoning": "Applied user suggestions"
  },
  "iterationNumber": 2,
  "message": "Aspect refined and stored on-chain"
}
```

### Accept Final Plan

```http theme={"dark"}
POST /accept
```

**Request Body**:

```json theme={"dark"}
{
  "eventId": "string",
  "selectedIterations": {
    "title": 1,
    "description": 2,
    "pricing": 1,
    "schedule": 1,
    "banner": 1
  },
  "userAddress": "0x..."
}
```

**Response**: Plan acceptance with blockchain transaction details.

```json theme={"dark"}
{
  "success": true,
  "message": "Plan accepted and finalized on-chain",
  "eventId": "string",
  "metadataURI": "ipfs://...",
  "transactionHash": "0x...",
  "proxyAddress": "0x...",
  "selectedIterations": {
    "title": 1,
    "description": 2,
    "pricing": 1,
    "schedule": 1,
    "banner": 1
  }
}
```

## Promoter Scope (Content Strategy)

### Generate Content Plan

```http theme={"dark"}
POST /content/plan
```

**Response**: Comprehensive promotional content strategy.

### Iterate Content Aspect

```http theme={"dark"}
POST /content/iterate
```

**Request Body**:

```json theme={"dark"}
{
  "eventId": "string",
  "aspect": "strategy | x | eventbrite | facebook | instagram",
  "feedback": "string",
  "userAddress": "0x..."
}
```

**Response**: Refined promotional content based on feedback.

```json theme={"dark"}
{
  "success": true,
  "aspect": "x",
  "result": {
    "posts": ["Updated Twitter content"],
    "reasoning": "Incorporated engagement feedback"
  },
  "iterationNumber": 2,
  "message": "Content aspect refined and stored on-chain"
}
```

### Accept Content Plan

```http theme={"dark"}
POST /content/accept
```

**Request Body**:

```json theme={"dark"}
{
  "eventId": "string",
  "selectedIterations": {
    "strategy": 1,
    "x": 2,
    "eventbrite": 1,
    "facebook": 1,
    "instagram": 1
  },
  "userAddress": "0x..."
}
```

**Response**: Content plan acceptance with finalization details.

```json theme={"dark"}
{
  "success": true,
  "message": "Promotional content accepted and finalized on-chain",
  "eventId": "string",
  "metadataURI": "ipfs://...",
  "transactionHash": "0x...",
  "proxyAddress": "0x...",
  "selectedIterations": {
    "strategy": 1,
    "x": 2,
    "eventbrite": 1,
    "facebook": 1,
    "instagram": 1
  }
}
```

## Legacy Endpoints (Deprecated)

### Initialize Conversation

```http theme={"dark"}
POST /initialize
```

**Status**: Deprecated in favor of `/plan` endpoint\
**Purpose**: Created interactive curation sessions

### Send Message

```http theme={"dark"}
POST /message
```

**Status**: Deprecated in favor of `/iterate` endpoint\
**Purpose**: Interactive conversation with agents

### Get Conversation

```http theme={"dark"}
GET /conversation/:id
GET /conversation/:eventId/:userAddress
```

**Status**: Legacy support for existing conversations\
**Purpose**: Retrieve conversation history and status

### Get Plan

```http theme={"dark"}
GET /plan/:conversationId
```

**Status**: Legacy support for conversation-based plans\
**Purpose**: Retrieve current plan state for conversation

### Batch Curation

```http theme={"dark"}
POST /curate
```

**Status**: Legacy single-request processing\
**Purpose**: Process event with multi-agent system in single call

## Error Responses

All endpoints return consistent error format:

```json theme={"dark"}
{
  "error": "Error description",
  "details": "Specific error message",
  "received": {
    "field1": "value1",
    "field2": "value2"
  }
}
```

**Common HTTP Status Codes**:

* `200`: Success
* `400`: Bad Request (missing fields, validation errors)
* `404`: Not Found (conversation, event not found)
* `500`: Internal Server Error

## Rate Limiting

No explicit rate limiting implemented. Service handles concurrent requests through Express.js middleware and agent coordination patterns.
