Delete Mockup
Permanently delete a mockup and all associated files including layers, thumbnails, and rendered images.
/api/v1/mockups/{mockup_uuid}Destructive Action
- The mockup template and metadata
- All associated smart object definitions
- All layer configurations
- All generated thumbnails
- All rendered images for this mockup
Authentication
This endpoint supports dual authentication. You can use either method:
API Key
x-api-key: sm_xxx...Best for server-side integrations, automation workflows, and SDK implementations.
Bearer Token
Authorization: Bearer <jwt>Best for frontend applications using Supabase authentication.
Request
Path Parameters
mockup_uuidstring (UUID)RequiredThe unique identifier of the mockup to delete. You receive this UUID when uploading a PSD file.
Headers
Use one of the following authentication headers:
x-api-keystringYour SudoMock API key starting with sm_
AuthorizationstringBearer token in the format: Bearer <jwt_token>
Code Examples (API Key)
1curl -X DELETE "https://api.sudomock.com/api/v1/mockups/550e8400-e29b-41d4-a716-446655440000" \2 -H "x-api-key: sm_your_api_key"
Code Examples (Bearer Token)
1curl -X DELETE "https://api.sudomock.com/api/v1/mockups/550e8400-e29b-41d4-a716-446655440000" \2 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
Response
Success Response
A successful deletion returns a 204 No Content response with an empty body. This is standard REST behavior for DELETE operations.
Handling 204 Response
response.status === 204 to confirm success.Error Responses
Missing or invalid authentication credentials.
1{2 "detail": "Authentication required. Provide either 'x-api-key' header or 'Authorization: Bearer <token>'",3 "success": false4}
The mockup does not exist or is not owned by the authenticated user.
1{2 "detail": "Mockup not found",3 "success": false4}
An unexpected error occurred while processing the deletion.
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 or Bearer token |
| 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