> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poultry.quader864.ir/llms.txt
> Use this file to discover all available pages before exploring further.

# Update flock hatch date and age tracking

> Update flock hatch date and age tracking

**Required capabilities:** `edit_analytics`.

**Auth middleware:** `verifyToken`.



## OpenAPI

````yaml /openapi.json post /api/v2/analytics/flock-age/{flockId}
openapi: 3.1.0
info:
  title: Poultry Farm Analytics API
  version: 2.0.0
  description: >-
    REST API for managing poultry farm inventory, flocks, cycles, analytics,
    anomalies, IoT devices, and operations. Most endpoints require a JWT bearer
    token; many additionally require specific capabilities (e.g.
    `view_analytics`, `manage_flocks`).
  contact:
    name: Poultry Farm API
    url: https://github.com/quader864/API-poultry-farm
servers:
  - url: http://localhost:3000
    description: Local development
  - url: https://api.example.com
    description: Production (replace with your deployment)
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: User signup, login, JWT verification, role management.
  - name: Dashboard
    description: Role-specific dashboard summaries.
  - name: Inventory
    description: Inventory movements for birds, feed and eggs.
  - name: Analytics V2
    description: >-
      Unified analytics: daily, cycle, breed, predictions, anomalies,
      financials.
  - name: Flock Analytics
    description: Per-flock analytics summary and metrics.
  - name: Rules
    description: Analytics rule engine.
  - name: Configuration
    description: Analytics configuration management.
  - name: Anomalies
    description: Detected anomalies and hypotheses.
  - name: Flocks
    description: Flock management.
  - name: Cycles
    description: Cycle-based inventory movements.
  - name: Schedules
    description: Feeding, vaccination, inspection schedules.
  - name: Predictive
    description: Failure forecasting and health predictions.
  - name: Compliance
    description: Compliance tracking.
  - name: Continuity
    description: Business continuity and disaster recovery.
  - name: Optimization
    description: Efficiency optimization and recommendations.
  - name: Sharing
    description: Resource sharing and transfers.
  - name: Operations
    description: Incident management.
  - name: Procurement
    description: 'Supply chain: orders and suppliers.'
  - name: IoT
    description: IoT devices and sensor data ingestion.
  - name: Scale
    description: Scale weight measurements.
  - name: Admin
    description: Admin control plane (admin-only).
paths:
  /api/v2/analytics/flock-age/{flockId}:
    post:
      tags:
        - Analytics V2
      summary: Update flock hatch date and age tracking
      description: |-
        Update flock hatch date and age tracking

        **Required capabilities:** `edit_analytics`.

        **Auth middleware:** `verifyToken`.
      operationId: post_api_v2_analytics_flock_age_ByFlockId
      parameters:
        - name: flockId
          in: path
          required: true
          schema:
            type: string
          description: flockId identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
              properties:
                hatchDate:
                  type: string
                  description: '`hatchDate` — see API source for exact type.'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  data:
                    type: object
                    additionalProperties: true
        '400':
          description: Bad Request — validation failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items:
                      type: object
        '401':
          description: Unauthorized — missing or invalid token
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '403':
          description: Forbidden — missing capability or unverified account
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT obtained from `POST /api/v1/auth/login`.

````