Skip to main content

Create Portfolio

Creates a new portfolio with the specified properties.

HTTP Request

POST/api/portfolios/
NOTE: NOT USING THE TRAILING SLASH AT THE END OF THE URL RESULTS TO A 500 SERVER ERROR

Authorization

Authorization

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

Request Body

FieldTypeRequiredDescription
titleStringYesportfolio title (unique)
slugStringYesunique slug of the portfolio
descriptionStringNofull description of the portfolio
excerptStringYesShort description of the portfolio
imageIntegerNoID of the portfolio image
imagesList(Integer)Nolist of portfolio gallery images ids
orderIntegerNoDisplay order of the portfolio
employerIntegerNoID of the porfolio employer
tagsList(Integer)Nolist of portfolio tags ids
is_activeBooleanNowhether the portfolio is active (default: true)
completed_atDatetimeNoFinished/released/published datetime of the project

Example Requests

1import requests
2
3# Create a new portfolio
4response = requests.post('http://www.example.com/api/portfolios/', 
5  json={
6      'title': 'Wordpress site',
7      'slug': 'wordpress-site',
8      'description': 'this can be a long text describing the project',
9      'excerpt': 'a wordpress site built with elementor and great performance for product showcase',
10      'image': 15,
11      'images': [153, 155],
12      'order': 1,
13      'employer': 1,
14      'tags': [1,3],
15      'is_active': true,
16      'completed_at': "2024-12-12",
17  },
18  headers={'Authorization': 'Token <your_api_key>'}
19)
20print(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": 149,
"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-12T00:00:00Z",
"created_at": "2026-03-03T17:49:52.477954Z",
"updated_at": "2026-03-03T17:49:52.477961Z",
"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": []
}