Skip to main content
POST
/
api
/
management
/
authors
Create Author
curl --request POST \
  --url https://api.example.com/api/management/authors \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>"
}
'
{
  "success": true,
  "timestamp": "<string>",
  "data": {
    "id": 123,
    "name": "<string>"
  }
}

Endpoint

POST /api/management/authors

Authentication

Requires authentication with a valid Bearer token and ADMIN role.

Request Body

name
string
required
Full name of the authorValidation:
  • Cannot be blank
  • Minimum length: 2 characters
  • Maximum length: 100 characters

Response

success
boolean
required
Indicates if the request was successful
timestamp
string
required
ISO 8601 timestamp of the response
data
object
required
Created author details
id
long
required
Unique identifier for the newly created author
name
string
required
Full name of the author

Example Request

curl -X POST "http://localhost:8080/api/management/authors" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "George Orwell"
  }'

Example Response

{
  "success": true,
  "timestamp": "2026-03-03T10:00:00Z",
  "data": {
    "id": 1,
    "name": "George Orwell"
  }
}

Error Responses

400 Bad Request - Validation Error

{
  "success": false,
  "timestamp": "2026-03-03T10:00:00Z",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Author name cannot be blank",
    "validationErrors": [
      {
        "field": "name",
        "message": "Author name cannot be blank"
      }
    ]
  }
}

400 Bad Request - Name Too Short

{
  "success": false,
  "timestamp": "2026-03-03T10:00:00Z",
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Author name must be between 2 and 100 characters",
    "validationErrors": [
      {
        "field": "name",
        "message": "Author name must be between 2 and 100 characters"
      }
    ]
  }
}

401 Unauthorized

{
  "success": false,
  "timestamp": "2026-03-03T10:00:00Z",
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Authentication required"
  }
}

403 Forbidden

{
  "success": false,
  "timestamp": "2026-03-03T10:00:00Z",
  "error": {
    "code": "FORBIDDEN",
    "message": "Access denied. ADMIN role required"
  }
}

Build docs developers (and LLMs) love