Update social media URLs configuration
curl --request PATCH \
--url https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls \
--header 'Content-Type: application/json' \
--header 'x-backend-secret: <x-backend-secret>' \
--data '
{
"twitter": "https://x.com/handauncle",
"instagram": "https://instagram.com/handauncle.official"
}
'import requests
url = "https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls"
payload = {
"twitter": "https://x.com/handauncle",
"instagram": "https://instagram.com/handauncle.official"
}
headers = {
"x-backend-secret": "<x-backend-secret>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-backend-secret': '<x-backend-secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({
twitter: 'https://x.com/handauncle',
instagram: 'https://instagram.com/handauncle.official'
})
};
fetch('https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'twitter' => 'https://x.com/handauncle',
'instagram' => 'https://instagram.com/handauncle.official'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-backend-secret: <x-backend-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls"
payload := strings.NewReader("{\n \"twitter\": \"https://x.com/handauncle\",\n \"instagram\": \"https://instagram.com/handauncle.official\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-backend-secret", "<x-backend-secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls")
.header("x-backend-secret", "<x-backend-secret>")
.header("Content-Type", "application/json")
.body("{\n \"twitter\": \"https://x.com/handauncle\",\n \"instagram\": \"https://instagram.com/handauncle.official\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-backend-secret"] = '<x-backend-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"twitter\": \"https://x.com/handauncle\",\n \"instagram\": \"https://instagram.com/handauncle.official\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "Social media URLs updated successfully",
"socialMediaUrls": {
"facebook": "https://www.facebook.com/handauncle",
"instagram": "https://instagram.com/handauncle.official",
"linkedin": "https://www.linkedin.com/company/handauncle",
"twitter": "https://x.com/handauncle"
}
},
"meta": {
"requestId": "req_674e2f8e2g5f7h9i1d4e6f8g",
"timestamp": "2025-12-10T14:36:14.890Z"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}Mobile app
Update Social Media URLs
Admin endpoint to update social media URLs. Requires BACKEND_SECRET for authentication.
PATCH
/
app
/
config
/
social-media-urls
Update social media URLs configuration
curl --request PATCH \
--url https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls \
--header 'Content-Type: application/json' \
--header 'x-backend-secret: <x-backend-secret>' \
--data '
{
"twitter": "https://x.com/handauncle",
"instagram": "https://instagram.com/handauncle.official"
}
'import requests
url = "https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls"
payload = {
"twitter": "https://x.com/handauncle",
"instagram": "https://instagram.com/handauncle.official"
}
headers = {
"x-backend-secret": "<x-backend-secret>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-backend-secret': '<x-backend-secret>', 'Content-Type': 'application/json'},
body: JSON.stringify({
twitter: 'https://x.com/handauncle',
instagram: 'https://instagram.com/handauncle.official'
})
};
fetch('https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'twitter' => 'https://x.com/handauncle',
'instagram' => 'https://instagram.com/handauncle.official'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-backend-secret: <x-backend-secret>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls"
payload := strings.NewReader("{\n \"twitter\": \"https://x.com/handauncle\",\n \"instagram\": \"https://instagram.com/handauncle.official\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-backend-secret", "<x-backend-secret>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls")
.header("x-backend-secret", "<x-backend-secret>")
.header("Content-Type", "application/json")
.body("{\n \"twitter\": \"https://x.com/handauncle\",\n \"instagram\": \"https://instagram.com/handauncle.official\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://handauncle-backend-prod-205012263523.asia-south1.run.app/app/config/social-media-urls")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-backend-secret"] = '<x-backend-secret>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"twitter\": \"https://x.com/handauncle\",\n \"instagram\": \"https://instagram.com/handauncle.official\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"message": "Social media URLs updated successfully",
"socialMediaUrls": {
"facebook": "https://www.facebook.com/handauncle",
"instagram": "https://instagram.com/handauncle.official",
"linkedin": "https://www.linkedin.com/company/handauncle",
"twitter": "https://x.com/handauncle"
}
},
"meta": {
"requestId": "req_674e2f8e2g5f7h9i1d4e6f8g",
"timestamp": "2025-12-10T14:36:14.890Z"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}{
"success": false,
"error": {
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)",
"code": "VALIDATION_ERROR",
"details": [
{
"field": "phone",
"message": "Please enter a valid 10-digit phone number (e.g., 9876543210)"
}
]
},
"meta": {
"timestamp": "2023-11-07T05:31:56Z",
"requestId": "<string>"
}
}Admin endpoint to update social media profile URLs for Facebook, Instagram, LinkedIn, and Twitter.
This is an administrative endpoint that requires authentication via the
BACKEND_SECRET.
Only authorized administrators should have access to this endpoint.Authentication
This endpoint requires thex-backend-secret header with a value matching the
BACKEND_SECRET environment variable configured on the server.
x-backend-secret: your-backend-secret-here
Optional Headers
x-user-id: User ID of the administrator making the change (defaults to “admin”)
Request Body
All fields are optional. Only include the URLs you want to update:facebook: Facebook page URL (must be valid URL)instagram: Instagram profile URL (must be valid URL)linkedin: LinkedIn company page URL (must be valid URL)twitter: Twitter/X profile URL (must be valid URL)
Validation
- All URLs must be properly formatted (start with http:// or https://)
- Invalid URLs will return a 400 Bad Request error
Example
Update Twitter URL to X.com
cURL
curl -X PATCH 'https://api.handauncle.com/app/config/social-media-urls' \
-H 'Content-Type: application/json' \
-H 'x-backend-secret: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' \
-H 'x-user-id: admin@handauncle.com' \
-d '{
"twitter": "https://x.com/handauncle"
}'
Node.js
const response = await fetch('https://api.handauncle.com/app/config/social-media-urls', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'x-backend-secret': process.env.BACKEND_SECRET,
'x-user-id': 'admin@handauncle.com'
},
body: JSON.stringify({
twitter: 'https://x.com/handauncle'
})
});
const result = await response.json();
console.log(result.data.message);
Python
import requests
import os
response = requests.patch(
'https://api.handauncle.com/app/config/social-media-urls',
headers={
'Content-Type': 'application/json',
'x-backend-secret': os.environ['BACKEND_SECRET'],
'x-user-id': 'admin@handauncle.com'
},
json={'twitter': 'https://x.com/handauncle'}
)
result = response.json()
print(f"Status: {result['success']}")
print(f"Twitter URL: {result['data']['socialMediaUrls']['twitter']}")
Response
{
"success": true,
"data": {
"message": "Social media URLs updated successfully",
"socialMediaUrls": {
"facebook": "https://facebook.com/handauncle",
"instagram": "https://instagram.com/handauncle",
"linkedin": "https://www.linkedin.com/company/handauncle",
"twitter": "https://x.com/handauncle"
}
},
"meta": {
"timestamp": "2025-12-10T14:38:27.891Z",
"request_id": "req_674e311bd3c5e6f7a8b9c0d1"
}
}
Update Multiple URLs at Once
cURL
curl -X PATCH 'https://api.handauncle.com/app/config/social-media-urls' \
-H 'Content-Type: application/json' \
-H 'x-backend-secret: sk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' \
-H 'x-user-id: marketing@handauncle.com' \
-d '{
"facebook": "https://facebook.com/handauncle.official",
"instagram": "https://instagram.com/handauncle.official",
"twitter": "https://x.com/handauncle",
"linkedin": "https://www.linkedin.com/company/handa-uncle"
}'
Node.js
const updates = {
facebook: 'https://facebook.com/handauncle.official',
instagram: 'https://instagram.com/handauncle.official',
twitter: 'https://x.com/handauncle',
linkedin: 'https://www.linkedin.com/company/handa-uncle'
};
const response = await fetch('https://api.handauncle.com/app/config/social-media-urls', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
'x-backend-secret': process.env.BACKEND_SECRET,
'x-user-id': 'marketing@handauncle.com'
},
body: JSON.stringify(updates)
});
const result = await response.json();
console.log('All social URLs updated:', result.data.socialMediaUrls);
Error Responses
401 Unauthorized
Missing or invalid backend secret:{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid backend secret"
}
}
400 Bad Request
Invalid URL format:{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "facebook must be a valid URL"
}
}
Audit Trail
All updates are logged with:- Timestamp of the change
- User ID who made the change (from
x-user-idheader) - Fields that were modified
app_configuration collection to see the audit trail:
db.app_configuration.findOne({ config_key: 'social_media_urls' })
See Also
- Get Social Media URLs - Retrieve current social media URLs
- Update System URLs - Update system URLs
Headers
Backend secret for authentication
User ID performing the update (optional, defaults to 'admin')
Body
application/json
Response
Social media URLs updated successfully.
Available options:
true Show child attributes
Show child attributes
Example:
{
"message": "Social media URLs updated successfully",
"socialMediaUrls": {
"facebook": "https://www.facebook.com/handauncle",
"instagram": "https://instagram.com/handauncle.official",
"linkedin": "https://www.linkedin.com/company/handauncle",
"twitter": "https://x.com/handauncle"
}
}
Show child attributes
Show child attributes
⌘I