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
Request
Headers
x-api-keystringYour SudoMock API key starting with sm_. Required if not using Bearer token.
AuthorizationstringBearer token (Supabase JWT). Format: Bearer <token>. Required if not using x-api-key.
Authentication
x-api-key or Authorization: Bearer <token>. At least one is required.Path Parameters
mockup_uuidstringRequiredThe unique identifier of the mockup to delete. You receive this UUID when uploading a PSD file.
Code Examples
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
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. No valid API key or Bearer token was provided.
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}
Rate limit or concurrent request limit exceeded. The response includes a Retry-After header indicating how many seconds to wait before retrying. There are two types of 429 responses:
Rate limit exceeded (token bucket, 1000 requests per minute):
1{2 "detail": "Rate limit exceeded. Please slow down and try again.",3 "error": {4 "type": "rate_limit_exceeded",5 "code": "RATE_LIMIT_EXCEEDED",6 "limit": 1000,7 "remaining": 0,8 "reset_seconds": 30,9 "retry_after": 30,10 "resource": "api"11 }12}
Concurrent request limit exceeded (plan-based parallel request limit):
1{2 "detail": "Max concurrent render requests exceeded. Your plan (Free) allows 1 concurrent render request(s).",3 "error": {4 "type": "concurrent_limit_exceeded",5 "code": "CONCURRENT_LIMIT_EXCEEDED",6 "limit": 1,7 "current": 1,8 "retry_after": 59 }10}
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 |
| 429 | Rate limit exceeded | Wait for the duration specified in the Retry-After header, then retry |
| 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