# Get an APK build's status and download link.

GET https://services.leadconnectorhq.com/ai-builder-api/projects/{projectId}/app-config/apk-builds/{apkBuildId}

Read it again until `status` is `finished`, when `artifactUrl` is a short-lived download link, or `failed`, when `error` says why.

## 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 app's id. |
| `apkBuildId` | string | Yes | The build's id, from the response that started it. |

## 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}/app-config/apk-builds/{apkBuildId}": {
      "get": {
        "summary": "Get an APK build's status and download link.",
        "operationId": "getAnApkBuildsStatusAndDownloadLink",
        "description": "Read it again until `status` is `finished`, when `artifactUrl` is a short-lived download link, or `failed`, when `error` says why.",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "description": "The app's id.",
            "example": "prj_a7ca4adc-be67-40ff-ae79-4f5acf56ac67",
            "schema": {
              "type": "string",
              "pattern": "^prj_[A-Za-z0-9_-]+$"
            }
          },
          {
            "in": "path",
            "name": "apkBuildId",
            "required": true,
            "description": "The build's id, from the response that started it.",
            "example": "apk_3f1c0b9e2d4a6f8e0c1b3d5f7a9e2c4b",
            "schema": {
              "type": "string",
              "pattern": "^apk_[a-f0-9]{32}$"
            }
          },
          {
            "name": "Version",
            "in": "header",
            "required": true,
            "description": "The API version.",
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current durable APK build state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MobileApkBuild"
                }
              }
            }
          },
          "404": {
            "description": "Build is not owned by this project and authenticated location."
          }
        },
        "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": {
      "MobileApkBuild": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "projectId",
          "revision",
          "appName",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^apk_[a-f0-9]{32}$",
            "description": "The build's id.",
            "example": "apk_3f1c0b9e2d4a6f8e0c1b3d5f7a9e2c4b"
          },
          "projectId": {
            "type": "string",
            "pattern": "^prj_[A-Za-z0-9_-]+$",
            "description": "The app's id.",
            "example": "prj_a7ca4adc-be67-40ff-ae79-4f5acf56ac67"
          },
          "revision": {
            "type": "integer",
            "minimum": 1,
            "description": "The revision the APK is built from.",
            "example": 4
          },
          "appName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "The app's name on the device.",
            "example": "Run Club"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "building",
              "finished",
              "failed"
            ],
            "description": "Where the build is. Read it again until `finished` or `failed`.",
            "example": "building"
          },
          "artifactUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://",
            "description": "Short-lived signed GCS URL for the archived APK. Expo artifact URLs are never exposed.",
            "example": "https://storage.googleapis.com/apk-artifacts/prj_a7ca4adc/apk_3f1c0b9e.apk?X-Goog-Signature=abc"
          },
          "error": {
            "type": "string",
            "description": "Creator-facing summary of why the build failed, safe to render as-is. Raw EAS, npm, or Gradle console output is never returned here; it stays in the build worker log.",
            "example": "The Android build failed. Try again, or contact support if it keeps failing."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the build was requested.",
            "example": "2026-10-23T11:30:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the build last changed state.",
            "example": "2026-10-23T11:34:00.000Z"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the build finished or failed.",
            "example": "2026-10-23T11:42:00.000Z"
          }
        },
        "title": "MobileApkBuild"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/ai-builder-api/projects/<projectId>/app-config/apk-builds/<apkBuildId>' \
  -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>/app-config/apk-builds/<apkBuildId>', 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}/app-config/apk-builds/{apkBuildId}"

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>/app-config/apk-builds/<apkBuildId>',
  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>/app-config/apk-builds/<apkBuildId>")
  .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>/app-config/apk-builds/<apkBuildId>"
  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>/app-config/apk-builds/<apkBuildId>")

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>/app-config/apk-builds/<apkBuildId>' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
