{
    "service": "AI Project Tracker",
    "version": "1.0.0.0",
    "authentication": {
        "type": "api_key",
        "how": "Send the key as JSON/form field \"api_key\" OR as HTTP header \"X-Api-Key\".",
        "note": "The key value is defined in config.php on the server. Ask the owner for it."
    },
    "content_types": [
        "application/json (preferred)",
        "application/x-www-form-urlencoded"
    ],
    "response_shape": {
        "success": "boolean",
        "message": "string",
        "data": "object|null"
    },
    "endpoints": [
        {
            "name": "Create Project",
            "method": "POST",
            "url": "https://projectmanager.claudeaiplugin.com/create-project.php",
            "fields": [
                {
                    "field": "api_key",
                    "type": "string",
                    "required": true,
                    "rule": "Must match the server key (or use header X-Api-Key)."
                },
                {
                    "field": "name",
                    "type": "string",
                    "required": true,
                    "rule": "Unique project name, max 190 chars."
                },
                {
                    "field": "framework",
                    "type": "string",
                    "required": false,
                    "rule": "Tech stack label, max 120 chars. Example: \"WinUI 3 / .NET 8\"."
                },
                {
                    "field": "date_started",
                    "type": "string",
                    "required": false,
                    "rule": "Format Y-m-d. Defaults to today."
                },
                {
                    "field": "notes",
                    "type": "string",
                    "required": false,
                    "rule": "First timeline entry. Defaults to \"Project created.\""
                },
                {
                    "field": "next_action",
                    "type": "string",
                    "required": false,
                    "rule": "What should happen next on this project."
                }
            ],
            "errors": [
                "400 validation",
                "401 bad api key",
                "405 not POST",
                "409 duplicate name (use update endpoint instead)",
                "500 database"
            ]
        },
        {
            "name": "Update Project (append timeline step)",
            "method": "POST",
            "url": "https://projectmanager.claudeaiplugin.com/update-project.php",
            "fields": [
                {
                    "field": "api_key",
                    "type": "string",
                    "required": true,
                    "rule": "Must match the server key (or use header X-Api-Key)."
                },
                {
                    "field": "id",
                    "type": "integer",
                    "required": "one_of:id,name",
                    "rule": "Project id. Alias \"project_id\" also accepted."
                },
                {
                    "field": "name",
                    "type": "string",
                    "required": "one_of:id,name",
                    "rule": "Exact project name - used only when \"id\" is absent."
                },
                {
                    "field": "notes",
                    "type": "string",
                    "required": true,
                    "rule": "Description of the action that was taken. Becomes a timeline entry."
                },
                {
                    "field": "next_action",
                    "type": "string",
                    "required": false,
                    "rule": "The next step to take. Overwrites the project next-action summary."
                },
                {
                    "field": "framework",
                    "type": "string",
                    "required": false,
                    "rule": "If provided, updates the project framework label."
                },
                {
                    "field": "action_date",
                    "type": "string",
                    "required": false,
                    "rule": "Format Y-m-d H:i:s. Defaults to now. Back-dated entries are added to the timeline but never overwrite a newer summary."
                }
            ],
            "errors": [
                "400 validation",
                "401 bad api key",
                "404 project not found",
                "405 not POST",
                "500 database"
            ]
        }
    ],
    "workflow_for_ai": [
        "1. When starting a brand-new project, POST to the create endpoint with name, framework, and next_action.",
        "2. Every time a meaningful step is completed, POST to the update endpoint with notes describing what was done and next_action describing what comes next.",
        "3. If create returns HTTP 409, the project already exists - switch to the update endpoint.",
        "4. Always check that the JSON response has \"success\": true; if false, read \"message\" for the reason."
    ]
}