Update Portfolio Employer
Updates an existing portfolio employer with new information. Only the provided fields will be updated.
HTTP Request
PATCH/api/portfolios/employers/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff with PorfolioEmployerPermission or Admin
- Permission Code: 4223
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | Integer | Yes | Unique ID of the employer to update |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | No | employer name (must be unique) |
| image | Integer | No | ID of the employer image |
| description | String | No | Description of the employer |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# Update employer name and image
4response = requests.patch('http://www.example.com/api/portfolios/employers/123',
5 json={
6 'name': 'Apple',
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/employers/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/employers/123',
24 json={
25 'image': None
26 },
27 headers={'Authorization': 'Token <your_api_key>'}
28)
29print(response.json())1# Update employer name and image
2curl -X PATCH "http://www.example.com/api/portfolios/employers/123" \
3-H "Authorization: Token <your_api_key>" \
4-H "Content-Type: application/json" \
5-d '{
6 "name": "Apple",
7 "image": 2
8}'
9
10# Update only the image
11curl -X PATCH "http://www.example.com/api/portfolios/employers/123" \
12-H "Authorization: Token <your_api_key>" \
13-H "Content-Type: application/json" \
14-d '{
15 "image": 456
16}'
17
18# Remove image by setting to null
19curl -X PATCH "http://www.example.com/api/portfolios/employers/123" \
20-H "Authorization: Token <your_api_key>" \
21-H "Content-Type: application/json" \
22-d '{
23 "image": null
24}'Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the employer |
| name | String | employer name (unique) |
| image_data | Object | employer image details |
| description | String | Description of the employer (nullable) |
| created_at | String (ISO 8601) | Timestamp when employer was created |
| updated_at | String (ISO 8601) | Timestamp when employer was last updated |
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) |
Example Response
{
"id": 4,
"name": "همکاران سیستم",
"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-13T09:55:00.750306Z",
"updated_at": "2026-01-13T09:55:00.750315Z"
}