>_
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

Authentication

This endpoint supports dual authentication. You can use either method:

Recommended for SDK/API

API Key

x-api-key: sm_xxx...

Best for server-side integrations, automation workflows, and SDK implementations.

For Frontend/Dashboard

Bearer Token

Authorization: Bearer <jwt>

Best for frontend applications using Supabase authentication.

Request

Path Parameters

mockup_uuidstring (UUID)Required

The 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-keystring

Your SudoMock API key starting with sm_

Authorizationstring

Bearer token in the format: Bearer <jwt_token>

Code Examples (API Key)

Delete with API Key
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"

Code Examples (Bearer Token)

Delete with Bearer Token
bash
1curl -X DELETE "https://api.sudomock.com/api/v1/mockups/550e8400-e29b-41d4-a716-446655440000" \
2 -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."

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 credentials.

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}
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
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.