GET /api/readme-history
Retrieves all README files previously generated by the authenticated user, ordered by creation date (newest first).Authentication
This endpoint requires authentication. Include valid Clerk authentication credentials in your request.Response
Array of generated README records
Unique identifier for the README record
Clerk user ID of the user who generated the README
The GitHub repository URL for which the README was generated
The generated README content in Markdown format
ISO 8601 timestamp of when the README was generated
Code examples
Response example
Error responses
Authentication required
Error fetching README history from databaseor
POST /api/readme-history
Saves a generated README to the user’s history. This endpoint is typically called after a successful README generation.Authentication
This endpoint requires authentication. Include valid Clerk authentication credentials in your request.Request body
The GitHub repository URL for which the README was generated
The generated README content in Markdown format
Response
Indicates whether the README was successfully saved
Code examples
Response example
Error responses
Missing required fieldsThis error occurs when:
repoUrlis not provided or is emptyreadmeContentis not provided or is empty
Authentication required
Error saving README to databaseor
Usage notes
- README history is saved on the client side after successful generation to prevent duplicate entries
- Each README is stored with a timestamp for chronological ordering
- There is no automatic limit on the number of READMEs that can be saved per user
- The
user_idis automatically extracted from the authentication context