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
| Field | Type | Required | Description |
|---|---|---|---|
| title | String | Yes | portfolio title (unique) |
| slug | String | Yes | unique slug of the portfolio |
| description | String | No | full description of the portfolio |
| excerpt | String | Yes | Short description of the portfolio |
| image | Integer | No | ID of the portfolio image |
| images | List(Integer) | No | list of portfolio gallery images ids |
| order | Integer | No | Display order of the portfolio |
| employer | Integer | No | ID of the porfolio employer |
| tags | List(Integer) | No | list of portfolio tags ids |
| is_active | Boolean | No | whether the portfolio is active (default: true) |
| completed_at | Datetime | No | Finished/released/published datetime of the project |
Example Requests
- 🐍 Python
- 🌐 Curl
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())1# Create a new portfolio
2curl -X POST "http://www.example.com/api/portfolios/" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
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}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the portfolio |
| title | String | portfolio title (unique) |
| slug | String | unique slug of the portfolio |
| excerpt | String | Short description of the portfolio |
| order | Integer | Display order of the portfolio |
| image_data | Object | portfolio image details (nullable) |
| employer_data | Object | portfolio employer details (nullable) |
| tags_data | List(object) | list of portfolio tags (nullable) |
| links_data | List(object) | list of portfolio related links (nullable) |
| is_active | Boolean | whether the portfolio is active |
| completed_at | Datetime | Time that the project has been finished/released/published |
| created_at | String (ISO 8601) | Timestamp when portfolio was created |
| updated_at | String (ISO 8601) | Timestamp when portfolio was last updated |
| description | String | full description of the project (nullable) |
| images_data | List(object) | list of gallery images objects (nullable) |
| meta | List(objcet) | list of meta objects (nullable) |
Image Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (e.g., image/jpeg) |
| name | String | Original file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size (e.g., 2.5 MB) |
| f | String | URL to access the image file |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Color mode (e.g., RGB, CMYK) |
| thumbnails | List of thumbnail objects | Imgae thumbnails |
Thumbnail Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the thumbnail (unique) |
| f | String | URL to access the thumbnail file |
| size | Integer | File size in bytes (nullable) |
Client Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the client |
| name | String | client name (unique) |
| description | String | Description of the client (nullable) |
| image_data | Object | client image details |
Tag Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the tag |
| name | String | tag name (unique) |
| image_data | Object | tag image details |
Link Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the link |
| name | String | link name (not unique) |
| url | URLField | URL related to the link(nullable) |
| description | String | Description of the link (nullable) |
| image_data | Object | link image details |
Meta Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the meta data |
| key | String | The key name of the meta data |
| value_text | String | The text value of the meta data |
| value_file | Object | The file value of the meta data |
Meta value_file data structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the file |
| type | String | The type of the file |
| name | String | The name of the file |
| size | Integer | The size of the file in bytes |
| human_readable_size | String | The human-readable size of the file |
| f | String | The 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": []
}