PATCH
Update Mockup
Update mockup metadata such as the name. Returns the full updated mockup object.
PATCH
/api/v1/mockups/{uuid}Request
Headers
X-API-KEYstringRequiredYour SudoMock API key starting with sm_
Content-TypestringRequiredMust be application/json
Path Parameters
uuidstringRequiredThe unique identifier of the mockup to update.
Request Body
namestringRequiredNew name for the mockup. Must be 1-255 characters.
Request Body Example
1{2 "name": "Updated Product Mockup"3}
Only Name Updates
Currently, only the
name field can be updated. Other fields like smart objects cannot be modified after upload.Code Examples
Update Mockup
bash
1curl -X PATCH "https://api.sudomock.com/api/v1/mockups/abc123-def456-ghi789" \2 -H "X-API-KEY: sm_your_api_key" \3 -H "Content-Type: application/json" \4 -d '{5 "name": "Updated Product Mockup"6 }'
Response
Success Response
200OK
Returns the full mockup object with the updated name. The response format is identical to theGet Mockupendpoint.
Response 200 OK
1{2 "success": true,3 "data": {4 "uuid": "abc123-def456-ghi789",5 "name": "Updated Product Mockup",6 "thumbnail": "https://cdn.sudomock.com/abc123/thumbnails/thumb_720.jpg",7 "width": 3000,8 "height": 2000,9 "smart_objects": [10 {11 "uuid": "so-uuid-001",12 "name": "Product Image",13 "layer_name": "Smart Object 1",14 "size": { "width": 3000, "height": 3000 },15 "position": { "x": 100, "y": 100, "width": 800, "height": 600 },16 "quad": null,17 "blend_mode": "normal",18 "print_area_presets": [19 {20 "uuid": "preset-uuid-001",21 "name": "Default",22 "size": { "width": 3000, "height": 3000 },23 "position": { "x": 0, "y": 0, "width": 3000, "height": 3000 }24 }25 ]26 }27 ],28 "text_layers": [],29 "collections": [],30 "thumbnails": [31 { "width": 720, "url": "https://cdn.sudomock.com/abc123/thumbnails/thumb_720.jpg" },32 { "width": 480, "url": "https://cdn.sudomock.com/abc123/thumbnails/thumb_480.jpg" },33 { "width": 240, "url": "https://cdn.sudomock.com/abc123/thumbnails/thumb_240.jpg" }34 ]35 },36 "message": ""37}
Error Responses
400Bad Request
json
1{2 "detail": [3 {4 "loc": ["body", "name"],5 "msg": "field required",6 "type": "value_error.missing"7 }8 ]9}
The name field is required in the request body.
401Unauthorized
json
1{2 "success": false,3 "detail": "Invalid or missing API key"4}
404Not Found
json
1{2 "success": false,3 "detail": "Mockup not found"4}
422Validation Error
json
1{2 "detail": [3 {4 "loc": ["body", "name"],5 "msg": "ensure this value has at most 255 characters",6 "type": "value_error.any_str.max_length"7 }8 ]9}
Name must be between 1 and 255 characters.
Validation Rules
| Field | Type | Constraints |
|---|---|---|
name | string | Required, 1-255 characters |
Try It Live
PATCH
/api/v1/mockups/your-mockup-uuid-hereUpdate the name of an existing mockup.
Get your API key from the Dashboard
Best Practices
Naming Conventions
- Use descriptive names: "T-Shirt Front White" instead of "Mockup 1"
- Include variant info: size, color, angle (e.g., "iPhone 15 Pro - Black - 45°")
- Avoid special characters that may cause issues in file systems
- Keep names under 100 characters for better UI display
Common Issues
- 422 Validation Error: Name must be 1-255 characters
- 404 Not Found: Verify the UUID exists and belongs to your account
- Empty name: The name field is required and cannot be empty