Models
Authentication and User Models
The server uses the following models for authentication and user requests and responses.
User Model
The User model represents an individual user account within the system. It contains essential user information and is used for authentication and data ownership.
Field | Type | Description |
---|---|---|
id |
string |
A unique identifier for the user account, typically a UUID |
username |
string |
The user’s email address, which serves as their unique username. |
password_hash |
string |
The user’s hashed password. This field is never exposed in API responses. |
created_at |
string |
The date and time the user account was created, in ISO 8601 format. |
RegisterUserRequest Model
The RegisterUserRequest model represents the request sent by the user to the system to register as a new user. It contains the user’s email and password.
Field | Type | Description |
---|---|---|
username |
string |
The user’s email address, which serves as their unique username. |
password |
string |
The user’s password. |
LoginUserRequest Model
The LoginUserRequest model represents the request sent by the user to the system to log in. It contains the user’s email and password.
Field | Type | Description |
---|---|---|
username |
string |
The user’s email address, which serves as their unique username. |
password |
string |
The user’s password. |
Article Models
The following models are used in requests and responses related to a user’s articles.
Article Model
The Article model represents an individual article saved in the system. It contains the details about the article record, such as when it was created, the title, summary, and associated tags. The user only provides the URL of the article. The system will generate, with the help of AI, the title, summary, and tags.
Field | Type | Description |
---|---|---|
id |
string |
The unique identifier for the article, typically a UUID. |
user_id |
string |
A unique identifier for the user account, typically a UUID. |
url |
string |
The URL to the article. |
title |
string |
The title of the article. Generated by AI. |
summary |
string |
A summary of the article generated by AI. |
tags |
array of strings |
A list of tags associated with the article. Generated by AI. Tags can also be updated by the user. |
status |
string |
The status of the article. Initially set to “processing” by the system when the article record is first created. The status is changed to “unread” if the system successfully retrieved the title, summary, and tags from AI, or to “failed” if the retrieval failed. The user can also update the article status, typically to “read” once the article has been read. |
created_at |
string |
The date and time the system created the article record, in ISO 8601 format. |
updated_at |
string |
The date and time the article’s record in the system was updated, in ISO 8601 format. |
ArticleSubmissionRequest Model
The ArticleSubmissionRequest model represents the user’s request to create a record for an article. The URL
is the only field required.
Field | Type | Description |
---|---|---|
url |
string |
The URL to the article. |
UpdateArticleStatusRequest Model
The UpdateArticleStatusRequest model represents the user’s request to update an article’s status.
Field | Type | Description |
---|---|---|
status |
string |
The new status of the article. |
UpdateArticleTagRequest Model
The UpdateArticleTagRequest model represents the user’s request to update an article’s tags.
Field | Type | Description |
---|---|---|
tags |
array of strings |
The updated list of tags to be associated with the article. |
Message and Error Models
MessageResponse Model
The MessageResponse model represents the server’s response to a user’s request when no other content is contained in the response body.
Field | Type | Description |
---|---|---|
message |
string |
A message string from the system. |
ErrorResponse Model
The ErrorResponse model represents the server’s response to a user’s request when an error has occurred.
Field | Type | Description |
---|---|---|
message |
string |
An error message string from the system. |