Base URL: /account/
Authentication: Required for most endpoints (JWT / Session)
GET /account/notify/notifList/Response (200 OK):
[
{
"id": 1,
"text": "Welcome to Tadrisino!",
"message_seen": false,
"created_at": "2023-01-01T12:00:00Z"
}
]
POST /account/notify/seenMsg/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
notif_id |
int | ✓ | Notification ID |
Response (200 OK):
{
"id": 1,
"text": "Welcome to Tadrisino!",
"message_seen": true,
"created_at": "2023-01-01T12:00:00Z"
}
403 Forbidden → Not authorized to modify this notificationPOST /account/userinfo/survey/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
name |
string | ✓ | Full name |
birthday |
string | ✓ | Birth date |
job |
string | ✓ | Occupation |
education |
string | ✓ | Education level |
major |
string | ✓ | Field of study |
interests |
array | ✓ | Array of category IDs |
Response (200 OK):
{
"message": "Survey submitted successfully"
}
400 Bad Request → Missing required fields404 Not Found → Profile not foundPOST /account/register/register/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | ✓ | Phone number (must be valid Iranian number) |
password |
string | ✓ | User password |
Response (201 Created):
{
"data": {
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"role": "student",
"streak": 0
}
}
400 Bad Request → Phone number not verified, username already taken, or invalid phone number429 Too Many Requests → Too many OTP requestsPOST /account/register/sendCode/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | ✓ | Phone number to verify |
Response (200 OK):
{
"message": "کد به شماره همراه شما ارسال شد."
}
400 Bad Request → Username already taken429 Too Many Requests → Too many OTP requestsPOST /account/register/verify/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | ✓ | Phone number to verify |
code |
string | ✓ | OTP code received |
Response (200 OK):
{
"message": "تایید شد. خوش آمدید."
}
400 Bad Request → Invalid code, expired code, or already verified404 Not Found → OTP record not foundPOST /account/register/check_username/POST /account/register/check_email/POST /account/register/check_phone_number/POST /account/login/login/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
username |
string | ✓ | Phone number/username |
password |
string | Conditional | Required for password mode |
code |
string | Conditional | Required for OTP mode |
mode |
string | ✓ | "password" or "otp" |
Response (200 OK):
{
"data": {
"refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"role": "student",
"streak": 5,
"main_character": "character_data"
}
}
400 Bad Request → Invalid login mode401 Unauthorized → Invalid credentials404 Not Found → User not foundPOST /account/login/sendCode/GET /account/userinfo/{
"id": 123,
"username": "09123456789",
"first_name": "John",
"birthdate": "1990-01-01",
"phone_number": "09123456789",
"profile_picture": "/media/profile_pics/123.jpg",
"email": "[email protected]",
"role": "student",
"bio": "Software developer",
"points": 100,
"credit": 5,
"subscriptionDaysLeft": 30,
"streak": 5,
"national_code": "1234567890"
}
POST /account/profile/update_profile/| Name | Type | Required | Description |
|---|---|---|---|
bio |
string | ✗ | User biography |
pic_url |
string | ✗ | Profile picture URL |
phone_number |
string | ✗ | Phone number |
first_name |
string | ✗ | First name |
national_code |
string | ✗ | National code |
birthdate |
string | ✗ | Birth date |
{
"detail": "Profile updated successfully."
}
404 Not Found → Profile not foundGET /account/token/validate-token/Response (200 OK):
{
"message": "Token is valid"
}
400 Bad Request → Token missing401 Unauthorized → Token invalid or expiredGET /account/logout/are_you_sure/{
"character": [
{
"character": "B",
"new_mood": "sad",
"reaction_message": {
"reaction_message": "Oh no, logged out in the middle of a quest again! This always happens at the worst times..."
},
"avatar": "data:image",
"source": "ai"
}
]
}
POST /account/logout/logout/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
refresh |
string | ✓ | Refresh token to blacklist |
Response (205 Reset Content):
{
"message": "Successfully logged out."
}
400 Bad Request → Missing refresh token or invalid tokenPOST /account/profile/update_profile/GET /account/profile/subscription-status/Response (200 OK):
{
"message": "User has active subscription days.",
"has_subscription": true
}
404 Not Found → Profile not foundGET /account/profile/check_subscription_on_login/GET /account/profile/credit/Response (200 OK):
{
"credit": 5
}
404 Not Found → Profile not foundGET /account/payment/verify/GET /account/BuyCredit/verify/POST /account/teacher_waiting/apply/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
phone_number |
string | ✓ | Contact phone number |
degree |
string | ✓ | Academic degree |
subject |
string | ✓ | Teaching subject |
course_price |
string | ✓ | Proposed course price |
Response (201 Created):
{
"detail": "Application submitted successfully."
}
400 Bad Request → Already applied or invalid dataPOST /account/tts/generate/Input Parameters (Body: JSON):
| Name | Type | Required | Description |
|---|---|---|---|
text |
string | ✓ | Text to convert to speech |
Response (200 OK):
{
"file_url": "https://api.tadrisino.org/media/tts/abc123.mp3"
}
400 Bad Request → Missing text parameter