---
title: "Build and deploy log (by line offset)"
method: GET
path: "/deployments/{deploymentId}/logs"
tags: ["Deployments"]
---

# Build and deploy log (by line offset)

`GET /deployments/{deploymentId}/logs`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/deployments/{deploymentId}/logs`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `deploymentId` string, uuid, required

## Query parameters

- `since` integer, nullable: Line offset: the number of log lines already received (0-based index of the first line to return). The build log is append-only, so offsets are stable; send the previous response's nextSince. Beyond the end: no lines, nextSince = line count.

## Response `200`

Lines [since, nextSince) of the build log (at most 5000); complete=true once the deployment finished

- object
  - `lines` object[], required
    - `ts` string, nullable, required: ISO-8601 timestamp
    - `stream` 'stdout' | 'stderr' | 'system', required
    - `message` string, required
  - `complete` boolean, required: true when the deployment finished and its whole log was read (false while the engine is too busy to read the end of a finished build: ask again)
  - `since` integer, required: the line offset this page starts at (the request's since, capped at the log length)
  - `nextSince` integer, required: send this as ?since= to receive only later lines

## Other responses

- `400`: Invalid request (code invalid_request)
- `401`: Missing or invalid session/token (code unauthorized)
- `403`: Authenticated but not permitted (code forbidden)
- `404`: Not found or not visible to the caller (code not_found)
- `409`: Conflicting state (code conflict)
- `429`: Too many requests (code rate_limited); see Retry-After
- `503`: Hosting engine unavailable (code provider_unavailable)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
