---
id: w3/m1/t002
title: REST adapter GET /v1/logs (Render-compatible)
worker: worker3
status: done
estimate: 40m
depends_on: [w3/m1/t001]
---

## Objective

Expose `Core.Logs` as a Render-compatible `GET /v1/logs` REST endpoint with filters for resource, log type, text search, time range, and limit.

## Context

- REST adapter is `operator/internal/api/rest.go`; it is pure presentation over `Core`.
- Render's Logs API returns a `{logs, cursor}`-style envelope; verify field shapes against `render-public-api-1.json` (same discipline used for the `{service, cursor}` list envelope in `docs/ADR006-bex-api.md`).
- Query params observed on Render's `/logs` page: resource (App id), log type (`all`/`application`/`request`), full-text search, time range (start/end), limit.

## Steps

1. Add `GET /v1/logs` handler (and `/v1/apps`-consistent aliasing if applicable) in `rest.go`.
2. Parse `resource`, `type`, `text`/`q`, `startTime`/`endTime`, `limit`; map to `Core.Logs` opts.
3. Return the Render-shaped envelope; verify against `render-public-api-1.json`.

## Files

- `operator/internal/api/rest.go`
- `operator/internal/api/server.go` (route wiring, if needed)

## Acceptance criteria

- [ ] `GET /v1/logs?resource=<app>&type=application` returns filtered logs in the Render-shaped envelope.
- [ ] Text search and time-range filters work.
- [ ] Envelope fields verified against `render-public-api-1.json`.

## Out of scope

- Live follow (t003), GraphQL (t005), request-log sourcing (t004).
