Skip to main content

Base URL

The API is available at the following base URLs:
http://localhost:3001/api

Response Format

All API responses are returned in JSON format with the following structure:

Success Response

{
  "success": true,
  "data": {
    // Response data
  }
}

Error Response

{
  "error": "Error message describing what went wrong"
}

HTTP Status Codes

The API uses standard HTTP status codes:
Status CodeDescription
200OK - Request succeeded
400Bad Request - Invalid parameters or validation failed
401Unauthorized - Authentication required or token invalid
404Not Found - Resource does not exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server-side error

Rate Limiting

To prevent abuse, the API implements rate limiting on certain endpoints:

Login Endpoint

5 requests per 15 minutesApplies to /api/auth/login

Contact Endpoint

5 requests per hourApplies to /api/contact
When rate limited, the API returns:
{
  "error": "Too many requests. Try again later."
}

Request Format

All POST and PUT requests must include the Content-Type: application/json header and send data as JSON in the request body.
curl -X POST https://andreruperto.dev/api/projects \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"title": "New Project"}'

Security

  • All write operations (POST, PUT, DELETE) require JWT authentication
  • Passwords are never stored in plain text
  • Email inputs are validated and sanitized to prevent XSS attacks
  • Rate limiting prevents brute force attacks

Next Steps

Authentication

Learn how to authenticate and get a JWT token

Projects API

Manage portfolio projects via CRUD operations

Contact API

Send messages through the contact form

Build docs developers (and LLMs) love