Delete project
You can delete a project programmatically through the Lovable API. Deleting immediately disconnects custom domains, though projects can be restored from trash in the editor if your plan supports it.
Workspace administrators and developers on a Business plan or higher who need to clean up or automate project removal.
Do this, in order
- 1
Create an API key with the projects:write permission scope in your Lovable workspace settings.
This endpoint requires an authenticated key with project modification permissions and a Business or higher subscription.
- 2
Send a DELETE request to https://api.lovable.dev/v1/projects/{project_id} passing your API key in the Lovable-API-Key or Authorization header.
This deletes the project and immediately disconnects any custom domains attached to it.
- 3
Handle HTTP 204 as success, and treat HTTP 404 (project_not_found) as success when retrying.
A 404 status indicates the project has already been deleted, meaning the intended outcome is achieved.
Paste this into your project
Create an integration function that calls the Lovable API to delete a project. Have it send a DELETE request to https://api.lovable.dev/v1/projects/{projectId} using the Lovable-API-Key and Lovable-Version: 2026-09-11 headers. Ensure the logic treats both HTTP 204 and HTTP 404 responses as successful deletions, and warn the user that custom domains disconnect immediately.Words decoded
- projects:write
- A specific permission setting on an API key that allows modifying or deleting projects.
- 204 No Content
- A standard success message meaning the server completed your delete request without needing to return any new information.
- 404 project_not_found
- A status code indicating the specified project does not exist or was already deleted.
Where people get stuck
- Any custom domains attached to the project disconnect immediately once the deletion request succeeds.
- If trash recovery is not available in your editor, project deletion is permanent and cannot be undone.
- Requests will fail with a 402 or 403 error if your workspace is not on a Business or higher plan or your key lacks the projects:write scope.
- If your code retries a delete command, it will receive a 404 error because the project is already gone; your application should treat this as a successful delete rather than an error.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.