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
Request Body
You cannot update
originalUrl or shortCode. All fields are optional.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"
}
}
}
