curl -X PUT https://snip.sa/api/urls/507f1f77bcf86cd799439011 \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"title": "Updated Title",
"isActive": true,
"tags": ["updated", "tags"]
}'
const response = await axios.put(
'https://snip.sa/api/urls/507f1f77bcf86cd799439011',
{
title: 'Updated Title',
isActive: true,
tags: ['updated', 'tags']
},
{
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
}
);
response = requests.put(
'https://snip.sa/api/urls/507f1f77bcf86cd799439011',
headers={
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
json={
'title': 'Updated Title',
'isActive': True,
'tags': ['updated', 'tags']
}
)
{
"success": true,
"message": "URL updated successfully",
"data": {
"url": {
"_id": "507f1f77bcf86cd799439011",
"title": "Updated Title",
"tags": ["updated", "tags"],
"isActive": true,
"updatedAt": "2024-01-16T14:20:00.000Z"
}
}
}
URLs
Update URL
Update properties of an existing shortened URL
PUT
/
api
/
urls
/
{id}
curl -X PUT https://snip.sa/api/urls/507f1f77bcf86cd799439011 \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"title": "Updated Title",
"isActive": true,
"tags": ["updated", "tags"]
}'
const response = await axios.put(
'https://snip.sa/api/urls/507f1f77bcf86cd799439011',
{
title: 'Updated Title',
isActive: true,
tags: ['updated', 'tags']
},
{
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
}
);
response = requests.put(
'https://snip.sa/api/urls/507f1f77bcf86cd799439011',
headers={
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
json={
'title': 'Updated Title',
'isActive': True,
'tags': ['updated', 'tags']
}
)
{
"success": true,
"message": "URL updated successfully",
"data": {
"url": {
"_id": "507f1f77bcf86cd799439011",
"title": "Updated Title",
"tags": ["updated", "tags"],
"isActive": true,
"updatedAt": "2024-01-16T14:20:00.000Z"
}
}
}
Path Parameters
string
required
URL ID
Request Body
You cannot update
originalUrl or shortCode. All fields are optional.string
Updated title
string
Updated description
array
Updated tags array
boolean
Enable or disable the URL
string
Update custom code
string
Update expiration date
string
Update password protection
object
Update UTM parameters
object
Update access restrictions
number
Update redirect type (301 or 302)
curl -X PUT https://snip.sa/api/urls/507f1f77bcf86cd799439011 \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"title": "Updated Title",
"isActive": true,
"tags": ["updated", "tags"]
}'
const response = await axios.put(
'https://snip.sa/api/urls/507f1f77bcf86cd799439011',
{
title: 'Updated Title',
isActive: true,
tags: ['updated', 'tags']
},
{
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
}
);
response = requests.put(
'https://snip.sa/api/urls/507f1f77bcf86cd799439011',
headers={
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
json={
'title': 'Updated Title',
'isActive': True,
'tags': ['updated', 'tags']
}
)
{
"success": true,
"message": "URL updated successfully",
"data": {
"url": {
"_id": "507f1f77bcf86cd799439011",
"title": "Updated Title",
"tags": ["updated", "tags"],
"isActive": true,
"updatedAt": "2024-01-16T14:20:00.000Z"
}
}
}
