Update User Details API
Overview
Update existing user information in the system. Only the fields provided in the request body will be updated.
API Details
- Method: PUT
- URL: https://api.gafapay.com:8443/gafapay/v3/user/user_detail
- Content-Type: application/json
- companyid: 59388167894b4d10a04fe5da3b8a2104
- requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
- Authorization: Token required
Endpoint
PUT https://api.gafapay.com:8443/gafapay/v3/user/user_detail
Headers
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU3MDA3NDEyfQ.ph7qKBEzuHxgljV3141L9iOrWmHI4TnyoknBSNoVYYU
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
Content-Type: application/json
Request Body
{
"id": "6f1b82443e524459831de59d430a0c41",
"first_name": "Amine"
}
Request Body Fields
Required Fields
- id (string, required): The unique identifier of the user to update
- Format: User ID string
- Example: "6f1b82443e524459831de59d430a0c41"
Optional Fields (Update Only What You Need)
-
first_name (string, optional): User's first name
- Minimum length: 2 characters
- Maximum length: 50 characters
- Example: "Amine", "John"
-
last_name (string, optional): User's last name
- Minimum length: 2 characters
- Maximum length: 50 characters
- Example: "Kane", "Doe"
-
email (string, optional): User's email address
- Format: Valid email format
- Example: "amine.kane@example.com"
- Must be unique across the system if provided
-
dial_code (string, optional): Country dial code
- Format: "+" followed by country code
- Example: "+221", "+1", "+44"
-
phone_number (string, optional): User's phone number
- Format: Numeric only
- Length: 7-15 digits
- Example: "987654321", "800000000"
- Must be unique across the system if provided
-
birth_date (string, optional): User's birth date
- Format: "YYYY-MM-DD"
- Example: "1990-01-01"
-
country_id (string, optional): Country identifier
- Format: ISO 2-letter country code
- Example: "SN" (Senegal), "US" (United States)
-
image (string, optional): User's profile image URL
- Format: Valid URL string
- Example: "https://example.com/profile.jpg"
-
display_name (string, optional): User's display name
- Maximum length: 100 characters
- Example: "Amine K."
-
display_image (string, optional): User's display image URL
- Format: Valid URL string
- Example: "https://example.com/display.jpg"
Response
{
"success": 1,
"error": [],
"data": {
"message": "USER_UPDATE_USER_DETAIL_SUCCESSFULLY"
}
}
Response Fields
- success (integer): Response status indicator
1= Success0= Failure
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- message (string): Success message indicating user details were updated
Example Usage
curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/user/user_detail' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU3MDA3NDEyfQ.ph7qKBEzuHxgljV3141L9iOrWmHI4TnyoknBSNoVYYU' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b' \
--header 'Content-Type: application/json' \
--data '{
"id":"6f1b82443e524459831de59d430a0c41",
"first_name": "Amine"
}'
Example with Multiple Fields
curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/user/user_detail' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"id": "6f1b82443e524459831de59d430a0c41",
"first_name": "Amine",
"last_name": "Kane",
"email": "amine.kane@example.com",
"phone_number": "987654321",
"birth_date": "1990-01-01",
"country_id": "SN"
}'
Example with Profile Image Update
curl --location --request PUT 'https://api.gafapay.com:8443/gafapay/v3/user/user_detail' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: YOUR_COMPANY_ID' \
--header 'requestid: YOUR_REQUEST_ID' \
--header 'Content-Type: application/json' \
--data '{
"id": "6f1b82443e524459831de59d430a0c41",
"image": "https://example.com/profile.jpg",
"display_name": "Amine K."
}'
Notes
- ID is always required in the request body for all PUT APIs
- Only the fields provided in the request body will be updated
- Fields not included in the request will remain unchanged
- Phone numbers and email addresses must be unique across the system
- The system will validate all provided fields before updating
- Use the Get User Details API to verify the changes
- All updates are logged for audit purposes