API Documentation.

REST API v1 — Authenticate with your API key from Profile.

Authentication

All API requests require an X-API-Key header with your personal API key.

Header
X-API-Key: your-api-key-here

Note: Find your API key in your Profile settings. Keep it secret — treat it like a password.

Base URL

https://emaeglin.dev/api/v1

Endpoints

POST /todo

Create a new todo item. The task is added with status todo and position is auto-calculated.

Request Headers

Header Required Value
Content-Type Yes application/json
X-API-Key Yes Your API key

Request Body

Field Type Required Description
title string Yes Task title (max 150 characters)
description string No Task description (max 1000 characters)
priority string No high medium low (default: medium)

Example Request

curl -X POST https://emaeglin.dev/api/v1/todo \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-api-key-here" \
  -d '{
    "title": "Buy groceries",
    "description": "Milk, eggs, bread",
    "priority": "high"
  }'

Responses

201 Created
{
  "data": {
    "id": 1,
    "title": "Buy groceries",
    "description": "Milk, eggs, bread",
    "status": "todo",
    "priority": "high",
    "position": 1,
    "created_at": "2026-03-26T07:13:00+00:00"
  }
}
401 Unauthorized
{
  "error": "API key is required."
}
{
  "error": "Invalid API key."
}
422 Validation Error
{
  "message": "The title field is required.",
  "errors": {
    "title": ["The title field is required."]
  }
}