---
title: "Get container logs"
method: GET
path: "/api/v1/deployments/{id}/container-logs"
tags: ["Deployments"]
---

# Get container logs

`GET /api/v1/deployments/{id}/container-logs`

## Request

- Base URL: `https://previewdrop.dev`
- URL: `https://previewdrop.dev/api/v1/deployments/{id}/container-logs`
- Auth: HTTP bearer

Returns the runtime stdout/stderr from the container that powers a deployment.

**When to use**

Call this after a deployment reaches `ready` status to inspect what the app is printing at runtime. Also useful when a container exits unexpectedly — the last output is retained.

**Availability**

Logs are streamed directly from the worker. If the worker is unreachable or the container has been removed (e.g. deployment is `expired` or `stopped`), `containerLog` will be an empty string.

**Tail**

Use the `tail` query parameter to limit how many lines are returned (1–1000). Defaults to 300.

## Path parameters

- `id` string, uuid, required

## Query parameters

- `tail` integer

## Response `200`

OK

- ContainerLogsResponse: Runtime stdout/stderr from the deployment container.
  - `containerLog` string, required: Raw runtime output from the container (last N lines). Empty string if the container has not printed anything or is no longer available.
  - `status` 'queued' | 'building' | 'deploying' | 'ready' | 'failed' | 'stopped' | 'expired', required: Current status of the deployment.

## Other responses

- `401`: Missing or invalid API key.
- `404`: The requested deployment does not exist or does not belong to your workspace.
- `429`: You have exceeded the rate limit. Check the `Retry-After` header for when to resume. The limit value reflects the specific endpoint's cap (10, 60, or 120 req/60s — see Rate Limits in the overview).

---

[API](https://skmtc.dev/previewdrop/apis/previewdrop-api.md) · [All operations](https://skmtc.dev/previewdrop/apis/previewdrop-api/llms.txt) · [OpenAPI document](https://skmtc.dev/previewdrop/apis/previewdrop-api/revisions/0742e253496b?raw)
