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."]
  }
}
GET /todo

List your todo items. Optionally filter by status and paginate results.

Query Parameters

Parameter Type Required Description
status string No Filter by status: todo in_progress done
page integer No Page number (default: 1)
per_page integer No Items per page (default: 15, max: 100)

Example Request

curl "https://emaeglin.dev/api/v1/todo?status=todo&per_page=20"   -H "X-API-Key: your-api-key-here"

Responses

200 OK
{
  "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",
      "updated_at": "2026-03-26T07:13:00+00:00"
    }
  ],
  "meta": {
    "current_page": 1,
    "per_page": 15,
    "total": 42,
    "last_page": 3
  }
}
PATCH /todo/{id}/status

Update the status of a todo item. Returns 404 if the item does not exist or does not belong to your account.

Request Body

Field Type Required Description
status string Yes todo in_progress done

Example Request

curl -X PATCH https://emaeglin.dev/api/v1/todo/42/status   -H "Content-Type: application/json"   -H "X-API-Key: your-api-key-here"   -d '{"status": "in_progress"}'

Responses

200 OK
{
  "data": {
    "id": 42,
    "title": "Buy groceries",
    "description": "Milk, eggs, bread",
    "status": "in_progress",
    "priority": "high",
    "position": 1,
    "created_at": "2026-03-26T07:13:00+00:00",
    "updated_at": "2026-08-12T10:00:00+00:00"
  }
}
404 Not Found
{
  "message": "Todo not found."
}
422 Validation Error
{
  "message": "The status field is required.",
  "errors": {
    "status": ["The status field is required."]
  }
}