Skip to main content

Update Portfolio Link

Updates an existing portfolio link with new information. Only the provided fields will be updated.

HTTP Request

PATCH/api/portfolios/:portfolio_id/links/:id

Authorization

Authorization

  • Required: Yes
  • Permission: Staff with PorfolioLinkPermission or Admin
  • Permission Code: 4243
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
portfolio_idIntegerYesUnique ID of the related portfolio
idIntegerYesUnique ID of the link to update

Request Body

FieldTypeRequiredDescription
nameStringNolink name (no need to be unique)
imageIntegerNoID of the link image
urlURLFieldNoUrl related to the link
descriptionStringNoDescription of the link

Example Requests

1import requests
2
3# Update link name and image 
4response = requests.patch('http://www.example.com/api/portfolios/2/links/123', 
5  json={
6      'name': 'طراحی سایت وردپرسی',
7      'image': 123
8  },
9  headers={'Authorization': 'Token <your_api_key>'}
10)
11print(response.json())
12
13# Update only the image
14response = requests.patch('http://www.example.com/api/portfolios/2/links/123', 
15  json={
16      'image': 456
17  },
18  headers={'Authorization': 'Token <your_api_key>'}
19)
20print(response.json())
21
22# Remove image by setting to null
23response = requests.patch('http://www.example.com/api/portfolios/2/links/123', 
24  json={
25      'image': None
26  },
27  headers={'Authorization': 'Token <your_api_key>'}
28)
29print(response.json())

Response Fields

FieldTypeDescription
idIntegerUnique ID of the link
nameStringlink name (not unique)
image_dataObjectlink image details
descriptionStringDescription of the link (nullable)
urlURLFieldUrl related to the link (nullable)
created_atString (ISO 8601)Timestamp when link was created
updated_atString (ISO 8601)Timestamp when link was last updated

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image/jpeg)
nameStringOriginal file name
sizeIntegerFile size in bytes
human_readable_sizeStringHuman readable file size (e.g., 2.5 MB)
fStringURL to access the image file
widthIntegerImage width in pixels
heightIntegerImage height in pixels
modeStringColor mode (e.g., RGB, CMYK)
thumbnailsList of thumbnail objectsImgae thumbnails

Thumbnail Data Structure

FieldTypeDescription
idIntegerUnique ID of the thumbnail (unique)
fStringURL to access the thumbnail file
sizeIntegerFile size in bytes (nullable)

Example Response

{
"id": 4,
"name": "دمو پروژه",
"url": "https://moeinsoft.com/demo",
"image_data": {
"id": 6,
"type": "image",
"name": "technology",
"size": 5123,
"human_readable_size": "5.00 KB",
"f": "http://localhost:8000/media/core_media/2025/12/02/technology.png",
"width": 225,
"height": 225,
"mode": "P",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
},
"description": "لینک مشاهده دمو",
"created_at": "2026-01-13T10:05:43.296270Z",
"updated_at": "2026-01-13T10:05:43.296310Z"
}