{"record":{"id":"8dc060c461ca68bb","repo":"Leantime/leantime","slug":"invalid-api-key-id","errorCode":null,"errorMessage":"Invalid API key id","messagePattern":"Invalid API key id","errorType":"validation","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"app/Domain/Api/Services/Api.php","lineNumber":158,"sourceCode":"        return $values['id'] ? $values : false;\n    }\n\n    /**\n     * Loads the stored values of an existing API key (user row) and maps them\n     * into the value array used by the API key edit form.\n     *\n     * @param  int  $id  API key (user) id\n     * @return array Mapped value array\n     *\n     * @throws Exception When the id is not a positive integer\n     *\n     * @api\n     */\n    #[RequiresPermission(ApiPermissions::MANAGE, global: true)]\n    public function getApiKeyFormValues(int $id): array\n    {\n        if ($id <= 0) {\n            throw new Exception('Invalid API key id');\n        }\n\n        $row = $this->userRepo->getUser($id);\n\n        return [\n            'firstname' => $row['firstname'],\n            'lastname' => $row['lastname'],\n            'user' => $row['username'],\n            'phone' => $row['phone'],\n            'status' => $row['status'],\n            'role' => $row['role'],\n            'hours' => $row['hours'],\n            'wage' => $row['wage'],\n            'clientId' => $row['clientId'],\n            'source' => $row['source'],\n            'pwReset' => $row['pwReset'],\n        ];\n    }","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Api/Services/Api.php#L140-L176","documentation":"Error \"Invalid API key id\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Api/Services/Api.php:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}