{
  "openapi": "3.1.0",
  "info": {
    "title": "inlinr API",
    "version": "1",
    "description": "The HTTP API the inlinr plugins use, and the public package API. Errors answer JSON `{ \"error\": \"<code>\", \"message\"?: \"…\" }`. The guide with every detail: https://inlinr.com/docs/api"
  },
  "externalDocs": {
    "url": "https://inlinr.com/docs/api"
  },
  "servers": [
    {
      "url": "https://inlinr.com"
    }
  ],
  "tags": [
    {
      "name": "Sign-in",
      "description": "A device token, with the OAuth device flow."
    },
    {
      "name": "Tracking",
      "description": "What the plugins send."
    },
    {
      "name": "Your account",
      "description": "Your time, entries and upgrades."
    },
    {
      "name": "Packages",
      "description": "npm releases, upgrade digests and dependency checks. No token needed; one raises the rate limit."
    }
  ],
  "components": {
    "securitySchemes": {
      "deviceToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "A device token, in_d_…, from the device sign-in. One per editor per machine."
      }
    }
  },
  "security": [
    {
      "deviceToken": []
    }
  ],
  "paths": {
    "/api/auth/device": {
      "post": {
        "operationId": "startDeviceSignIn",
        "summary": "Start a device sign-in",
        "tags": [
          "Sign-in"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_name": {
                    "description": "Your plugin's name, shown on the device in Settings. Cut to 100 characters.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "editor": {
                    "description": "The editor the device runs in, e.g. vscode or cursor. Cut to 100 characters.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "platform": {
                    "description": "The operating system the editor runs on, e.g. linux. Cut to 100 characters.",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "example": {
                "client_name": "my-plugin",
                "editor": "vscode",
                "platform": "linux"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "device_code": {
                      "description": "Send it back when polling. Never show it to the user.",
                      "type": "string"
                    },
                    "user_code": {
                      "description": "The code the user sees on the approval page.",
                      "type": "string"
                    },
                    "verification_uri": {
                      "description": "The page where the user approves the device.",
                      "type": "string"
                    },
                    "verification_uri_complete": {
                      "description": "The same page with the code filled in. Open this one.",
                      "type": "string"
                    },
                    "expires_in": {
                      "description": "Seconds before the code expires.",
                      "type": "integer"
                    },
                    "interval": {
                      "description": "Seconds to wait between two polls.",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "device_code": "…",
                  "user_code": "ABCD-1234",
                  "verification_uri": "https://inlinr.com/activate",
                  "verification_uri_complete": "https://inlinr.com/activate?code=ABCD-1234",
                  "expires_in": 900,
                  "interval": 5
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/device/token": {
      "post": {
        "operationId": "pollDeviceToken",
        "summary": "Poll for the device token",
        "tags": [
          "Sign-in"
        ],
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "device_code": {
                    "description": "The device_code from the first call.",
                    "type": "string"
                  }
                },
                "required": [
                  "device_code"
                ]
              },
              "example": {
                "device_code": "…"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Approved. Keep the token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "description": "The device token. Store it and send it as a Bearer token.",
                      "type": "string"
                    },
                    "device": {
                      "description": "The device just created, as listed in Settings.",
                      "type": "object"
                    },
                    "user": {
                      "description": "The account the device belongs to.",
                      "type": "object"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "access_token": "in_d_…",
                  "device": {},
                  "user": {}
                }
              }
            }
          },
          "400": {
            "description": "Not approved yet. Poll again after interval seconds. The code expired. Start again.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "description": "Why there is no token yet.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "example1": {
                    "summary": "Not approved yet. Poll again after interval seconds.",
                    "value": {
                      "error": "authorization_pending"
                    }
                  },
                  "example2": {
                    "summary": "The code expired. Start again.",
                    "value": {
                      "error": "expired_token"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/device/revoke": {
      "post": {
        "operationId": "revokeDevice",
        "summary": "Sign this device out",
        "tags": [
          "Sign-in"
        ],
        "responses": {
          "200": {
            "description": "The device is signed out."
          }
        }
      }
    },
    "/api/v1/heartbeats": {
      "post": {
        "operationId": "sendHeartbeats",
        "summary": "Send heartbeats",
        "tags": [
          "Tracking"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "minItems": 1,
                "maxItems": 1000,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "entity": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000,
                      "description": "File path relative to the repository, a URL or an app name."
                    },
                    "type": {
                      "default": "file",
                      "description": "What entity names.",
                      "type": "string",
                      "enum": [
                        "file",
                        "app",
                        "domain"
                      ]
                    },
                    "time": {
                      "type": "number",
                      "exclusiveMinimum": 0,
                      "description": "Unix seconds; fractions are kept."
                    },
                    "project_git_remote": {
                      "description": "The repository's remote. The project is created or found from it. This or project is required.",
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 500
                    },
                    "project": {
                      "description": "Instead of project_git_remote, for a folder with no git remote: its name, matched to a project by name. Only the last path segment is kept.",
                      "type": "string",
                      "maxLength": 500
                    },
                    "branch": {
                      "description": "The git branch.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 256
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "language": {
                      "description": "The file's language. Inferred from the file name if left out.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "category": {
                      "description": "What the time was spent on. Other values are kept and shown as sent.",
                      "knownValues": [
                        "coding",
                        "debugging",
                        "building",
                        "code-reviewing",
                        "writing-tests",
                        "ai-coding"
                      ],
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "is_write": {
                      "default": false,
                      "description": "true when the beat comes from a save.",
                      "type": "boolean"
                    },
                    "lineno": {
                      "description": "The cursor's line. Accepted, not stored.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "cursorpos": {
                      "description": "The cursor's offset in the file. Accepted, not stored.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lines": {
                      "description": "The file's total line count. Accepted, not stored.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_tool": {
                      "description": "The assistant that wrote the change. Send it only when you saw the assistant edit; any other value is rejected.",
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "copilot",
                            "cursor",
                            "claude-code",
                            "codeium",
                            "windsurf",
                            "aider",
                            "codex",
                            "gemini-cli",
                            "opencode"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_line_changes": {
                      "description": "Net line delta, from older plugins. Not documented.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "human_line_changes": {
                      "description": "Net line delta, from older plugins. Not documented.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lines_added": {
                      "description": "Lines added since the previous beat. 0 means none; leave it out if you do not count.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lines_deleted": {
                      "description": "Lines removed since the previous beat. 0 means none; leave it out if you do not count.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_lines_added": {
                      "description": "The part of lines_added the assistant wrote.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_lines_deleted": {
                      "description": "The part of lines_deleted the assistant wrote.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_session": {
                      "description": "One assistant conversation, as the assistant names it.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_model": {
                      "description": "The model the assistant used.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_input_tokens": {
                      "description": "Input tokens, without the cached ones.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000000000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_output_tokens": {
                      "description": "Output tokens.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000000000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_cache_read_tokens": {
                      "description": "Context read back from the prompt cache. Separate because it bills at a different rate.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000000000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "ai_cache_write_tokens": {
                      "description": "Context written to the prompt cache. Separate because it bills at a different rate.",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 1000000000000
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "editor": {
                      "description": "The host editor, e.g. vscode, cursor, windsurf.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 64
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "editor_version": {
                      "description": "The host editor's version. In a VS Code fork, the VS Code build it embeds.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 32
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "plugin": {
                      "description": "Your client, user-agent style: name/version.",
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 128
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "entity",
                    "time"
                  ]
                }
              },
              "example": [
                {
                  "entity": "src/routes/index.tsx",
                  "time": 1734523920.123,
                  "project_git_remote": "git@github.com:you/app.git",
                  "type": "file",
                  "category": "coding",
                  "language": "typescript",
                  "branch": "main",
                  "is_write": false,
                  "lineno": 42,
                  "cursorpos": 1023,
                  "lines": 180,
                  "lines_added": 14,
                  "lines_deleted": 2,
                  "ai_tool": "copilot",
                  "ai_lines_added": 12,
                  "ai_lines_deleted": 1,
                  "editor": "vscode",
                  "editor_version": "1.99.3",
                  "plugin": "my-plugin/0.1.0"
                }
              ]
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "responses": {
                      "description": "One [result, status] pair per beat, in the order sent, so you can drop exactly what was stored.",
                      "type": "array"
                    },
                    "accepted": {
                      "description": "How many were stored.",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "responses": [
                    [
                      {
                        "id": "hb_0"
                      },
                      201
                    ]
                  ],
                  "accepted": 1
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/commits": {
      "post": {
        "operationId": "sendCommits",
        "summary": "Send commit line counts",
        "tags": [
          "Tracking"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "project_git_remote": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "The repository's remote, as in heartbeats."
                  },
                  "commits": {
                    "minItems": 1,
                    "maxItems": 1000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "sha": {
                          "type": "string",
                          "minLength": 7,
                          "maxLength": 64,
                          "description": "The commit hash, full or abbreviated."
                        },
                        "committed_at": {
                          "description": "ISO 8601. The time of the request if left out.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "files_changed": {
                          "default": 0,
                          "description": "From git log --numstat.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100000
                        },
                        "insertions": {
                          "default": 0,
                          "description": "Lines added.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000000
                        },
                        "deletions": {
                          "default": 0,
                          "description": "Lines removed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10000000
                        }
                      },
                      "required": [
                        "sha"
                      ]
                    },
                    "description": "The commits to record or fill in."
                  }
                },
                "required": [
                  "project_git_remote",
                  "commits"
                ]
              },
              "example": {
                "project_git_remote": "git@github.com:you/app.git",
                "commits": [
                  {
                    "sha": "9f2c1ab",
                    "committed_at": "2026-10-14T09:12:00Z",
                    "files_changed": 3,
                    "insertions": 120,
                    "deletions": 14
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "New commits stored, and commits already known with no line counts filled in. No heartbeat has created this project yet. Not worth retrying.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "accepted": {
                      "description": "How many were stored.",
                      "type": "integer"
                    },
                    "backfilled": {
                      "description": "Commits already known without line counts, now filled in.",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": true
                },
                "examples": {
                  "example1": {
                    "summary": "New commits stored, and commits already known with no line counts filled in.",
                    "value": {
                      "accepted": 1,
                      "backfilled": 0
                    }
                  },
                  "example2": {
                    "summary": "No heartbeat has created this project yet. Not worth retrying.",
                    "value": {
                      "accepted": 0,
                      "reason": "unknown project"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/today": {
      "get": {
        "operationId": "getToday",
        "summary": "Time tracked today",
        "tags": [
          "Your account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "seconds": {
                      "description": "Time tracked today in the user's time zone, counted like the dashboard.",
                      "type": "integer"
                    },
                    "beats": {
                      "description": "Heartbeats received today.",
                      "type": "integer"
                    },
                    "top_projects": {
                      "description": "The three projects with the most time today, as { name, seconds }.",
                      "type": "array"
                    },
                    "by_category": {
                      "description": "Today's time per category, as { name, seconds }.",
                      "type": "array"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "seconds": 12840,
                  "beats": 214,
                  "top_projects": [],
                  "by_category": []
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/summary": {
      "get": {
        "operationId": "getSummary",
        "summary": "A period's totals",
        "tags": [
          "Your account"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "A dashboard preset (today, 7d, month…) or custom with from and to.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "With period=custom: an ISO date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "With period=custom: an ISO date.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "query",
            "required": false,
            "description": "A project's name, or its git remote when two share the name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "400 ambiguous_project when two of your projects share the name; use the git remote.",
            "content": {
              "application/json": {
                "example": {
                  "period": "Last 7 days",
                  "since": "2026-10-09T00:00:00.000Z",
                  "until": null,
                  "project": "acme-app",
                  "total_seconds": 44940,
                  "by_project": [
                    {
                      "name": "acme-app",
                      "seconds": 44940,
                      "ai_seconds": 9120
                    }
                  ],
                  "by_language": [
                    {
                      "name": "typescript",
                      "seconds": 38100
                    }
                  ],
                  "ai": {
                    "seconds": 9120,
                    "sessions": 14,
                    "lines_added": 1820,
                    "total_lines_added": 2410,
                    "tokens": {},
                    "cost_usd": 18.42,
                    "unpriced_tokens": 0,
                    "prices_verified_on": "2026-10-01",
                    "by_tool": []
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/entries": {
      "post": {
        "operationId": "logEntry",
        "summary": "Log a manual entry",
        "tags": [
          "Your account"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "minutes": {
                    "description": "How long it took.",
                    "type": "number"
                  },
                  "type": {
                    "description": "What kind of work it was.",
                    "type": "string",
                    "enum": [
                      "meeting",
                      "call",
                      "review",
                      "doc",
                      "research",
                      "testing",
                      "email",
                      "custom"
                    ],
                    "default": "custom"
                  },
                  "label": {
                    "description": "What it was, shown in the entry list.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "started_at": {
                    "description": "ISO 8601, not in the future. Ends now if left out.",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "billable": {
                    "description": "Whether it counts toward what is left to bill.",
                    "type": "boolean",
                    "default": false
                  },
                  "project": {
                    "description": "A project's name, or its git remote when two share the name. No project if left out.",
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "minutes"
                ]
              },
              "example": {
                "minutes": 45,
                "type": "meeting",
                "label": "Kick-off",
                "billable": true,
                "project": "acme-app"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "400 invalid_entry names the field that is wrong.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "description": "hb_ followed by the beat's position in the request.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "id": "cm…",
                  "type": "meeting",
                  "label": "Kick-off",
                  "started_at": "2026-10-15T09:15:00.000Z",
                  "minutes": 45,
                  "billable": true,
                  "project": "acme-app"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me/upgrades": {
      "get": {
        "operationId": "getUpgrades",
        "summary": "What to upgrade in your followed projects",
        "tags": [
          "Your account"
        ],
        "parameters": [
          {
            "name": "project",
            "in": "query",
            "required": false,
            "description": "One project's name or git remote; all followed projects if left out.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dev",
            "in": "query",
            "required": false,
            "description": "0 leaves dev dependencies out.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 200, 50 by default.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "dev=0 leaves dev dependencies out; limit goes up to 200 (50 by default).",
            "content": {
              "application/json": {
                "example": {
                  "project": "acme-app",
                  "followed_projects": 3,
                  "counts": {
                    "security": 1,
                    "deprecated": 0,
                    "major": 2,
                    "minor": 14
                  },
                  "truncated": false,
                  "upgrades": [
                    {
                      "name": "next",
                      "reason": "security",
                      "from": "15.0.3",
                      "to": "15.0.7",
                      "latest": "16.4.3",
                      "dev": false,
                      "deprecated": null,
                      "advisories": [
                        {
                          "id": "GHSA-…",
                          "summary": "…",
                          "severity": "HIGH"
                        }
                      ],
                      "unfixed": false,
                      "projects": [
                        {
                          "name": "acme-app",
                          "range": "^15.0.3",
                          "kind": "prod"
                        }
                      ],
                      "notes_url": "https://inlinr.com/packages/next/upgrade/15.0.3-15.0.7"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packages/{name}/releases": {
      "get": {
        "operationId": "getPackageReleases",
        "summary": "An npm package's releases",
        "tags": [
          "Packages"
        ],
        "security": [
          {},
          {
            "deviceToken": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "An npm package name. A scoped name goes in as it is: @tanstack/react-router.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 100.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "An ISO date: releases after it.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "prereleases",
            "in": "query",
            "required": false,
            "description": "1 keeps release candidates and other prereleases.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "description": "The npm package name.",
                      "type": "string"
                    },
                    "latest_version": {
                      "description": "What npm tags latest.",
                      "type": "string"
                    },
                    "deprecated": {
                      "description": "The maintainers' deprecation message, or null.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "history_refreshed_at": {
                      "description": "When releases, notes and advisories were last read from npm, GitHub and OSV.",
                      "type": "string"
                    },
                    "history_stale": {
                      "description": "true when that was more than a day ago. It is being read again: ask later for fresher data.",
                      "type": "boolean"
                    },
                    "releases": {
                      "description": "In releases: newest first, stable only unless prereleases=1. In an upgrade: how many stable releases it spans."
                    },
                    "advisories": {
                      "description": "OSV advisories against the package.",
                      "type": "array"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "name": "react",
                  "latest_version": "19.2.0",
                  "deprecated": null,
                  "license": "MIT",
                  "repository_url": "https://github.com/facebook/react",
                  "homepage": "https://react.dev/",
                  "history_refreshed_at": "2026-10-15T08:00:00.000Z",
                  "history_stale": false,
                  "releases": [
                    {
                      "version": "19.2.0",
                      "published_at": "2026-10-01T16:00:00.000Z",
                      "prerelease": false,
                      "notes": "## 19.2.0 …",
                      "notes_url": "https://github.com/facebook/react/releases/tag/v19.2.0"
                    }
                  ],
                  "advisories": []
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/packages/{name}/upgrade": {
      "get": {
        "operationId": "getPackageUpgrade",
        "summary": "What changes between two versions",
        "tags": [
          "Packages"
        ],
        "security": [
          {},
          {
            "deviceToken": []
          }
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "An npm package name. A scoped name goes in as it is: @tanstack/react-router.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "The version you are on.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "The version to move to; the latest release if left out.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "description": "The npm package name.",
                      "type": "string"
                    },
                    "latest_version": {
                      "description": "What npm tags latest.",
                      "type": "string"
                    },
                    "history_refreshed_at": {
                      "description": "When releases, notes and advisories were last read from npm, GitHub and OSV.",
                      "type": "string"
                    },
                    "history_stale": {
                      "description": "true when that was more than a day ago. It is being read again: ask later for fresher data.",
                      "type": "boolean"
                    },
                    "releases": {
                      "description": "In releases: newest first, stable only unless prereleases=1. In an upgrade: how many stable releases it spans."
                    },
                    "releases_with_notes": {
                      "description": "How many of those releases had a note to read. The digest is only as complete as this.",
                      "type": "integer"
                    },
                    "releases_without_notes": {
                      "description": "The versions with no note.",
                      "type": "array"
                    },
                    "prereleases_read": {
                      "description": "Pre-releases of a major the upgrade crosses (4.0.0-beta.2) whose breaking changes or deprecations the lists include: a major's own note often only points to its betas.",
                      "type": "array"
                    },
                    "majors_without_breaking": {
                      "description": "Major releases (x.0.0) whose note lists no breaking change or deprecation: check their guide before trusting an empty list.",
                      "type": "array"
                    },
                    "breaking": {
                      "description": "Lines of the notes that read as breaking changes.",
                      "type": "array"
                    },
                    "fixed_advisories": {
                      "description": "Advisories that affect from and not to.",
                      "type": "array"
                    },
                    "remaining_advisories": {
                      "description": "Advisories that still affect to.",
                      "type": "array"
                    },
                    "guides": {
                      "description": "Migration guides and codemods, known or linked.",
                      "type": "array"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "name": "react",
                  "latest_version": "19.2.0",
                  "history_refreshed_at": "2026-10-15T08:00:00.000Z",
                  "history_stale": false,
                  "from": "18.3.1",
                  "to": "19.0.0",
                  "releases": 1,
                  "releases_with_notes": 1,
                  "releases_without_notes": [],
                  "prereleases_read": [],
                  "majors_without_breaking": [],
                  "breaking": [
                    {
                      "version": "19.0.0",
                      "markdown": "Remove propTypes …"
                    }
                  ],
                  "deprecations": [],
                  "fixed_advisories": [],
                  "remaining_advisories": [],
                  "security": [],
                  "features": [
                    {
                      "version": "19.0.0",
                      "markdown": "Actions …"
                    }
                  ],
                  "fixes": [],
                  "other": [],
                  "internal_lines": 0,
                  "guides": [
                    {
                      "label": "React 19 upgrade guide",
                      "url": "https://react.dev/…"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "description": "Why there is no token yet.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "error": "not_found",
                  "message": "No published release 19.9.9 after 18.3.1."
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/advisories": {
      "get": {
        "operationId": "getRecentAdvisories",
        "summary": "Advisories newly seen on widely used packages",
        "tags": [
          "Packages"
        ],
        "security": [
          {},
          {
            "deviceToken": []
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "An ISO date: advisories first seen after it. A week ago by default, 90 days at most.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "CRITICAL, HIGH, MODERATE or LOW, separated by commas. CRITICAL,HIGH by default.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_downloads",
            "in": "query",
            "required": false,
            "description": "The package's weekly npm downloads, at least. 1000000 by default.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Up to 50, 20 by default.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "since defaults to a week ago (90 days at most); limit goes up to 50, 20 by default.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "advisories": {
                      "description": "OSV advisories against the package.",
                      "type": "array"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "since": "2026-11-13T12:00:00.000Z",
                  "advisories": [
                    {
                      "id": "GHSA-xxxx-xxxx-xxxx",
                      "package": "example-lib",
                      "weekly_downloads": 4200000,
                      "severity": "HIGH",
                      "summary": "Prototype pollution in merge()",
                      "fixed_in": "2.4.1",
                      "published_at": "2026-11-18T09:00:00.000Z",
                      "first_seen_at": "2026-11-18T10:37:00.000Z",
                      "url": "https://inlinr.com/advisories/GHSA-xxxx-xxxx-xxxx",
                      "source_url": "https://github.com/advisories/GHSA-xxxx-xxxx-xxxx"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/check": {
      "post": {
        "operationId": "checkDependencies",
        "summary": "Check a package.json's dependencies",
        "tags": [
          "Packages"
        ],
        "security": [
          {},
          {
            "deviceToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "packages": {
                    "description": "Names, or name@range. Instead, send { package_json } or a package.json's dependency blocks.",
                    "type": "array"
                  }
                }
              },
              "example": {
                "packages": [
                  "react@^18.2.0",
                  "request"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "With a device token, each dependency also lists your_projects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "dependencies": {
                      "description": "One row per dependency, the most urgent first.",
                      "type": "array"
                    }
                  },
                  "additionalProperties": true
                },
                "example": {
                  "summary": {
                    "checked": 2,
                    "with_advisories": 1,
                    "deprecated": 1,
                    "majors_behind": 1,
                    "behind": 1,
                    "unchecked": 0
                  },
                  "truncated": 0,
                  "dependencies": [
                    {
                      "name": "request",
                      "range": null,
                      "kind": "prod",
                      "resolved_name": null,
                      "status": "checked",
                      "unchecked_reason": null,
                      "latest": "2.88.2",
                      "gap": null,
                      "floor": null,
                      "deprecated": "request has been deprecated …",
                      "advisories": [
                        {
                          "id": "GHSA-p8p7-x288-28g6",
                          "summary": "…",
                          "severity": "moderate",
                          "url": "…",
                          "fixed_in": null
                        }
                      ],
                      "advisories_unknown": false
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}