deploy-domains

Plan: Business or higher

Scope: projects:write

Builds and deploys the project. When the workspace blocks publishing on critical security findings, the quick security scan runs on the version being published first, and unresolved findings fail the request with 400 security_critical_findings. Returns 202 with the Deployment representation, status running, and null url and error fields; poll GET /v1/projects/{project_id}/publish/{deployment_id} until deployment finishes. Optionally set audience to choose who can open the published app; project reads report it as publish_audience. Omit audience to keep the current setting. Audience changes apply to the currently published version immediately, before the new deployment finishes. To change access settings without rebuilding, use PATCH /v1/projects/{project_id}/publish. To take the app offline, use DELETE /v1/projects/{project_id}/publish.

post/v1/projects/{project_id}/publish

Request

  • Base URL
    https://api.lovable.dev
  • Auth
    • API key in header Lovable-API-Key
    • or HTTP bearer

Path parameters

project_idstring required

Project ID.

Example:prj_01jw3k9m2xq8r5v0c7d4e6f2gh

Headers

Lovable-Versionstring

Stable API version to serve, as a YYYY-MM-DD date. Omit for the oldest supported stable version, currently 2026-09-11.

Lovable-Betastring

Comma-separated beta revision strings to enable on top of the stable version.

Request body

audience'public' | 'workspace' | 'custom'

Who can open the published app; project reads report this value as publish_audience. A custom audience can include existing grants managed in the UI. Omit to keep the current setting.

namestring

Slug for the managed published URL: acme-landing-page gives https://acme-landing-page.lovable.app. Custom domains and workspace branding can change the hostname.

Example request

{
  "audience": "custom",
  "audience_targets": [
    {
      "id": "grp_01jw3k9m2xq8r5v0c7d4e6f2gh",
      "type": "group"
    }
  ],
  "name": "acme-landing-page"
}

Response

Deployment started. Poll GET /v1/projects/{project_id}/publish/{deployment_id} (the Location header) with the returned id until deployment finishes.

error_class'transient' | 'code' | 'configuration' | 'data' | 'integration' | 'policy' | 'internal' | 'null' nullable required

Where to address the failure; see the operation description for the action for each class. Null when no failure category is available. More values may be added; for unknown values, show error_message and contact support instead of automatically retrying.

error_messagestring nullable required

Human-readable reason for a deployment failure; null unless the deployment failed.

idstring required

Deployment ID.

status'running' | 'completed' | 'error' | 'unknown' required

Deployment progress. running means the deployment was accepted and has not reported completion. completed means the deployment succeeded and url is set. unknown means the deployment exists but its workflow state has no recognized public mapping; it confirms neither success nor failure. Poll again with backoff and a bounded timeout, then report an indeterminate result if it persists. Unknown or mismatched deployment IDs return HTTP 404. Clients must tolerate new values.

urlstring nullable required

URL produced by this successful deployment; null until this deployment succeeds, even when an older version is published.

Example response

{
  "error_class": "configuration",
  "error_message": "Missing environment variable VITE_API_URL",
  "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
  "status": "completed",
  "url": "https://acme-landing-page.lovable.app"
}

Changes

    • breaking

      the request property became not nullable

    • info

      for the header request parameter Lovable-Version, the format was generalized from date to no format

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status