{
    "name": "Showsafe Breeding Pro API",
    "version": "1.0",
    "base_url": "https://breedingpro.showsafe.show/api/v1",
    "authentication": {
        "methods": [
            {
                "type": "bearer_token",
                "header": "Authorization: Bearer {jwt_token}",
                "description": "JWT token from /auth/login endpoint"
            },
            {
                "type": "api_key",
                "header": "X-API-Key: {api_key}",
                "description": "API key for Pro subscribers (programmatic access)"
            }
        ]
    },
    "rate_limits": {
        "jwt_auth": {
            "description": "Standard authenticated requests",
            "limits": "Based on subscription tier"
        },
        "api_key": {
            "requests_per_minute": 60,
            "requests_per_day": 10000,
            "max_keys": 5
        }
    },
    "response_format": {
        "success": {
            "success": true,
            "message": "Operation completed",
            "data": "{ ... }"
        },
        "error": {
            "success": false,
            "error": "Error message",
            "code": 400
        }
    },
    "endpoints": [
        {
            "category": "Authentication",
            "endpoints": [
                {
                    "method": "POST",
                    "path": "/auth/login",
                    "description": "Authenticate and get JWT token",
                    "body": {
                        "email": "string",
                        "password": "string"
                    },
                    "auth_required": false
                },
                {
                    "method": "POST",
                    "path": "/auth/register",
                    "description": "Create new account",
                    "body": {
                        "name": "string",
                        "email": "string",
                        "password": "string"
                    },
                    "auth_required": false
                },
                {
                    "method": "POST",
                    "path": "/auth/refresh",
                    "description": "Refresh JWT token",
                    "auth_required": true
                },
                {
                    "method": "GET",
                    "path": "/auth/me",
                    "description": "Get current user profile",
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Horses",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/horses",
                    "description": "List all horses",
                    "query_params": {
                        "type": "mare|stallion|gelding",
                        "status": "active|inactive"
                    },
                    "auth_required": true
                },
                {
                    "method": "GET",
                    "path": "/horses/{id}",
                    "description": "Get horse details",
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/horses",
                    "description": "Create new horse",
                    "body": {
                        "name": "string (required)",
                        "type": "mare|stallion|gelding (required)",
                        "breed": "string",
                        "registration_number": "string",
                        "date_of_birth": "YYYY-MM-DD",
                        "color": "string"
                    },
                    "auth_required": true
                },
                {
                    "method": "PUT",
                    "path": "/horses/{id}",
                    "description": "Update horse",
                    "auth_required": true
                },
                {
                    "method": "DELETE",
                    "path": "/horses/{id}",
                    "description": "Delete horse",
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Breeding Records",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/breeding",
                    "description": "List breeding records",
                    "query_params": {
                        "mare_id": "int",
                        "stallion_id": "int",
                        "status": "string"
                    },
                    "auth_required": true
                },
                {
                    "method": "GET",
                    "path": "/breeding/active",
                    "description": "Get active breeding cycles",
                    "auth_required": true
                },
                {
                    "method": "GET",
                    "path": "/breeding/{id}",
                    "description": "Get breeding record details",
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/breeding",
                    "description": "Create breeding record",
                    "body": {
                        "mare_id": "int (required)",
                        "stallion_id": "int (required)",
                        "breeding_date": "YYYY-MM-DD (required)",
                        "breeding_type": "live_cover|fresh_ai|cooled_ai|frozen_ai",
                        "notes": "string"
                    },
                    "auth_required": true
                },
                {
                    "method": "PUT",
                    "path": "/breeding/{id}",
                    "description": "Update breeding record",
                    "auth_required": true
                },
                {
                    "method": "DELETE",
                    "path": "/breeding/{id}",
                    "description": "Delete breeding record",
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Semen Collections",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/semen-collections",
                    "description": "List semen collections",
                    "query_params": {
                        "stallion_id": "int"
                    },
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/semen-collections",
                    "description": "Record new collection",
                    "body": {
                        "stallion_id": "int (required)",
                        "collection_date": "YYYY-MM-DD (required)",
                        "volume_ml": "float",
                        "concentration": "float",
                        "motility_percent": "int",
                        "morphology_percent": "int"
                    },
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Heat Cycles",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/heat-cycles",
                    "description": "List heat cycle records",
                    "query_params": {
                        "mare_id": "int"
                    },
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/heat-cycles",
                    "description": "Record heat cycle",
                    "body": {
                        "mare_id": "int (required)",
                        "start_date": "YYYY-MM-DD (required)",
                        "end_date": "YYYY-MM-DD",
                        "intensity": "1-5",
                        "notes": "string"
                    },
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Veterinary Exams",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/exams",
                    "description": "List exams",
                    "query_params": {
                        "horse_id": "int",
                        "type": "string"
                    },
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/exams",
                    "description": "Record new exam",
                    "body": {
                        "horse_id": "int (required)",
                        "exam_type": "string (required)",
                        "exam_date": "YYYY-MM-DD (required)",
                        "findings": "string",
                        "recommendations": "string"
                    },
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Foaling",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/foaling",
                    "description": "List foaling records",
                    "auth_required": true
                },
                {
                    "method": "GET",
                    "path": "/foaling/expected",
                    "description": "Get expected foaling dates",
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/foaling",
                    "description": "Record foaling",
                    "body": {
                        "breeding_id": "int (required)",
                        "foaling_date": "YYYY-MM-DD (required)",
                        "foal_sex": "colt|filly",
                        "foal_color": "string",
                        "complications": "string"
                    },
                    "auth_required": true
                }
            ]
        },
        {
            "category": "Reports",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/reports/conception-rate",
                    "description": "Get conception rate report",
                    "query_params": {
                        "format": "json|csv|html",
                        "period": "year|all"
                    },
                    "auth_required": true,
                    "tier": "Farm+"
                },
                {
                    "method": "GET",
                    "path": "/reports/pregnancy-status",
                    "description": "Get pregnancy status report",
                    "query_params": {
                        "format": "json|csv|html"
                    },
                    "auth_required": true,
                    "tier": "Farm+"
                },
                {
                    "method": "GET",
                    "path": "/reports/stallion-performance",
                    "description": "Get stallion performance report",
                    "query_params": {
                        "format": "json|csv|html",
                        "stallion_id": "int"
                    },
                    "auth_required": true,
                    "tier": "Farm+"
                },
                {
                    "method": "GET",
                    "path": "/reports/mare-history",
                    "description": "Get mare breeding history",
                    "query_params": {
                        "format": "json|csv|html",
                        "mare_id": "int"
                    },
                    "auth_required": true,
                    "tier": "Farm+"
                }
            ]
        },
        {
            "category": "Marketplace",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/marketplace",
                    "description": "List marketplace listings",
                    "query_params": {
                        "category": "horses|semen|services",
                        "status": "active"
                    },
                    "auth_required": true,
                    "tier": "Farm+"
                },
                {
                    "method": "POST",
                    "path": "/marketplace",
                    "description": "Create listing",
                    "auth_required": true,
                    "tier": "Farm+"
                }
            ]
        },
        {
            "category": "Team Management",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/team",
                    "description": "List team members",
                    "auth_required": true,
                    "tier": "Farm+"
                },
                {
                    "method": "POST",
                    "path": "/team/invite",
                    "description": "Invite team member",
                    "body": {
                        "email": "string (required)",
                        "role": "admin|manager|viewer"
                    },
                    "auth_required": true,
                    "tier": "Farm+"
                },
                {
                    "method": "DELETE",
                    "path": "/team/{id}",
                    "description": "Remove team member",
                    "auth_required": true,
                    "tier": "Farm+"
                }
            ]
        },
        {
            "category": "API Keys",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/api-keys",
                    "description": "List your API keys",
                    "auth_required": true,
                    "tier": "Pro"
                },
                {
                    "method": "POST",
                    "path": "/api-keys",
                    "description": "Create new API key",
                    "body": {
                        "name": "string (required)",
                        "permissions": "array (read, write, delete)"
                    },
                    "auth_required": true,
                    "tier": "Pro"
                },
                {
                    "method": "DELETE",
                    "path": "/api-keys/{id}",
                    "description": "Delete API key",
                    "auth_required": true,
                    "tier": "Pro"
                }
            ]
        },
        {
            "category": "Subscription",
            "endpoints": [
                {
                    "method": "GET",
                    "path": "/subscriptions/status",
                    "description": "Get current subscription status",
                    "auth_required": true
                },
                {
                    "method": "POST",
                    "path": "/subscriptions/checkout",
                    "description": "Create Stripe checkout session",
                    "body": {
                        "tier": "breeder|farm|pro"
                    },
                    "auth_required": true
                }
            ]
        }
    ],
    "sdks": {
        "note": "Official SDKs coming soon",
        "curl_example": "curl -X GET 'https://breedingpro.showsafe.show/api/v1/horses' \\\n  -H 'Authorization: Bearer YOUR_JWT_TOKEN'"
    },
    "support": {
        "email": "api@showsafe.show",
        "documentation": "https://breedingpro.showsafe.show/docs"
    }
}