---
title: "Traceability Report"
method: GET
path: "/v1/farm/{farm_id}/traceability-report"
tags: ["traceability"]
---

# Traceability Report

`GET /v1/farm/{farm_id}/traceability-report`

## Request

- Base URL: `https://api.ranch.bot`
- URL: `https://api.ranch.bot/v1/farm/{farm_id}/traceability-report`
- Auth: HTTP bearer

Farm-record completeness report over typed events; movement gap checks, identification basis, sent/received discrepancies, and a separate legacy-unstructured section. `kind` and `movement` filters intersect (AND). Typed events paginate in stable `created_at DESC, id DESC` order; `events`/`rows_for_export` are the selected page while coverage describes all matching events. `format=csv` validates the filters, ignores pagination, and exports up to 100,000 typed-event rows (no legacy or metadata rows). Independent of the ENABLE_REPORTS gate; not an official submission.

## Path parameters

- `farm_id` string, uuid, required

## Query parameters

- `kind` 'MOVEMENT' | 'PURCHASE' | 'SALE' | 'IMPORT' | 'EXPORT' | 'DEATH' | 'SLAUGHTER' | 'DISPOSAL' | 'IDENTIFICATION'
- `movement` boolean
- `date_basis` 'effective' | 'departure' | 'arrival'
- `from` string, date
- `to` string, date
- `take` integer
- `skip` integer
- `animal_id` string
- `identifier` string
- `location_id` string
- `include_void` boolean
- `include_legacy` boolean
- `format` 'json' | 'csv'

## Response `200`

Report

- object
  - `generated_at` string, required
  - `date_basis` string, required
  - `coverage` object, required
  - `events` object[], required
  - `legacy` object[], required
  - `disclaimer` string, required

## Other responses

- `400`: Validation failed.
- `401`: Missing/invalid authentication or role.
- `403`: Missing required credential scope.

---

[API](https://skmtc.dev/ranch/apis/ranch-bot-http-api.md) · [All operations](https://skmtc.dev/ranch/apis/ranch-bot-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ranch/apis/ranch-bot-http-api/revisions/24109d33fa02?raw)
