Aetoskia Blog API 0.2.0
This is the **Aetoskia Blog API**, part of the personal service network.
Provides:
- Article CRUD operations
- User comment management
- Tag-based search
Fully async, secured via JWT auth.
Servers
| Description | URL |
|---|---|
| Production server | https://api.aetoskia.com/blogs |
| Staging environment for internal testing | http://server-pi:9001 |
| Local development server | http://localhost:8000 |
blog
POST /authors
Create Author
Request body
Schema of the request body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar"
}
},
"type": "object",
"required": [
"username"
],
"title": "Author",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar"
}
},
"type": "object",
"required": [
"username"
],
"title": "Author",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
GET /authors
List Authors
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
limit |
query | integer | 10 | No | |
skip |
query | integer | 0 | No |
Response 200 OK
Response 422 Unprocessable Content
GET /authors/{author_id}
Get Author
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
author_id |
path | string | No |
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar"
}
},
"type": "object",
"required": [
"username"
],
"title": "Author",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
PUT /authors/{author_id}
Update Author
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
author_id |
path | string | No |
Request body
Schema of the request body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar"
}
},
"type": "object",
"required": [
"username"
],
"title": "Author",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"name": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Name"
},
"avatar": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Avatar"
}
},
"type": "object",
"required": [
"username"
],
"title": "Author",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
DELETE /authors/{author_id}
Delete Author
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
author_id |
path | string | No |
Response 200 OK
Response 422 Unprocessable Content
POST /articles
Create Article
Request body
Schema of the request body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"img": {
"type": "string",
"title": "Img"
},
"tag": {
"type": "string",
"title": "Tag"
},
"title": {
"type": "string",
"title": "Title"
},
"description": {
"type": "string",
"title": "Description"
},
"content": {
"type": "string",
"title": "Content"
},
"authors": {
"items": {
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
"type": "array",
"title": "Authors"
}
},
"type": "object",
"required": [
"img",
"tag",
"title",
"description",
"content",
"authors"
],
"title": "Article",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"img": {
"type": "string",
"title": "Img"
},
"tag": {
"type": "string",
"title": "Tag"
},
"title": {
"type": "string",
"title": "Title"
},
"description": {
"type": "string",
"title": "Description"
},
"content": {
"type": "string",
"title": "Content"
},
"authors": {
"items": {
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
"type": "array",
"title": "Authors"
}
},
"type": "object",
"required": [
"img",
"tag",
"title",
"description",
"content",
"authors"
],
"title": "Article",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
GET /articles
List Articles
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
limit |
query | integer | 10 | No | |
skip |
query | integer | 0 | No |
Response 200 OK
Response 422 Unprocessable Content
GET /articles/{article_id}
Get Article
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
article_id |
path | string | No |
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"img": {
"type": "string",
"title": "Img"
},
"tag": {
"type": "string",
"title": "Tag"
},
"title": {
"type": "string",
"title": "Title"
},
"description": {
"type": "string",
"title": "Description"
},
"content": {
"type": "string",
"title": "Content"
},
"authors": {
"items": {
"$ref": "#/components/schemas/Author"
},
"type": "array",
"title": "Authors"
}
},
"type": "object",
"required": [
"img",
"tag",
"title",
"description",
"content",
"authors"
],
"title": "ArticleResponse",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
PUT /articles/{article_id}
Update Article
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
article_id |
path | string | No |
Request body
Schema of the request body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"img": {
"type": "string",
"title": "Img"
},
"tag": {
"type": "string",
"title": "Tag"
},
"title": {
"type": "string",
"title": "Title"
},
"description": {
"type": "string",
"title": "Description"
},
"content": {
"type": "string",
"title": "Content"
},
"authors": {
"items": {
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
"type": "array",
"title": "Authors"
}
},
"type": "object",
"required": [
"img",
"tag",
"title",
"description",
"content",
"authors"
],
"title": "Article",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"img": {
"type": "string",
"title": "Img"
},
"tag": {
"type": "string",
"title": "Tag"
},
"title": {
"type": "string",
"title": "Title"
},
"description": {
"type": "string",
"title": "Description"
},
"content": {
"type": "string",
"title": "Content"
},
"authors": {
"items": {
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
"type": "array",
"title": "Authors"
}
},
"type": "object",
"required": [
"img",
"tag",
"title",
"description",
"content",
"authors"
],
"title": "Article",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
DELETE /articles/{article_id}
Delete Article
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
article_id |
path | string | No |
Response 200 OK
Response 422 Unprocessable Content
auth
POST /auth/register
Create User
Request body
Schema of the request body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"password": {
"type": "string",
"minLength": 6,
"title": "Password"
}
},
"type": "object",
"required": [
"username",
"password"
],
"title": "UserAuth",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
}
},
"type": "object",
"required": [
"username"
],
"title": "PublicUser",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 422 Unprocessable Content
POST /auth/login
Login
Request body
Schema of the request body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
},
"password": {
"type": "string",
"minLength": 6,
"title": "Password"
}
},
"type": "object",
"required": [
"username",
"password"
],
"title": "UserAuth",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
Response 200 OK
Response 422 Unprocessable Content
GET /auth/me
Read Users Me
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No |
Response 200 OK
Schema of the response body
{
"properties": {
"_id": {
"anyOf": [
{
"type": "string",
"examples": [
"507f1f77bcf86cd799439011"
]
},
{
"type": "null"
}
],
"title": "Id"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"updated_at": {
"type": "string",
"format": "date-time",
"title": "Updated At"
},
"username": {
"type": "string",
"maxLength": 50,
"minLength": 3,
"title": "Username"
},
"email": {
"anyOf": [
{
"type": "string",
"format": "email"
},
{
"type": "null"
}
],
"title": "Email"
},
"is_active": {
"type": "boolean",
"title": "Is Active",
"default": true
}
},
"type": "object",
"required": [
"username"
],
"title": "PublicUser",
"example": {
"created_at": "2024-01-01T00:00:00",
"updated_at": "2024-01-01T00:00:00"
}
}
POST /auth/logout
Logout
Response 200 OK
Endpoints
GET /health
Health Check
Response 200 OK
Schemas
Article
| Name | Type |
|---|---|
_id |
|
authors |
Array<string> |
content |
string |
created_at |
string(date-time) |
description |
string |
img |
string |
tag |
string |
title |
string |
updated_at |
string(date-time) |
ArticleResponse
| Name | Type |
|---|---|
_id |
|
authors |
Array<Author> |
content |
string |
created_at |
string(date-time) |
description |
string |
img |
string |
tag |
string |
title |
string |
updated_at |
string(date-time) |
Author
| Name | Type |
|---|---|
_id |
|
avatar |
|
created_at |
string(date-time) |
email |
|
is_active |
boolean |
name |
|
updated_at |
string(date-time) |
username |
string |
HTTPValidationError
| Name | Type |
|---|---|
detail |
Array<ValidationError> |
PublicUser
| Name | Type |
|---|---|
_id |
|
created_at |
string(date-time) |
email |
|
is_active |
boolean |
updated_at |
string(date-time) |
username |
string |
UserAuth
| Name | Type |
|---|---|
_id |
|
created_at |
string(date-time) |
email |
|
is_active |
boolean |
password |
string |
updated_at |
string(date-time) |
username |
string |
ValidationError
| Name | Type |
|---|---|
loc |
Array<> |
msg |
string |
type |
string |
Security schemes
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |
Tags
| Name | Description |
|---|---|
| Articles | Operations for creating, reading, updating, and deleting blog articles. |
| Users | User management and authentication endpoints. |