SudoMock
DELETE

Delete Mockup

Permanently delete a mockup and all associated files including layers, thumbnails, and rendered images.

DELETE/api/v1/mockups/{mockup_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-keystring

Your SudoMock API key starting with sm_. Required if not using Bearer token.

Authorizationstring

Bearer token (Supabase JWT). Format: Bearer <token>. Required if not using x-api-key.

Authentication

Provide either x-api-key or Authorization: Bearer <token>. At least one is required.

Path Parameters

mockup_uuidstringRequired

The 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 authentication. No valid API key or Bearer token was provided.

json
1{
2 "detail": "Authentication required. Provide either 'x-api-key' header or 'Authorization: Bearer <token>'",
3 "success": false
4}
404Not Found

The mockup does not exist or is not owned by the authenticated user.

json
1{
2 "detail": "Mockup not found",
3 "success": false
4}
429Too Many Requests

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):

json
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):

json
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": 5
9 }
10}
500Internal Server Error

An unexpected error occurred while processing the deletion.

json
1{
2 "detail": "Internal error while deleting mockup",
3 "success": false
4}

Error Handling

StatusMeaningAction
204Mockup deleted successfullyNo action needed
401Authentication failedCheck your API key or Bearer token
404Mockup not foundVerify the mockup UUID exists and belongs to your account
429Rate limit exceededWait for the duration specified in the Retry-After header, then retry
500Server errorRetry 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.
Delete Mockup Endpoint | SudoMock Docs