Updated Documentation

This commit is contained in:
Michael Ikehi
2025-04-18 20:21:11 +01:00
parent 71ad7b4d26
commit 6d07556b85
3 changed files with 104 additions and 70 deletions
+57 -55
View File
@@ -4,7 +4,7 @@
### Generate Copy
Generates marketing copy based on the provided prompt and optional parameters.
Generates marketing copy based on the provided prompt and parameters.
**Endpoint**: `/generate-copy`
**Method**: POST
@@ -15,52 +15,55 @@ Generates marketing copy based on the provided prompt and optional parameters.
{
"prompt": "Write a social media post for our new product launch",
"content_type": "social_media",
"tone": "professional",
"length": "medium",
"include_cta": true
}
```
**Parameters**:
- `prompt` (string, required): The main instruction for generating content
- `content_type` (string, optional): Type of content to generate (social_media, email, blog, website, etc.)
- `length` (string, optional): Content length (short, medium, long)
- `include_cta` (boolean, optional): Whether to include a call to action
**Response**:
```json
{
"status": "success",
"content": "Exciting news! Our revolutionary new product has just landed...",
"suggestions": [
"Alternative headline option 1",
"Alternative headline option 2"
],
"content": "Generated marketing content",
"metadata": {
"content_type": "social_media",
"tone": "excited",
"word_count": 85,
"generated_at": "2025-04-17T10:30:45Z"
"timestamp": "2024-01-01T12:00:00Z",
"alignment_score": 0.95
}
}
```
### Get Brand Style Guidelines
### List User Queries
Retrieves the current brand style guidelines.
Retrieves historical user queries with pagination.
**Endpoint**: `/brand-style`
**Method**: GET
**Endpoint**: `/user-queries`
**Method**: GET
**Query Parameters**:
- `page` (optional, default: 1): Page number
- `limit` (optional, default: 10): Items per page
- `content_type` (optional): Filter by content type
**Response**:
```json
{
"brand_name": "Adriana James",
"tone": ["professional", "friendly", "inspiring"],
"voice_characteristics": ["clear", "direct", "empowering"],
"taboo_words": ["cheap", "discount", "bargain"],
"preferred_terms": {
"customers": "clients",
"products": "solutions"
"items": [
{
"prompt": "Write a social media post...",
"parameters": {
"content_type": "social_media",
"tone": "professional",
"length": "medium",
"include_cta": true
},
"timestamp": "2024-01-01T12:00:00Z"
}
],
"pagination": {
"total": 45,
"page": 1,
"limit": 10,
"pages": 5
}
}
```
@@ -76,9 +79,9 @@ Updates the brand style guidelines.
**Request Body**:
```json
{
"tone": ["professional", "friendly", "inspiring", "innovative"],
"tone": ["professional", "friendly", "inspiring"],
"voice_characteristics": ["clear", "direct", "empowering"],
"taboo_words": ["cheap", "discount", "bargain", "basic"],
"taboo_words": ["cheap", "discount", "bargain"],
"preferred_terms": {
"customers": "clients",
"products": "solutions",
@@ -91,7 +94,8 @@ Updates the brand style guidelines.
```json
{
"status": "success",
"message": "Brand style updated successfully"
"message": "Brand style updated successfully",
"timestamp": "2024-01-01T12:00:00Z"
}
```
@@ -107,9 +111,9 @@ Adds new marketing content for AI training.
```json
{
"content_type": "email_campaign",
"content": "Dear valued client, We're thrilled to announce...",
"content": "Dear valued client...",
"metadata": {
"campaign_name": "Spring Launch 2025",
"campaign_name": "Spring Launch 2024",
"performance_metrics": {
"open_rate": 0.42,
"click_rate": 0.15
@@ -123,37 +127,34 @@ Adds new marketing content for AI training.
{
"status": "success",
"message": "Training data added successfully",
"data_id": "12345"
"data_id": "unique-identifier"
}
```
### List Training Data
Retrieves a list of available training data.
Retrieves available training data with pagination.
**Endpoint**: `/training-data`
**Method**: GET
**Method**: GET
**Query Parameters**:
- `page` (optional, default: 1): Page number
- `limit` (optional, default: 10): Items per page
- `content_type` (optional): Filter by content type
- `page` (optional): Page number for pagination
- `limit` (optional): Number of items per page
**Response**:
```json
{
"items": [
{
"id": "12345",
"id": "unique-identifier",
"content_type": "email_campaign",
"preview": "Dear valued client, We're thrilled to announce...",
"added_at": "2025-04-10T14:30:00Z"
},
{
"id": "12346",
"content_type": "social_media",
"preview": "Exciting news! Our revolutionary new product...",
"added_at": "2025-04-11T09:15:00Z"
"preview": "Dear valued client...",
"added_at": "2024-01-01T12:00:00Z",
"performance_metrics": {
"open_rate": 0.42,
"click_rate": 0.15
}
}
],
"pagination": {
@@ -167,19 +168,20 @@ Retrieves a list of available training data.
## Error Handling
All endpoints return standard HTTP status codes:
All endpoints return appropriate HTTP status codes:
- `200 OK`: Request successful
- `400 Bad Request`: Invalid request parameters
- `401 Unauthorized`: Authentication failed
- `404 Not Found`: Resource not found
- `500 Internal Server Error`: Server-side error
- 200: Success
- 400: Bad Request (invalid parameters)
- 401: Unauthorized
- 404: Not Found
- 500: Internal Server Error
Error responses include detailed messages:
Error response format:
```json
{
"status": "error",
"message": "Detailed error message",
"error_code": "ERROR_CODE"
"code": "ERROR_CODE"
}
```