# Get a project by id.

GET https://services.leadconnectorhq.com/ai-builder-api/projects/{projectId}

Returns one app: its status, publication state, preview and production URLs, and its latest run.

## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `clientportal-ai.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | The API version. |

### Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `projectId` | string | Yes | The project's id. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ai-builder-api/projects/{projectId}": {
      "get": {
        "summary": "Get a project by id.",
        "operationId": "getAProjectById",
        "description": "Returns one app: its status, publication state, preview and production URLs, and its latest run.",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^prj_[A-Za-z0-9_-]+$"
            },
            "description": "The project's id.",
            "example": "prj_5f0c2a3e"
          },
          {
            "name": "Version",
            "in": "header",
            "required": true,
            "description": "The API version.",
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "clientportal-ai.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A sub-account access token: a Marketplace app's OAuth token or a Private Integration Token."
      }
    },
    "schemas": {
      "Project": {
        "type": "object",
        "required": [
          "id",
          "name",
          "locationId",
          "companyId",
          "ownerUserId",
          "createdByUserId",
          "visibility",
          "status",
          "stackTemplate",
          "productTarget",
          "targetModes",
          "dataPlaneMode",
          "hostingMode",
          "createdAt",
          "updatedAt",
          "etag"
        ],
        "properties": {
          "id": {
            "type": "string",
            "example": "prj_01HXQ8Z6J9K2",
            "description": "The project's id."
          },
          "name": {
            "type": "string",
            "example": "Client Booking Portal",
            "description": "The app's name, shown to members."
          },
          "locationId": {
            "type": "string",
            "example": "loc_01HXQ8Z6J9K2",
            "description": "The sub-account the project belongs to."
          },
          "companyId": {
            "type": "string",
            "example": "cmp_01HXQ8Z6J9K2",
            "description": "The agency the sub-account belongs to."
          },
          "ownerUserId": {
            "type": "string",
            "example": "usr_01HXQ8Z6J9K2",
            "description": "The user who owns the project."
          },
          "createdByUserId": {
            "type": "string",
            "example": "usr_01HXQ8Z6J9K2",
            "description": "The user who created the project."
          },
          "visibility": {
            "description": "Who in the sub-account can see the project.",
            "type": "string",
            "enum": [
              "private",
              "shared"
            ],
            "title": "ProjectVisibility"
          },
          "slug": {
            "type": "string",
            "example": "client-booking-portal",
            "description": "URL-safe form of the name."
          },
          "status": {
            "description": "Where the project is in its lifecycle.",
            "type": "string",
            "enum": [
              "draft",
              "queued",
              "planning",
              "building",
              "previewing",
              "deploying",
              "deployed",
              "blocked",
              "archived",
              "deleted"
            ],
            "title": "ProjectStatus"
          },
          "publicationStatus": {
            "description": "Stable publication state, independent from the mutable run/build status. `published` means a successful publish activated at least the managed platform hostname; later draft edits do not change it. Legacy records without this field are interpreted as `draft` unless `productionUrl` is present.",
            "type": "string",
            "enum": [
              "draft",
              "published"
            ],
            "title": "ProjectPublicationStatus"
          },
          "stackTemplate": {
            "description": "The kernel the project is built on.",
            "type": "string",
            "enum": [
              "react_native_app_kernel_v1",
              "nuxt_clientportal_app_v1",
              "nuxt_clientportal_vibe_v1",
              "auto"
            ],
            "title": "StackTemplate"
          },
          "templateId": {
            "description": "Starter-template id (e.g. `events-v1`) the project was instantiated from.\nDrives the scaffold overlay byte-copy and, on the first build run, the\n`instantiate` workflow mode (scaffold + finished overlay, no codegen).\nAbsent for projects built from a bare prompt. Project-scoped — set at\ncreation, never accepted on the run submit body.\n",
            "type": "string",
            "example": "events-v1"
          },
          "mobileCreation": {
            "description": "How a mobile project started: from scratch or from the CP Base App.",
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "startingPoint"
                ],
                "properties": {
                  "startingPoint": {
                    "type": "string",
                    "enum": [
                      "scratch"
                    ],
                    "description": "Started from scratch.",
                    "example": "scratch"
                  }
                }
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "startingPoint",
                  "templateId",
                  "templateVersion"
                ],
                "properties": {
                  "startingPoint": {
                    "type": "string",
                    "enum": [
                      "cp_base"
                    ],
                    "description": "Started from the CP Base App.",
                    "example": "cp_base"
                  },
                  "templateId": {
                    "type": "string",
                    "enum": [
                      "cp-base"
                    ],
                    "description": "The template it started from.",
                    "example": "cp-base"
                  },
                  "templateVersion": {
                    "type": "string",
                    "enum": [
                      "1"
                    ],
                    "description": "The template's version.",
                    "example": "1"
                  }
                }
              }
            ],
            "title": "MobileCreation"
          },
          "appMode": {
            "description": "App branding mode persisted at project creation. `cp_branded` connects the app to the location's Client Portal modules.",
            "type": "string",
            "enum": [
              "standard",
              "cp_branded"
            ],
            "title": "AppMode"
          },
          "productTarget": {
            "description": "What the project builds.",
            "type": "string",
            "enum": [
              "full_stack",
              "mobile",
              "landing_page"
            ],
            "title": "ProductTarget"
          },
          "targetModes": {
            "description": "Immutable surfaces owned by the project. New projects contain exactly one\nvalue derived by the server from `productTarget`: full-stack and landing-page\nprojects resolve to `web`; native Expo/React Native projects resolve to\n`mobile`. Existing combined Client Portal projects may contain both values.\n",
            "type": "array",
            "items": {
              "type": "string",
              "description": "Legacy internal runtime lane. `mobile` means native mobile/Expo, not responsive web.",
              "enum": [
                "web",
                "mobile"
              ],
              "title": "TargetMode"
            },
            "example": [
              "web"
            ]
          },
          "dataPlaneMode": {
            "description": "Where the app's data lives.",
            "type": "string",
            "enum": [
              "managed_mongo"
            ],
            "title": "DataPlaneMode"
          },
          "hostingMode": {
            "description": "Where the app is hosted.",
            "type": "string",
            "enum": [
              "managed",
              "byo_vercel"
            ],
            "title": "HostingMode"
          },
          "apiContractVersion": {
            "type": "string",
            "example": "2026-04-27",
            "description": "The API contract version the project was created under."
          },
          "latestRunId": {
            "type": "string",
            "example": "run_01HXQ9ABCD12",
            "description": "The project's most recent run."
          },
          "latestDeploymentId": {
            "type": "string",
            "example": "dep_01HXQ8Z6J9K2",
            "description": "The project's most recent deployment."
          },
          "previewUrl": {
            "type": "string",
            "format": "uri",
            "description": "Where to preview the latest build.",
            "example": "https://preview.example.com/my-portal"
          },
          "productionUrl": {
            "type": "string",
            "format": "uri",
            "description": "Where the published app is served.",
            "example": "https://my-portal.example.com"
          },
          "thumbnailUrl": {
            "type": "string",
            "format": "uri",
            "description": "Screenshot of the app's home page, taken after its latest successful build. Absent until\na build has produced one; clients show their own placeholder then.\n",
            "example": "https://storage.googleapis.com/ai-builder-public-experiences-staging/project-thumbnails/5f0c2a3e-8d41-4c4b-9a35-0d1e6b7f2c91.jpg"
          },
          "preferredMode": {
            "type": "string",
            "enum": [
              "auto",
              "plan",
              "build"
            ],
            "description": "The user's last-selected run mode for this project. The composer's\n3-way segmented control rehydrates from this value when the\nproject is opened so the user's preference survives reloads.\nUpdated server-side every time a new run is submitted with an\nexplicit `mode` value (or via `PATCH /projects/{projectId}`).\n",
            "example": "auto"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the project was created.",
            "example": "2026-10-01T08:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the project last changed.",
            "example": "2026-10-15T09:41:12.000Z"
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the project was archived, if it was.",
            "example": "2026-10-20T12:00:00.000Z"
          },
          "starred": {
            "type": "boolean",
            "description": "Pinned by its owner so it sorts to the top of their project list. Absent means not starred; there is no per-viewer state — a project is starred for the location, like its name.",
            "example": true
          },
          "hasMobileSources": {
            "type": "boolean",
            "readOnly": true,
            "description": "True when this project's current mobile revision carries generated source (`documents.clientportal.mobile.sources` on its app configuration), so its phone preview must be framed from the project's own sandbox rather than the shared stock host. Read from the authenticated location's revision only. Returned by `GET /api/v1/projects/{projectId}`; list, create and update responses omit it, and an absent value means `false`.",
            "example": false
          },
          "etag": {
            "type": "string",
            "example": "W/\"project-12\"",
            "description": "The project's version tag, for conditional updates."
          }
        },
        "title": "Project"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ai-builder-api/projects/{projectId}"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
