Skip to main content

Update portfolio

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

HTTP Request

PATCH/api/portfolios/:id

Authorization

Authorization

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

Path Parameters

ParameterTypeRequiredDescription
idIntegerYesUnique ID of the portfolio to update

Request Body

FieldTypeRequiredDescription
titleStringNoportfolio title (unique)
is_activeBooleanNowhether the portfolio is active (default: true)
slugStringNounique slug of the portfolio
excerptStringNoShort description of the portfolio
orderIntegerNoDisplay order of the portfolio
completed_atDatetimeNoThe time that the project has been finished/released/published
imageIntegerNoID of the portfolio image
employerIntegerNoID of the porfolio employer
tagsList(Integer)Nolist of portfolio tags ids
imagesList(Integer)Nolist of portfolio gallery images ids
descriptionStringNofull description of the portfolio

Example Requests

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

Response Fields

FieldTypeDescription
idIntegerUnique ID of the portfolio
titleStringportfolio title (unique)
slugStringunique slug of the portfolio
excerptStringShort description of the portfolio
orderIntegerDisplay order of the portfolio
image_dataObjectportfolio image details (nullable)
employer_dataObjectportfolio employer details (nullable)
tags_dataList(object)list of portfolio tags (nullable)
links_dataList(object)list of portfolio related links (nullable)
is_activeBooleanwhether the portfolio is active
completed_atDatetimeTime that the project has been finished/released/published
created_atString (ISO 8601)Timestamp when portfolio was created
updated_atString (ISO 8601)Timestamp when portfolio was last updated
descriptionStringfull description of the project (nullable)
images_dataList(object)list of gallery images objects (nullable)
metaList(objcet)list of meta objects (nullable)

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)

Client Data Structure

FieldTypeDescription
idIntegerUnique ID of the client
nameStringclient name (unique)
descriptionStringDescription of the client (nullable)
image_dataObjectclient image details

Tag Data Structure

FieldTypeDescription
idIntegerUnique ID of the tag
nameStringtag name (unique)
image_dataObjecttag image details

Link Data Structure

FieldTypeDescription
idIntegerUnique ID of the link
nameStringlink name (not unique)
urlURLFieldURL related to the link(nullable)
descriptionStringDescription of the link (nullable)
image_dataObjectlink image details

Meta Data Structure

FieldTypeDescription
idIntegerUnique ID of the meta data
keyStringThe key name of the meta data
value_textStringThe text value of the meta data
value_fileObjectThe file value of the meta data

Meta value_file data structure

FieldTypeDescription
idIntegerUnique ID of the file
typeStringThe type of the file
nameStringThe name of the file
sizeIntegerThe size of the file in bytes
human_readable_sizeStringThe human-readable size of the file
fStringThe url to the file

Example Response

{
"id": 150,
"title": "Wordpress site",
"slug": "wordpress-site",
"excerpt": "a wordpress site built with elementor and great performance for product showcase",
"order": 1,
"image_data": {
"id": 88,
"type": "image",
"name": "test text",
"size": 73062,
"human_readable_size": "71.35 KB",
"f": "http://localhost:8000/media/core_media/2026/03/02/image_test_media_file_0.bmp",
"width": 156,
"height": 156,
"mode": "RGB",
"thumbnails": [
{
"id": 229,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_64x64.bmp",
"size": 64
},
{
"id": 230,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_128x128.bmp",
"size": 128
},
{
"id": 231,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_512x512.bmp",
"size": 512
},
{
"id": 232,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_1080x1080.bmp",
"size": 1080
}
]
},
"employer_data": {
"id": 1,
"name": "digikala",
"image_data": {
"id": 88,
"type": "image",
"name": "test text",
"size": 73062,
"human_readable_size": "71.35 KB",
"f": "http://localhost:8000/media/core_media/2026/03/02/image_test_media_file_0.bmp",
"width": 156,
"height": 156,
"mode": "RGB",
"thumbnails": [
{
"id": 229,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_64x64.bmp",
"size": 64
},
{
"id": 230,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_128x128.bmp",
"size": 128
},
{
"id": 231,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_512x512.bmp",
"size": 512
},
{
"id": 232,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_1080x1080.bmp",
"size": 1080
}
]
},
"description": "some store"
},
"tags_data": [
{
"id": 1,
"name": "sites",
"image_data": {
"id": 92,
"type": "image",
"name": "asdf",
"size": 11740,
"human_readable_size": "11.46 KB",
"f": "http://localhost:8000/media/core_media/2026/03/03/preview.png",
"width": 216,
"height": 263,
"mode": "RGBA",
"thumbnails": [
{
"id": 241,
"f": "http://localhost:8000/media/core_media/2026/03/03/thumbnails/preview_thumbnail_64x64.png",
"size": 64
},
{
"id": 242,
"f": "http://localhost:8000/media/core_media/2026/03/03/thumbnails/preview_thumbnail_128x128.png",
"size": 128
},
{
"id": 243,
"f": "http://localhost:8000/media/core_media/2026/03/03/thumbnails/preview_thumbnail_512x512.png",
"size": 512
},
{
"id": 244,
"f": "http://localhost:8000/media/core_media/2026/03/03/thumbnails/preview_thumbnail_1080x1080.png",
"size": 1080
}
]
}
},
{
"id": 2,
"name": "webs",
"image_data": {
"id": 88,
"type": "image",
"name": "test text",
"size": 73062,
"human_readable_size": "71.35 KB",
"f": "http://localhost:8000/media/core_media/2026/03/02/image_test_media_file_0.bmp",
"width": 156,
"height": 156,
"mode": "RGB",
"thumbnails": [
{
"id": 229,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_64x64.bmp",
"size": 64
},
{
"id": 230,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_128x128.bmp",
"size": 128
},
{
"id": 231,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_512x512.bmp",
"size": 512
},
{
"id": 232,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_1080x1080.bmp",
"size": 1080
}
]
}
}
],
"links_data": [],
"is_active": true,
"completed_at": "2024-12-14T00:00:00Z",
"created_at": "2026-03-03T17:52:28.976376Z",
"updated_at": "2026-03-03T18:01:41.638371Z",
"description": "this can be a long text describing the project",
"images_data": [
{
"id": 88,
"type": "image",
"name": "test text",
"size": 73062,
"human_readable_size": "71.35 KB",
"f": "http://localhost:8000/media/core_media/2026/03/02/image_test_media_file_0.bmp",
"width": 156,
"height": 156,
"mode": "RGB",
"thumbnails": [
{
"id": 229,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_64x64.bmp",
"size": 64
},
{
"id": 230,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_128x128.bmp",
"size": 128
},
{
"id": 231,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_512x512.bmp",
"size": 512
},
{
"id": 232,
"f": "http://localhost:8000/media/core_media/2026/03/02/thumbnails/image_test_media_file_0_thumbnail_1080x1080.bmp",
"size": 1080
}
]
}
],
"meta": []
}