---
title: "Retrieve branch logs"
method: POST
path: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/logs"
tags: ["Branches", "Logs"]
---

# Retrieve branch logs

`POST /organizations/{organizationID}/projects/{projectID}/branches/{branchID}/logs`

## Request

- Base URL: `https://api.xata.tech`
- URL: `https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/logs`
- Auth: OAuth 2
  - Implicit: `https://auth.xata.io/realms/xata/protocol/openid-connect/auth`
  - Scopes: `logs:read`

## Path parameters

- `organizationID` string, required
- `projectID` string, required
- `branchID` string, required

## Request body

- BranchLogsRequest
  - `start` string, date-time, required: Start time
  - `end` string, date-time, required: End time
  - `filters` LogFilter[]: Filters applied to log entries. Multiple filters are combined with AND.
    - `field` 'instance' | 'level' | 'process' | 'body', required: Log attribute to filter on.
    - `op` 'in' | 'contains' | 'icontains' | 'regex' | 'iregex', required: Match operator.
    - `values` string[]: Used with `op: in`.
    - `value` string: Used with the body operators.
  - `limit` integer
  - `cursor` string: Pagination cursor from a previous response

## Response `200`

Logs for a branch

- BranchLogs: A collection of logs for each of the instances of a branch
  - `start` string, date-time, required
  - `end` string, date-time, required
  - `logs` LogEntry[], required
    - `timestamp` string, date-time, required
    - `instanceID` string, required
    - `level` 'debug' | 'info' | 'warning' | 'error': Log level enumeration
    - `message` string, required
    - `process` string: Name of the PostgreSQL process that emitted the log
  - `nextCursor` string, nullable, required: Pagination cursor for the next page

## Other responses

- `400`: Generic error response for most error conditions
- `401`: Error response when authentication or authorization fails
- `404`: Generic error response for most error conditions
- `5XX`: Unexpected Error
- `default`: Unexpected Error

## Changes

- **2026-06-10** `aa5e8e8c3138`: 1 breaking
  - the `limit` request property's max was decreased to `200.00`
- **2026-04-29** `37a0dbdfc13d`: 1 info
  - endpoint added
- **2026-04-15** `a2cc5189d200`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/xataio/apis/xata-api/changes/organizations/:organizationID/projects/:projectID/branches/:branchID/logs/post.md)

---

[API](https://skmtc.dev/xataio/apis/xata-api.md) - [All operations](https://skmtc.dev/xataio/apis/xata-api/llms.txt) - [OpenAPI document](https://skmtc.dev/xataio/apis/xata-api/revisions/4bc5ad58a6c6?raw)
