---
title: Get Build
protocol: rest
method: GET
endpoint: /v1/projects/{projectId}/builds/{buildId}
description: "Get details for a specific build"
---

# Get Build

Retrieve detailed information about a specific build, including logs.

<Endpoint method="GET" path="/v1/projects/{projectId}/builds/{buildId}" />

## Path Parameters

<ParamField path="projectId" type="string" required>
  The project ID (e.g., `prj_abc123`).
</ParamField>

<ParamField path="buildId" type="string" required>
  The build ID (e.g., `bld_xyz789`).
</ParamField>

## Response

<ResponseField name="data" type="object">
  The build object with full details.

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Build identifier.
    </ResponseField>

    <ResponseField name="status" type="string">
      Build status: `queued`, `building`, `deployed`, `failed`.
    </ResponseField>

    <ResponseField name="trigger" type="string">
      What triggered the build.
    </ResponseField>

    <ResponseField name="branch" type="string">
      Git branch.
    </ResponseField>

    <ResponseField name="commitSha" type="string">
      Git commit SHA.
    </ResponseField>

    <ResponseField name="commitMessage" type="string">
      Git commit message.
    </ResponseField>

    <ResponseField name="isPreview" type="boolean">
      Whether this is a preview deployment.
    </ResponseField>

    <ResponseField name="url" type="string">
      Deployed URL.
    </ResponseField>

    <ResponseField name="duration" type="integer">
      Build duration in milliseconds.
    </ResponseField>

    <ResponseField name="filesChanged" type="array">
      List of files changed in this commit.
    </ResponseField>

    <ResponseField name="pagesBuilt" type="integer">
      Number of pages compiled.
    </ResponseField>

    <ResponseField name="logs" type="array">
      Build log entries.

      <Expandable title="Log entry">
        <ResponseField name="timestamp" type="string">
          ISO 8601 timestamp.
        </ResponseField>

        <ResponseField name="level" type="string">
          Log level: `info`, `warn`, `error`.
        </ResponseField>

        <ResponseField name="message" type="string">
          Log message.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="error" type="object">
      Error details if build failed.

      <Expandable title="properties">
        <ResponseField name="code" type="string">
          Error code.
        </ResponseField>

        <ResponseField name="message" type="string">
          Error description.
        </ResponseField>

        <ResponseField name="file" type="string">
          File that caused the error.
        </ResponseField>

        <ResponseField name="line" type="integer">
          Line number.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp.
    </ResponseField>

    <ResponseField name="deployedAt" type="string">
      ISO 8601 timestamp when deployment completed.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<CodeGroup>
```bash cURL
curl https://api.syntext.dev/v1/projects/prj_abc123/builds/bld_xyz789 \
  -H "Authorization: Bearer stx_abc12345_..."
```

```typescript SDK
import { Syntext } from '@syntext/sdk'

const client = new Syntext('stx_abc12345_...')
const build = await client.builds.get('prj_abc123', 'bld_xyz789')
```

```python Python
from syntext import Syntext

client = Syntext("stx_abc12345_...")
build = client.builds.get("prj_abc123", "bld_xyz789")
```
</CodeGroup>

### Response

```json
{
  "data": {
    "id": "bld_xyz789",
    "status": "deployed",
    "trigger": "push",
    "branch": "main",
    "commitSha": "a1b2c3d4e5f6",
    "commitMessage": "Update API documentation",
    "isPreview": false,
    "url": "https://api-docs-docs.syntext.dev",
    "duration": 4523,
    "filesChanged": [
      "docs/api-reference/overview.mdx",
      "docs/api-reference/endpoints.mdx"
    ],
    "pagesBuilt": 24,
    "logs": [
      {
        "timestamp": "2026-06-28T10:00:00Z",
        "level": "info",
        "message": "Build started"
      },
      {
        "timestamp": "2026-06-28T10:00:02Z",
        "level": "info",
        "message": "Compiling 24 pages..."
      },
      {
        "timestamp": "2026-06-28T10:00:04Z",
        "level": "info",
        "message": "Uploading to CDN..."
      },
      {
        "timestamp": "2026-06-28T10:00:05Z",
        "level": "info",
        "message": "Deployment complete"
      }
    ],
    "createdAt": "2026-06-28T10:00:00Z",
    "deployedAt": "2026-06-28T10:00:05Z"
  }
}
```

## Error Responses

### 404 Not Found

Returned when the project or build does not exist.

```json
{
  "error": {
    "code": "not_found",
    "message": "Build or project does not exist"
  }
}
```

### 401 Unauthorized

Returned when authentication is missing or invalid.

```json
{
  "error": {
    "code": "unauthorized",
    "message": "Invalid or missing API key"
  }
}
```
