DELETE
Delete Mockup
Permanently delete a mockup and all associated files including layers, thumbnails, and rendered images.
DELETE
/api/v1/mockups/{uuid}Destructive Action
This action is permanent and cannot be undone. Deleting a mockup will remove:
- The mockup template and metadata
- All associated smart object definitions
- All layer configurations
- All generated thumbnails
- All rendered images for this mockup
Request
Headers
X-API-KEYstringRequiredYour SudoMock API key starting with sm_
Path Parameters
uuidstringRequiredThe unique identifier of the mockup to delete. You receive this UUID when uploading a PSD file.
Code Examples
Delete Mockup
bash
1curl -X DELETE "https://api.sudomock.com/api/v1/mockups/550e8400-e29b-41d4-a716-446655440000" \2 -H "X-API-KEY: sm_your_api_key"
Response
Success Response
204No Content
A successful deletion returns a 204 No Content response with an empty body. This is standard REST behavior for DELETE operations.
Handling 204 Response
Do not attempt to parse the response body when you receive a 204 status code. Simply check that
response.status === 204 to confirm success.Error Responses
401Unauthorized
Missing or invalid API key.
json
1{2 "detail": "Invalid or missing API key",3 "success": false4}
404Not Found
The mockup does not exist or is not owned by the authenticated user.
json
1{2 "detail": "Mockup not found",3 "success": false4}
500Internal Server Error
An unexpected error occurred while processing the deletion.
json
1{2 "detail": "Internal error while deleting mockup",3 "success": false4}
Error Handling
| Status | Meaning | Action |
|---|---|---|
| 204 | Mockup deleted successfully | No action needed |
| 401 | Authentication failed | Check your API key |
| 404 | Mockup not found | Verify the mockup UUID exists and belongs to your account |
| 500 | Server error | Retry the request or contact support |
Best Practices
Recommended Practices
- Confirm before deleting: Always show a confirmation dialog to users before deleting mockups
- Keep backups: If the mockup is important, download or backup renders before deletion
- Handle 404 gracefully: The mockup may have already been deleted; treat 404 as a soft success
- Use idempotent retries: DELETE is idempotent; retrying a failed request is safe
File Cleanup
When you delete a mockup, all associated files are removed asynchronously from storage. The API response returns immediately after the database records are deleted. File cleanup typically completes within a few seconds.