mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: add api docs (#1965)
This commit is contained in:
84
docs/api/tag.md
Normal file
84
docs/api/tag.md
Normal file
@@ -0,0 +1,84 @@
|
||||
# Tag APIs
|
||||
|
||||
## Create Tag
|
||||
|
||||
```
|
||||
POST /api/v1/tag
|
||||
```
|
||||
|
||||
**Request Body**
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "python"
|
||||
}
|
||||
```
|
||||
|
||||
**Response**
|
||||
|
||||
```
|
||||
"python"
|
||||
```
|
||||
|
||||
**Status Codes**
|
||||
|
||||
- 200: Created
|
||||
- 400: Invalid request
|
||||
- 500: Internal server error
|
||||
|
||||
## Get Tag List
|
||||
|
||||
```
|
||||
GET /api/v1/tag
|
||||
```
|
||||
|
||||
**Response**
|
||||
|
||||
```json
|
||||
["python", "golang", "javascript"]
|
||||
```
|
||||
|
||||
**Status Codes**
|
||||
|
||||
- 200: OK
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
|
||||
## Suggest Tags
|
||||
|
||||
```
|
||||
GET /api/v1/tag/suggestion
|
||||
```
|
||||
|
||||
**Response**
|
||||
|
||||
```json
|
||||
["django", "flask", "numpy"]
|
||||
```
|
||||
|
||||
**Status Codes**
|
||||
|
||||
- 200: OK
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
||||
|
||||
## Delete Tag
|
||||
|
||||
```
|
||||
POST /api/v1/tag/delete
|
||||
```
|
||||
|
||||
**Request Body**
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "outdated_tag"
|
||||
}
|
||||
```
|
||||
|
||||
**Status Codes**
|
||||
|
||||
- 200: Deleted
|
||||
- 400: Invalid request
|
||||
- 401: Unauthorized
|
||||
- 500: Internal server error
|
Reference in New Issue
Block a user