### Get projects Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves a list of projects for the authenticated user. ```APIDOC ## GET /api/v1/authenticated/projects ### Description Get projects ### Method GET ### Endpoint /api/v1/authenticated/projects ``` -------------------------------- ### Get user projects Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves a list of projects for a specific user. ```APIDOC ## GET /api/v1/users/{username}/projects ### Description Get user projects ### Method GET ### Endpoint /api/v1/users/{username}/projects ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user ``` -------------------------------- ### Get daily leaderboard Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the daily leaderboard. ```APIDOC ## GET /api/v1/leaderboard/daily ### Description Get daily leaderboard ### Method GET ### Endpoint /api/v1/leaderboard/daily ``` -------------------------------- ### Get WakaTime-compatible summary Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves a summary of coding activity compatible with WakaTime. ```APIDOC ## GET /api/summary ### Description Get WakaTime-compatible summary ### Method GET ### Endpoint /api/summary ``` -------------------------------- ### Get weekly leaderboard Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the weekly leaderboard. ```APIDOC ## GET /api/v1/leaderboard/weekly ### Description Get weekly leaderboard ### Method GET ### Endpoint /api/v1/leaderboard/weekly ``` -------------------------------- ### Get timeline Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the admin timeline data. ```APIDOC ## GET /api/admin/v1/timeline ### Description Get timeline ### Method GET ### Endpoint /api/admin/v1/timeline ``` -------------------------------- ### Get admin user projects Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves project information for users from an administrative perspective. ```APIDOC ## GET /api/admin/v1/user/projects ### Description Get admin user projects ### Method GET ### Endpoint /api/admin/v1/user/projects ``` -------------------------------- ### Get streak Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the coding streak for the authenticated user. ```APIDOC ## GET /api/v1/authenticated/streak ### Description Get streak ### Method GET ### Endpoint /api/v1/authenticated/streak ``` -------------------------------- ### Get detailed project stats Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves detailed project statistics for a user. ```APIDOC ## GET /api/v1/users/{username}/projects/details ### Description Get detailed project stats ### Method GET ### Endpoint /api/v1/users/{username}/projects/details ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user ``` -------------------------------- ### Get hours Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves coding hours for the authenticated user. ```APIDOC ## GET /api/v1/authenticated/hours ### Description Get hours ### Method GET ### Endpoint /api/v1/authenticated/hours ``` -------------------------------- ### Get daily leaderboard (Alias) Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the daily leaderboard (aliased endpoint). ```APIDOC ## GET /api/v1/leaderboard ### Description Get daily leaderboard (Alias) ### Method GET ### Endpoint /api/v1/leaderboard ``` -------------------------------- ### Get users by machine Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves users associated with a specific machine. ```APIDOC ## GET /api/admin/v1/user/get_users_by_machine ### Description Get users by machine ### Method GET ### Endpoint /api/admin/v1/user/get_users_by_machine ``` -------------------------------- ### Get API keys Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the API keys associated with the authenticated user. ```APIDOC ## GET /api/v1/authenticated/api_keys ### Description Get API keys ### Method GET ### Endpoint /api/v1/authenticated/api_keys ``` -------------------------------- ### Get daily leaderboard Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Leaderboard is currently being generated. Requires Bearer token and API Key authentication. ```APIDOC ## GET /api/v1/leaderboard/daily ### Description Leaderboard is currently being generated. ### Method GET ### Endpoint /api/v1/leaderboard/daily ### Response #### Success Response (200) - **period** (string) - Example: daily - **start_date** (string) - Example: '2024-03-20' (format: date) - **date_range** (string) - Example: Wed, Mar 20, 2024 - **generated_at** (string) - Example: '2024-03-20T10:00:00Z' (format: date_time) - **entries** (array of LeaderboardEntry) - Description #### Response Example { "period": "daily", "start_date": "2024-03-20", "date_range": "Wed, Mar 20, 2024", "generated_at": "2024-03-20T10:00:00Z", "entries": [ { "user_id": 1, "username": "Alice", "score": 1500 } ] } ``` -------------------------------- ### Get User Projects Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves a list of projects a user has recently coded on, typically within the last 30 days. ```APIDOC ## GET /api/v1/users/{username}/projects ### Description Get a list of projects a user has coded on recently (last 30 days). ### Method GET ### Endpoint /api/v1/users/{username}/projects ### Parameters #### Path Parameters - **username** (string) - Required - Username ### Response #### Success Response (200) - **projects** (array) - Array of strings, where each string is a project name. Example: hackatime #### Response Example { "projects": [ "hackatime", "another-project" ] } ``` -------------------------------- ### Get user info batch Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves information for multiple users in a batch. ```APIDOC ## GET /api/admin/v1/user/info_batch ### Description Get user info batch ### Method GET ### Endpoint /api/admin/v1/user/info_batch ``` -------------------------------- ### Get heartbeats Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves heartbeats for the current user. ```APIDOC ## GET /api/v1/my/heartbeats ### Description Get heartbeats ### Method GET ### Endpoint /api/v1/my/heartbeats ``` -------------------------------- ### Get heartbeat values Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves heartbeat values for users. ```APIDOC ## GET /api/admin/v1/user/heartbeat_values ### Description Get heartbeat values ### Method GET ### Endpoint /api/admin/v1/user/heartbeat_values ``` -------------------------------- ### Get user info (Admin) Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves user information from an administrative perspective. ```APIDOC ## GET /api/admin/v1/user/info ### Description Get user info (Admin) ### Method GET ### Endpoint /api/admin/v1/user/info ``` -------------------------------- ### Get User Info Batch Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves detailed information for multiple users based on their IDs. ```APIDOC ## GET /api/admin/v1/user/info_batch ### Description Get info for multiple users. ### Method GET ### Endpoint /api/admin/v1/user/info_batch ### Parameters #### Query Parameters - **ids** (array of integers) - Required - User IDs ### Responses #### Success Response (200) - **users** (array) - An array of user objects. - **id** (integer) - **username** (string) - **display_name** (string) - **slack_uid** (string, nullable) - **slack_username** (string, nullable) - **github_username** (string, nullable) - **timezone** (string, nullable) - **country_code** (string, nullable) - **trust_level** (string) - **avatar_url** (string, nullable) - **slack_avatar_url** (string, nullable) - **github_avatar_url** (string, nullable) ``` -------------------------------- ### Get user by email Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves user information using their email address. ```APIDOC ## POST /api/admin/v1/user/get_user_by_email ### Description Get user by email ### Method POST ### Endpoint /api/admin/v1/user/get_user_by_email ``` -------------------------------- ### Get daily leaderboard (Alias) Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Alias for /api/v1/leaderboard/daily. Returns the daily leaderboard. Requires Bearer token and API Key authentication. ```APIDOC ## GET /api/v1/leaderboard ### Description Alias for /api/v1/leaderboard/daily. Returns the daily leaderboard. ### Method GET ### Endpoint /api/v1/leaderboard ### Response #### Success Response (200) - **period** (string) - Example: daily - **start_date** (string) - Example: '2024-03-20' (format: date) - **date_range** (string) - Example: Wed, Mar 20, 2024 - **generated_at** (string) - Example: '2024-03-20T10:00:00Z' (format: date_time) - **entries** (array of LeaderboardEntry) - Description #### Response Example { "period": "daily", "start_date": "2024-03-20", "date_range": "Wed, Mar 20, 2024", "generated_at": "2024-03-20T10:00:00Z", "entries": [ { "user_id": 1, "username": "Alice", "score": 1500 } ] } ``` -------------------------------- ### Get Daily Leaderboard Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves the daily leaderboard, showing coding activity for the current day. Requires STATS_API_KEY. ```APIDOC ## GET /api/v1/leaderboard/daily ### Description Returns the daily leaderboard of coding time (today). Requires STATS_API_KEY. ### Method GET ### Endpoint /api/v1/leaderboard/daily ### Responses #### Success Response (200) - **period** (string) - Example: daily - **start_date** (string) - Example: '2024-03-20' - **date_range** (string) - Example: Wed, Mar 20, 2024 - **generated_at** (string) - Example: '2024-03-20T10:00:00Z' - **entries** (array) - List of leaderboard entries. #### Response Example { "example": { "period": "daily", "start_date": "2024-03-20", "date_range": "Wed, Mar 20, 2024", "generated_at": "2024-03-20T10:00:00Z", "entries": [ { "user_id": "user123", "username": "coding_ninja", "rank": 1, "duration_seconds": 28800, "actual_duration": "8:00:00" } ] } } #### Error Response (503) - **description**: service unavailable - **content**: application/json schema referencing Error ``` -------------------------------- ### Get specific project stats Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves statistics for a specific project of a user. ```APIDOC ## GET /api/v1/users/{username}/project/{project_name} ### Description Get specific project stats ### Method GET ### Endpoint /api/v1/users/{username}/project/{project_name} ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user - **project_name** (string) - Required - The name of the project ``` -------------------------------- ### Get current user info Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves information about the currently authenticated user. ```APIDOC ## GET /api/v1/authenticated/me ### Description Get current user info ### Method GET ### Endpoint /api/v1/authenticated/me ``` -------------------------------- ### Get status bar today Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves today's status bar information for a user. ```APIDOC ## GET /api/hackatime/v1/users/{id}/statusbar/today ### Description Get status bar today ### Method GET ### Endpoint /api/hackatime/v1/users/{id}/statusbar/today ### Parameters #### Path Parameters - **id** (string) - Required - The user ID for whom to get status bar info ``` -------------------------------- ### Get banned users Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves a list of banned users. ```APIDOC ## GET /api/admin/v1/banned_users ### Description Get banned users ### Method GET ### Endpoint /api/admin/v1/banned_users ``` -------------------------------- ### Get user stats Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves coding statistics for a specific user. ```APIDOC ## GET /api/v1/users/{username}/stats ### Description Get user stats ### Method GET ### Endpoint /api/v1/users/{username}/stats ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user ``` -------------------------------- ### Get Users by IP Address Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Finds all users associated with a specific IP address. ```APIDOC ## GET /api/admin/v1/user/get_users_by_ip ### Description Find users associated with an IP address. ### Method GET ### Endpoint /api/admin/v1/user/get_users_by_ip ### Parameters #### Query Parameters - **ip** (string) - Required - IP Address ### Response #### Success Response (200) - **users** (array of objects) - **user_id** (integer) - **ip_address** (string) - **machine** (string, nullable) - **user_agent** (string, nullable) ``` -------------------------------- ### Get admin user stats Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves administrative statistics for users. ```APIDOC ## GET /api/admin/v1/user/stats ### Description Get admin user stats ### Method GET ### Endpoint /api/admin/v1/user/stats ``` -------------------------------- ### Get User Projects Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves a list of projects associated with the authenticated user, with options to filter by archived status, specific project names, and time ranges. ```APIDOC ## GET /api/v1/authenticated/projects ### Description Returns a list of projects associated with the authenticated user. ### Method GET ### Endpoint /api/v1/authenticated/projects ### Parameters #### Query Parameters - **include_archived** (boolean) - Optional - Include archived projects (true/false) - **projects** (string) - Optional - Comma-separated list of project names - **since** (string) - Optional - Project discovery start time (ISO 8601) - **until** (string) - Optional - Project discovery end time (ISO 8601) - **until_date** (string) - Optional - Alias for until - **start** (string) - Optional - Stats start time (ISO 8601) - **end** (string) - Optional - Stats end time (ISO 8601) - **start_date** (string) - Optional - Alias for start - **end_date** (string) - Optional - Alias for end ### Request Example None ### Response #### Success Response (200) - **projects** (array) - A list of project objects, each containing: - **name** (string) - The name of the project. - **total_seconds** (number) - The total time spent on the project in seconds. - **most_recent_heartbeat** (string) - The timestamp of the most recent activity on the project (ISO 8601), can be null. - **languages** (array) - A list of programming languages used in the project. - **archived** (boolean) - Indicates if the project is archived. #### Response Example ```json { "projects": [ { "name": "hackatime", "total_seconds": 3600.0, "most_recent_heartbeat": "2023-10-27T10:00:00Z", "languages": ["Python", "JavaScript"], "archived": false } ] } ``` ``` -------------------------------- ### Get Users by Machine ID Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves a list of users associated with a given machine ID. ```APIDOC ## GET /api/admin/v1/user/get_users_by_machine ### Description Find users associated with a machine ID. ### Method GET ### Endpoint /api/admin/v1/user/get_users_by_machine ### Parameters #### Query Parameters - **machine** (string) - Required - Machine ID ### Response #### Success Response (200) - **users** (array of objects) - **user_id** (integer) - **machine** (string) ``` -------------------------------- ### Get users by IP Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves users associated with a specific IP address. ```APIDOC ## GET /api/admin/v1/user/get_users_by_ip ### Description Get users by IP ### Method GET ### Endpoint /api/admin/v1/user/get_users_by_ip ``` -------------------------------- ### Get user heartbeats (Admin) Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves user heartbeats from an administrative perspective. ```APIDOC ## GET /api/admin/v1/user/heartbeats ### Description Get user heartbeats (Admin) ### Method GET ### Endpoint /api/admin/v1/user/heartbeats ``` -------------------------------- ### Get Heartbeat Import Status Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the status of a heartbeat import. ```APIDOC ## GET /my/heartbeat_imports/{id} ### Description Get Heartbeat Import Status ### Method GET ### Endpoint /my/heartbeat_imports/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the heartbeat import ``` -------------------------------- ### Get leaderboard users for timeline Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves leaderboard users for the admin timeline. ```APIDOC ## GET /api/admin/v1/timeline/leaderboard_users ### Description Get leaderboard users for timeline ### Method GET ### Endpoint /api/admin/v1/timeline/leaderboard_users ``` -------------------------------- ### Get Weekly Leaderboard Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves the weekly leaderboard, showing coding activity for the last 7 days. Requires STATS_API_KEY. ```APIDOC ## GET /api/v1/leaderboard/weekly ### Description Returns the weekly leaderboard of coding time (last 7 days). Requires STATS_API_KEY. ### Method GET ### Endpoint /api/v1/leaderboard/weekly ### Responses #### Success Response (200) - **period** (string) - Example: last_7_days - **start_date** (string) - Example: '2024-03-13' - **date_range** (string) - Example: Mar 13 - Mar 20, 2024 - **generated_at** (string) - Example: '2024-03-20T10:00:00Z' - **entries** (array) - List of leaderboard entries. #### Response Example { "example": { "period": "last_7_days", "start_date": "2024-03-13", "date_range": "Mar 13 - Mar 20, 2024", "generated_at": "2024-03-20T10:00:00Z", "entries": [ { "user_id": "user123", "username": "coding_ninja", "rank": 1, "duration_seconds": 28800, "actual_duration": "8:00:00" } ] } } ``` -------------------------------- ### Get API Keys Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves the API keys associated with the authenticated user. This endpoint returns sensitive information and should be used with caution. ```APIDOC ## GET /api/v1/authenticated/api_keys ### Description Returns the API keys for the authenticated user. Warning: This returns sensitive information. ### Method GET ### Endpoint /api/v1/authenticated/api_keys ### Parameters None ### Request Example None ### Response #### Success Response (200) - **token** (string) - The API key token. #### Response Example ```json { "token": "waka_..." } ``` ``` -------------------------------- ### Get User by Email Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves user information by their email address. This endpoint is secured and requires administrator privileges. ```APIDOC ## POST /api/admin/v1/user/get_user_by_email ### Description Lookup user by email (POST). ### Method POST ### Endpoint /api/admin/v1/user/get_user_by_email ### Request Body - **email** (string) - Required - The email address of the user to look up. ### Request Example { "email": "user@example.com" } ### Response #### Success Response (200) - **user_id** (integer) - The unique identifier of the user. #### Response Example { "user_id": 12345 } ``` -------------------------------- ### Get user trust logs Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves trust logs for a specific user. ```APIDOC ## GET /api/admin/v1/user/trust_logs ### Description Get user trust logs ### Method GET ### Endpoint /api/admin/v1/user/trust_logs ``` -------------------------------- ### Get User Info (Admin) Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves detailed information about a specific user. Requires superadmin or admin privileges. ```APIDOC ## GET /api/admin/v1/user/info ### Description Get detailed info about a user. Requires superadmin/admin privileges. ### Method GET ### Endpoint /api/admin/v1/user/info ### Parameters #### Query Parameters - **user_id** (string) - Required - User ID ### Responses #### Success Response (200) - **user** (object) - The user object. - **id** (integer) ``` -------------------------------- ### Get total coding time (Admin Only) Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the total coding time, accessible only by administrators. ```APIDOC ## GET /api/v1/stats ### Description Get total coding time (Admin Only) ### Method GET ### Endpoint /api/v1/stats ``` -------------------------------- ### Get Status Bar Today Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Returns the total coding time for today. Used by editor plugins to display the status bar widget. ```APIDOC ## GET /api/hackatime/v1/users/{id}/statusbar/today ### Description Returns the total coding time for today. Used by editor plugins to display the status bar widget. ### Method GET ### Endpoint /api/hackatime/v1/users/{id}/statusbar/today ### Parameters #### Path Parameters - **id** (string) - Required - User ID or "current". ### Response #### Success Response (200) - **data** (object) - **grand_total** (object) - **text** (string) - Formatted string representing the total time. - **total_seconds** (number) - Total seconds coded today. ``` -------------------------------- ### Get Specific Project Stats Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves detailed statistics for a specific project associated with a user. Allows filtering by time range. ```APIDOC ## GET /api/v1/users/{username}/project/{project_name} ### Description Get detailed stats for a specific project. ### Method GET ### Endpoint /api/v1/users/{username}/project/{project_name} ### Parameters #### Path Parameters - **username** (string) - Required - Username - **project_name** (string) - Required - Project Name #### Query Parameters - **start** (string) - Optional - Stats start time (ISO 8601) - **end** (string) - Optional - Stats end time (ISO 8601) - **start_date** (string) - Optional - Start date (ISO 8601) for stats calculation - **end_date** (string) - Optional - End date (ISO 8601) for stats calculation ``` -------------------------------- ### Get Admin User Stats Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Fetches detailed statistics for a specific user from an administrative perspective. ```APIDOC ## GET /api/admin/v1/user/stats ### Description Get detailed stats for a user (Admin view). ### Method GET ### Endpoint /api/admin/v1/user/stats ### Parameters #### Query Parameters - **user_id** (string) - Required - User ID ### Response #### Success Response (200) - **user_id** (integer) - **username** (string) - **date** (string, format: date_time) - **timezone** (string, nullable) - **total_heartbeats** (integer) - **total_duration** (number) - **heartbeats** (array of objects) - **id** (integer) - **time** (string) - **created_at** (string, format: date_time) - **project** (string) ``` -------------------------------- ### Get Current User Info Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves detailed information about the currently authenticated user, including their ID, emails, and trust factor. ```APIDOC ## GET /api/v1/authenticated/me ### Description Returns detailed information about the currently authenticated user. ### Method GET ### Endpoint /api/v1/authenticated/me ### Authentication - Bearer token - ApiKeyAuth ### Response #### Success Response (200) - **id** (integer) - **emails** (array) - items: string - **slack_id** (string) - nullable - **github_username** (string) - nullable - **trust_factor** (object) - properties: `trust_level` (string), `trust_value` (integer) #### Response Example { "id": 1, "emails": ["user@example.com"], "slack_id": "U12345", "github_username": "username", "trust_factor": { "trust_level": "high", "trust_value": 100 } } #### Error Response (401) Description: unauthorized ``` -------------------------------- ### Get Authenticated User Hours Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Returns the total coding hours for the authenticated user within a specified date range. ```APIDOC ## GET /api/v1/authenticated/hours ### Description Returns the total coding hours for the authenticated user. ### Method GET ### Endpoint /api/v1/authenticated/hours ### Authentication - Bearer token - ApiKeyAuth ### Parameters #### Query Parameters - **start_date** (string) - Optional - Start date (YYYY-MM-DD) - **end_date** (string) - Optional - End date (YYYY-MM-DD) ### Response #### Success Response (200) - **start_date** (string) - format: date, example: '2024-03-13' - **end_date** (string) - format: date, example: '2024-03-20' - **total_seconds** (number) - example: 153000.0 #### Response Example { "start_date": "2024-03-13", "end_date": "2024-03-20", "total_seconds": 153000.0 } #### Error Response (401) Description: unauthorized ``` -------------------------------- ### Get last 7 days stats Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves coding statistics for the last 7 days for the current user. ```APIDOC ## GET /api/hackatime/v1/users/current/stats/last_7_days ### Description Get last 7 days stats ### Method GET ### Endpoint /api/hackatime/v1/users/current/stats/last_7_days ``` -------------------------------- ### Get Timeline Events Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves timeline events, including coding activity and commits for specified users. This endpoint is useful for monitoring user engagement and contributions. ```APIDOC ## GET /api/admin/v1/timeline ### Description Get timeline events including coding activity and commits for selected users. ### Method GET ### Endpoint /api/admin/v1/timeline ### Parameters #### Query Parameters - **date** (string) - Optional - Date for the timeline (YYYY-MM-DD) - **user_ids** (string) - Optional - Comma-separated list of User IDs - **slack_uids** (string) - Optional - Comma-separated list of Slack User IDs ### Response #### Success Response (200) - **date** (string) - The date of the timeline events. - **next_date** (string) - The date of the next available timeline. - **prev_date** (string) - The date of the previous available timeline. - **users** (array) - An array of user objects, each containing their coding activity. - **user** (object) - User details. - **id** (integer) - The unique identifier for the user. - **username** (string) - The username of the user. - **display_name** (string) - The display name of the user (nullable). - **slack_username** (string) - The Slack username of the user (nullable). - **github_username** (string) - The GitHub username of the user (nullable). - **timezone** (string) - The timezone of the user (nullable). - **avatar_url** (string) - The URL of the user's avatar (nullable). - **spans** (array) - An array of coding activity spans for the user. - **start_time** (number) - The start time of the coding span (float). - **end_time** (number) - The end time of the coding span (float). - **duration** (number) - The duration of the coding span (float). - **files_edited** (array) - A list of files edited during the span. - **projects_edited_details** (array) - Details of projects edited. - **name** (string) - The name of the project. - **repo_url** (string) - The URL of the project repository (nullable). - **editors** (array) - A list of editors used during the span. - **languages** (array) - A list of programming languages used during the span. - **total_coded_time** (number) - The total time coded during the period (float). - **commit_markers** (array) - An array of commit markers. - **user_id** (integer) - The ID of the user who made the commit. - **timestamp** (number) - The timestamp of the commit (float). - **additions** (integer) - The number of additions in the commit (nullable). - **deletions** (integer) - The number of deletions in the commit (nullable). ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get User Heartbeats (Admin) Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves raw heartbeat data for a specific user. This endpoint is intended for administrative use and requires authentication. ```APIDOC ## GET /api/admin/v1/user/heartbeats ### Description Get raw heartbeats for a user. ### Method GET ### Endpoint /api/admin/v1/user/heartbeats ### Parameters #### Query Parameters - **user_id** (string) - Required - User ID - **date** (string) - Required - Date (YYYY-MM-DD) ### Response #### Success Response (200) - **user_id** (integer) - Description - **heartbeats** (array) - List of heartbeat objects. - **id** (integer) - Description - **time** (number) - Description - **lineno** (integer) - Optional - Description - **cursorpos** (integer) - Optional - Description - **is_write** (boolean) - Optional - Description - **project** (string) - Optional - Description - **language** (string) - Optional - Description - **entity** (string) - Optional - Description - **branch** (string) - Optional - Description - **category** (string) - Optional - Description - **editor** (string) - Optional - Description - **machine** (string) - Optional - Description - **user_agent** (string) - Optional - Description - **ip_address** (string) - Optional - Description - **lines** (integer) - Optional - Description - **source_type** (string) - Optional - Description - **total_count** (integer) - Description - **has_more** (boolean) - Description #### Error Response (404) user not found #### Error Response (422) invalid date filter ``` -------------------------------- ### List Project Repo Mappings Source: https://hackatime.hackclub.com/api-docs/index.html Lists project repository mappings for the current user. ```APIDOC ## GET /my/projects ### Description List Project Repo Mappings ### Method GET ### Endpoint /my/projects ``` -------------------------------- ### Get Last 7 Days Stats Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves coding statistics for the last 7 days. This endpoint is designed to be compatible with some WakaTime dashboards. ```APIDOC ## GET /api/hackatime/v1/users/current/stats/last_7_days ### Description Returns coding statistics for the last 7 days. Used by some WakaTime dashboards. ### Method GET ### Endpoint /api/hackatime/v1/users/current/stats/last_7_days ### Parameters #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **data** (object) - Contains the user's statistics for the last 7 days. - **username** (string) - The username of the user. - **user_id** (string) - The unique identifier for the user. - **start** (string, format: date_time) - The start date and time of the statistics range. - **end** (string, format: date_time) - The end date and time of the statistics range. - **status** (string) - The current status related to coding activity. - **total_seconds** (number) - Total seconds coded in the period. - **daily_average** (number) - Average seconds coded per day. - **days_including_holidays** (integer) - Number of days in the range, including holidays. - **range** (string) - The statistical range (e.g., "7 days"). - **human_readable_range** (string) - A human-readable representation of the range. - **human_readable_total** (string) - A human-readable representation of the total time coded. - **human_readable_daily_average** (string) - A human-readable representation of the daily average. - **is_coding_activity_visible** (boolean) - Indicates if coding activity is visible. - **is_other_usage_visible** (boolean) - Indicates if other usage is visible. - **editors** (array) - List of editors used and their statistics. - **name** (string) - The name of the editor. - **total_seconds** (integer) - Total seconds spent using the editor. - **percent** (number) - Percentage of time spent using this editor. - **digital** (string) - Digital representation of time (e.g., "2h 30m"). - **text** (string) - Human-readable text representation of time. - **hours** (integer) - Hours component of the time. - **minutes** (integer) - Minutes component of the time. - **seconds** (integer) - Seconds component of the time. - **languages** (array) - List of programming languages used and their statistics. - **name** (string) - The name of the language. - **total_seconds** (integer) - Total seconds spent using this language. - **percent** (number) - Percentage of time spent using this language. - **digital** (string) - Digital representation of time. - **text** (string) - Human-readable text representation of time. - **hours** (integer) - Hours component of the time. - **minutes** (integer) - Minutes component of the time. - **seconds** (integer) - Seconds component of the time. - **machines** (array) - List of machines used and their statistics. - **name** (string) - The name of the machine. - **total_seconds** (integer) - Total seconds spent on this machine. - **percent** (number) - Percentage of time spent on this machine. - **digital** (string) - Digital representation of time. - **text** (string) - Human-readable text representation of time. #### Response Example ```json { "data": { "username": "example_user", "user_id": "user-123", "start": "2023-10-27T00:00:00Z", "end": "2023-11-03T00:00:00Z", "status": "active", "total_seconds": 7200, "daily_average": 1028, "days_including_holidays": 7, "range": "7 days", "human_readable_range": "Last 7 days", "human_readable_total": "2 hours", "human_readable_daily_average": "17 minutes", "is_coding_activity_visible": true, "is_other_usage_visible": false, "editors": [ { "name": "VS Code", "total_seconds": 3600, "percent": 50, "digital": "1h 0m", "text": "1 hour", "hours": 1, "minutes": 0, "seconds": 0 } ], "languages": [ { "name": "Python", "total_seconds": 5400, "percent": 75, "digital": "1h 30m", "text": "1 hour 30 minutes", "hours": 1, "minutes": 30, "seconds": 0 } ], "machines": [ { "name": "MyLaptop", "total_seconds": 7200, "percent": 100, "digital": "2h 0m", "text": "2 hours" } ] } } ``` #### Error Response (401) - **description**: unauthorized ``` -------------------------------- ### Get User Statistics Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves statistics for a specific user, including project contributions, languages used, and more. Supports filtering by date range and interval. ```APIDOC ## GET /api/v1/users ### Description Retrieves statistics for a specific user. ### Method GET ### Endpoint /api/v1/users ### Parameters #### Query Parameters - **start_date** (string) - Optional - Start date (YYYY-MM-DD) - **end_date** (string) - Optional - End date (YYYY-MM-DD) - **interval** (string) - Optional - Interval (e.g. today, yesterday, week, month) - **project** (string) - Optional - Project name (optional) - **user_id** (string) - Required - User identifier (slack_uid, username, hca_id, or numeric ID) - **user** (string) - Optional - Deprecated: use user_id instead. Kept for backwards compatibility. ### Response #### Success Response (200) - **user_id** (string) - nullable - **from** (string) - date_time - **to** (string) - date_time - **projects** (array) - items: object with properties `key` (string) and `total` (number) - **languages** (array) - items: object with properties `key` (string) and `total` (number) - **editors** (object) - nullable - **operating_systems** (object) - nullable - **machines** (object) - nullable - **categories** (object) - nullable - **branches** (object) - nullable - **entities** (object) - nullable - **labels** (object) - nullable #### Response Example { "user_id": "12345", "from": "2024-03-13T00:00:00Z", "to": "2024-03-20T23:59:59Z", "projects": [ { "key": "project-a", "total": 10000 } ], "languages": [ { "key": "python", "total": 5000 } ], "editors": {}, "operating_systems": {}, "machines": {}, "categories": {}, "branches": {}, "entities": {}, "labels": {} } #### Error Response (400) Description: invalid date range #### Error Response (404) Description: user not found #### Error Response (403) Description: user has disabled public stats ``` -------------------------------- ### Create Admin API Key Source: https://hackatime.hackclub.com/api-docs/index.html Creates a new Admin API Key. ```APIDOC ## POST /api/admin/v1/admin_api_keys ### Description Create Admin API Key ### Method POST ### Endpoint /api/admin/v1/admin_api_keys ``` -------------------------------- ### List Permissions Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Lists system permissions. Requires superadmin privileges. Supports searching. ```APIDOC ## GET /api/admin/v1/permissions ### Description List system permissions. Requires superadmin privileges. ### Method GET ### Endpoint /api/admin/v1/permissions #### Query Parameters - **search** (string) - Search query ### Response #### Success Response (200) - **users** (array) ``` -------------------------------- ### Get total coding time (Admin Only) Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Returns the total coding time for all users, optionally filtered by user or date range. Requires admin privileges via STATS_API_KEY. ```APIDOC ## GET /api/v1/stats ### Description Returns the total coding time for all users, optionally filtered by user or date range. Requires admin privileges via STATS_API_KEY. ### Method GET ### Endpoint /api/v1/stats ### Parameters #### Query Parameters - **start_date** (string) - Optional - Start date (YYYY-MM-DD), defaults to 10 years ago - **end_date** (string) - Optional - End date (YYYY-MM-DD), defaults to today - **username** (string) - Optional - Filter by username (optional) - **user_email** (string) - Optional - Filter by user email (optional) ### Response #### Success Response (200) - **integer** - successful with invalid credentials ``` -------------------------------- ### Get Heartbeats Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Retrieves a list of heartbeats for the authenticated user within a specified time range. This endpoint provides the raw data stream. ```APIDOC ## GET /api/v1/my/heartbeats ### Description Returns a list of heartbeats for the authenticated user within a time range. This is the raw data stream. ### Method GET ### Endpoint /api/v1/my/heartbeats ### Parameters #### Query Parameters - **start_time** (string) - Start time (ISO 8601) - **end_time** (string) - End time (ISO 8601) ### Responses #### Success Response (200) - Description: successful #### Error Response (401) - Description: unauthorized ``` -------------------------------- ### Create Heartbeat Import Source: https://hackatime.hackclub.com/api-docs/index.html Creates a heartbeat import for the current user. ```APIDOC ## POST /my/heartbeat_imports ### Description Create Heartbeat Import ### Method POST ### Endpoint /my/heartbeat_imports ``` -------------------------------- ### Create user from Slack OAuth Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Callback endpoint for Slack OAuth to create or update a user. Requires a Slack OAuth Token. ```APIDOC ## POST /api/v1/external/slack/oauth ### Description Callback endpoint for Slack OAuth to create or update a user. ### Method POST ### Endpoint /api/v1/external/slack/oauth ### Parameters #### Request Body - **token** (string) - Required - Slack OAuth Token ### Request Example { "token": "your_slack_oauth_token" } ### Response #### Success Response (200) - **user_id** (integer) - Description - **username** (string) - Description - **email** (string) - Description (nullable) #### Response Example { "user_id": 123, "username": "testuser", "email": "test@example.com" } #### Error Response (400) - Description: bad request ``` -------------------------------- ### Create user from Slack OAuth Source: https://hackatime.hackclub.com/api-docs/index.html Creates a new user account using Slack OAuth. ```APIDOC ## POST /api/v1/external/slack/oauth ### Description Create user from Slack OAuth ### Method POST ### Endpoint /api/v1/external/slack/oauth ``` -------------------------------- ### Get trust factor Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the trust factor for a specific user. ```APIDOC ## GET /api/v1/users/{username}/trust_factor ### Description Get trust factor ### Method GET ### Endpoint /api/v1/users/{username}/trust_factor ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user ``` -------------------------------- ### Get heartbeat spans Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves heartbeat spans for a specific user. ```APIDOC ## GET /api/v1/users/{username}/heartbeats/spans ### Description Get heartbeat spans ### Method GET ### Endpoint /api/v1/users/{username}/heartbeats/spans ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user ``` -------------------------------- ### List Permissions Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves a list of all permissions. ```APIDOC ## GET /api/admin/v1/permissions ### Description List Permissions ### Method GET ### Endpoint /api/admin/v1/permissions ``` -------------------------------- ### Get most recent heartbeat Source: https://hackatime.hackclub.com/api-docs/index.html Retrieves the most recent heartbeat for the current user. ```APIDOC ## GET /api/v1/my/heartbeats/most_recent ### Description Get most recent heartbeat ### Method GET ### Endpoint /api/v1/my/heartbeats/most_recent ``` -------------------------------- ### List machines used by multiple users Source: https://hackatime.hackclub.com/api-docs/index.html Lists machines that are used by more than one user. ```APIDOC ## GET /api/admin/v1/heartbeats/shared_machines ### Description List machines used by multiple users ### Method GET ### Endpoint /api/admin/v1/heartbeats/shared_machines ``` -------------------------------- ### Create Heartbeat Import Source: https://hackatime.hackclub.com/api-docs/v1/swagger.yaml Initiates a heartbeat import process, supporting development uploads or one-time remote dump imports. ```APIDOC ## POST /my/heartbeat_imports ### Description Start a development upload import or a one-time remote dump import. ### Method POST ### Endpoint /my/heartbeat_imports ### Request Body - **Remote import provider preset** (string) - Enum: ["wakatime_dump", "hackatime_v1_dump"] ### Responses #### Success Response (202 Accepted) - Description: accepted ```