Profiles
Profiles represent users within the Raha Accounts system. They store personal information and preferences associated with each user account.
The profile model
Each profile has the following attributes:
Properties
- Name
id- Type
- string
- Description
Raha Accounts’s unique identifier for the profile (internal).
- Name
first_name- Type
- string
- Description
User's first name.
- Name
last_name- Type
- string | undefined
- Description
User's last name.
- Name
avatar_path- Type
- string | undefined
- Description
Path to the user's avatar image.
- Name
has_pin_code- Type
- boolean | undefined
- Description
Indicates whether the user has set a PIN code for added security.
- Name
date_of_birth- Type
- string | undefined
- Description
User's date of birth in ISO 8601 format (YYYY-MM-DD).
- Name
preferences- Type
- object | undefined
- Description
A JSON object storing user preferences and settings.
- Name
created_at- Type
- string
- Description
Timestamp of when the profile was created.
- Name
updated_at- Type
- string
- Description
Timestamp of the last update to the profile.
List all profiles
Retrieve a list of user profiles
Request
curl -G https://api.account.raha.af/api/v1/account/profiles \
-H "Authorization: Bearer {token}"
Response
{
"data": [
{
"id": "bfb62aa7-52ec-444a-b0b1-7d756a522b0a",
"first_name": "Mohsen",
"last_name": "Amani",
"avatar_path": "/avatars/mohsen.png",
"has_pin_code": true,
"date_of_birth": "1990-05-15",
"preferences": { ... },
"created_at": "2025-09-01T12:00:00Z",
"updated_at": "2025-09-01T12:00:00Z
},
{
"id": "f3be92a2-8649-482d-ac27-ab1912c9b6bd",
"first_name": "Leila",
}
],
}
Get a profile
Retrieve details of a specific user profile.
URL parameters
- Name
id- Type
- string
- Description
The unique identifier of the profile to retrieve.
Request
curl -G https://api.account.raha.af/api/v1/account/profiles/{id} \
-H "Authorization: Bearer {token}"
Response
{
"id": "bfb62aa7-52ec-444a-b0b1-7d756a522b0a",
"first_name": "Mohsen",
"last_name": "Amani",
"avatar_path": "/avatars/mohsen.png",
"has_pin_code": true,
"date_of_birth": "1990-05-15",
"preferences": { ... },
"created_at": "2025-09-01T12:00:00Z",
"updated_at": "2025-09-01T12:00:00Z
}
Create a profile
Create a new account profile.
Required attributes
- Name
first_name- Type
- string
- Description
User's first name.
- Name
last_name- Type
- string | undefined
- Description
User's last name.
- Name
avatar_path- Type
- string | undefined
- Description
Path to the user's avatar image.
- Name
date_of_birth- Type
- string | undefined
- Description
User's date of birth in ISO 8601 format (YYYY-MM-DD).
- Name
pin_code- Type
- string | undefined
- Description
A PIN code for added security.
- Name
preferences- Type
- object | undefined
- Description
A JSON object storing user preferences and settings.
Request
curl -X POST https://api.account.raha.af/api/v1/account/profiles \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Mohsen",
"last_name": "Amani",
"avatar_path": "/avatars/mohsen.png",
"date_of_birth": "1990-05-15",
"pin_code": "1234",
"preferences": { "theme": "dark" }
}'
Response
{
"id": "bfb62aa7-52ec-444a-b0b1-7d756a522b0a",
"first_name": "Mohsen",
"last_name": "Amani",
"avatar_path": "/avatars/mohsen.png",
"has_pin_code": true,
"date_of_birth": "1990-05-15",
"preferences": { "theme": "dark" },
"created_at": "2025-09-01T12:00:00Z",
"updated_at": "2025-09-01T12:00:00Z
}
Update a profile
Modify an existing profile's attributes.
URL parameters
- Name
id- Type
- string
- Description
The unique identifier of the profile to update.
Updatable attributes
- Name
first_name- Type
- string | undefined
- Description
User's first name.
- Name
last_name- Type
- string | undefined
- Description
User's last name.
- Name
avatar_path- Type
- string | undefined
- Description
Path to the user's avatar image.
- Name
date_of_birth- Type
- string | undefined
- Description
User's date of birth in ISO 8601 format (YYYY-MM-DD).
- Name
preferences- Type
- object | undefined
- Description
A JSON object storing user preferences and settings.
Request
curl -X PUT https://api.account.raha.af/api/v1/account/profiles/{id} \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"first_name": "Mohsen",
"last_name": "Amani",
"avatar_path": "/avatars/mohsen_updated.png",
"date_of_birth": "1990-05-15",
"preferences": { "theme": "light" }
}'
Response
Empty
Delete a profile
Delete a user profile.
Note: User can not delete the default profile associated with their account.
URL parameters
- Name
id- Type
- string
- Description
The unique identifier of the profile to delete.
Request
curl -X DELETE https://api.account.raha.af/api/v1/account/profiles/{id} \
-H "Authorization: Bearer {token}"
Response
Empty