{
  "openapi": "3.1.0",
  "info": {
    "title": "Habits links",
    "version": "1.0.0",
    "description": "Habits is a free habit tracker with streaks. It has no data API on purpose: habits are personal, so nothing can read or change anyone's habits. The one thing an assistant can do is send a link that opens Habits with a new habit filled in. The person checks it and taps Add habit; nothing is saved until they do. Guide: https://habits-free.openapps.xyz/llms.txt"
  },
  "servers": [{ "url": "https://habits-free.openapps.xyz" }],
  "paths": {
    "/new": {
      "get": {
        "operationId": "openNewHabitLink",
        "summary": "Open Habits with a new habit filled in",
        "description": "Returns the app page, which opens the add sheet with these values. Choose how often with at most one of days, times or every; the default is every day.",
        "parameters": [
          { "name": "name", "in": "query", "required": true, "schema": { "type": "string", "maxLength": 60 }, "description": "The habit's name, like Meditate." },
          { "name": "type", "in": "query", "schema": { "type": "string", "enum": ["check", "count", "avoid"], "default": "check" }, "description": "check is done or not. count is done when the day's count reaches goal. avoid counts days without it; a check-in is a slip." },
          { "name": "goal", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 10000 }, "description": "The daily number for a counted habit. Setting it without type makes the habit a counted one." },
          { "name": "unit", "in": "query", "schema": { "type": "string", "maxLength": 20 }, "description": "What is counted, like glasses or pages." },
          { "name": "days", "in": "query", "schema": { "type": "string" }, "description": "Chosen weekdays: a list from mon,tue,wed,thu,fri,sat,sun, or the words weekdays or weekends." },
          { "name": "times", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 7 }, "description": "A number of times a week, on any days." },
          { "name": "every", "in": "query", "schema": { "type": "integer", "minimum": 2, "maximum": 60 }, "description": "Every n days: at least once in each n-day stretch." }
        ],
        "responses": {
          "200": { "description": "The Habits app, with the add sheet open and filled in.", "content": { "text/html": { "schema": { "type": "string" } } } }
        }
      }
    }
  }
}
