KBAISE/ for lovable
Library
Docs

Publish project

about 10 minShippingchecked 7d agoOfficial page
The short version

You can trigger and publish a new build of your project programmatically using Lovable's automated API. The request starts the build in the background and reports back once your live app is ready.

Teams on a Business plan or higher who want to automate deployments from external tools or scripts.

Do this, in order

  1. 1

    Generate an API key in your workspace settings and give it write permissions for projects.

    The publish endpoint requires authorized access before it will accept build commands.

  2. 2

    Fix any flagged critical security issues in your project before attempting to deploy.

    Workspaces configured with security checks will reject publishing if critical findings remain unresolved.

  3. 3

    Send a POST request to the publish address for your project ID, optionally choosing your target audience.

    This starts the background build and returns an identifier to monitor the job.

  4. 4

    Check the status of your build identifier every few seconds until the status reports completed.

    Publishing takes time to build, and the live web address is only provided once the deployment finishes.

Paste this into your project

Write a clean TypeScript utility function that publishes a project via the Lovable API by sending a POST request to https://api.lovable.dev/v1/projects/{project_id}/publish with an API key, handles security scan errors gracefully, and polls the deployment status until it completes or fails.

Words decoded

Endpoint
A specific web address used by automated programs to talk to Lovable.
Polling
Checking back repeatedly every few seconds to see if a background job has finished.
Deployment
The process of building your app's code and placing it live on the web.
Audience
The permission setting that controls who is allowed to access and view your published app.

Where people get stuck

  • Unresolved critical security findings will cause the request to fail immediately if your workspace enforces security blocking.
  • Changing the audience setting updates your currently live site right away, even before the new deployment finishes building.
  • The initial response only confirms the build has started; you must check the deployment status endpoint to get the final live URL.
  • Checking status more frequently than once every two seconds can trigger rate limits.

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.