A Python SDK for interacting with the Hawkeye Claims Management API. This SDK provides a simple and intuitive interface for managing insurance claims, documents, and status logs.
- Claims Management: Create, retrieve, and update insurance claims
- Insurance Companies: Search and retrieve insurance company information with fuzzy matching
- Document Management: Upload and manage claim-related documents
- Log Trails: Create activity logs for claims
- Type Safety: Full type hints and dataclass support
- Environment Support: Production and development environment support
Install the SDK using uv with the GitHub repository:
uv add git+https://github.com/Hawkeye-Claims/hawkeye-sdk-for-pythonOr using pip:
pip install git+https://github.com/Hawkeye-Claims/hawkeye-sdk-for-python
from hawkeye_sdk_for_python import HawkeyeClient
# Initialize the client
client = HawkeyeClient("your-auth-token")
# For development environment
client = HawkeyeClient("your-auth-token", debug_mode=True)
# Get all claims
claims = client.claims.get_claims()
# Get a specific claim
claim = client.claims.get_single_claim(filenumber=12345)
# Create a new claim
response = client.claims.create_claim(
rentername="John Doe",
inscompaniesid="ABC Insurance",
dateofloss="2024-01-15",
vehmake="Toyota",
vehmodel="Camry",
vehcolor="Blue",
vehvin="1HGBH41JXMN109186"
)The main client class for interacting with the Hawkeye API.
client = HawkeyeClient(auth_token: str, debug_mode: bool = False)Parameters:
auth_token: Your Hawkeye API authentication tokendebug_mode: Set toTrueto use the development environment (default:False)
claims = client.claims.get_claims(include_inactive: bool = False)Returns a list of Claim objects.
claim = client.claims.get_single_claim(filenumber: int)Returns a single Claim object.
response = client.claims.create_claim(
rentername: str,
insurancecompany: str,
dateofloss: str,
vehmake: str,
vehmodel: str,
vehcolor: str,
vehvin: str,
# Optional parameters
clientclaimno: Optional[str] = None,
claimnumber: Optional[str] = None,
note: Optional[str] = None,
insuredname: Optional[str] = None,
policynumber: Optional[str] = None,
renterphone: Optional[str] = None,
renteremail: Optional[str] = None,
vehlocationdetails: Optional[str] = None,
vehlocationcity: Optional[str] = None,
vehlocationstate: Optional[str] = None,
vehyear: Optional[int] = None,
vehedition: Optional[str] = None,
vehplatenumber: Optional[str] = None,
vehuninumber: Optional[str] = None
)Returns an ApiResponse object.
response = client.claims.update_claim(
filenumber: int,
# All other parameters are optional
clientclaimno: Optional[str] = None,
claimnumber: Optional[str] = None,
# ... (same optional parameters as create_claim)
)# Get all insurance companies
companies = client.inscompanies.get_insurance_companies()
# Search with fuzzy matching
companies = client.inscompanies.get_insurance_companies(query="state farm")
# Search with custom limit
companies = client.inscompanies.get_insurance_companies(query="progressive", limit=10)Parameters:
query(str, optional): Search query to filter insurance companies. Uses fuzzy matching with probability scores.limit(int, optional): Maximum number of results to return. Default is 5, maximum is 20.
Returns:
- List of
InsCompanyobjects
Note: When a search query is provided, results include a probability score (0-100) indicating match confidence. Results are ordered by probability from highest to lowest.
client.docfiles.upload_file(
filenumber: int,
fileurl: str,
category: Optional[DocType] = DocType.DEFAULT,
visibleToClient: Optional[bool] = False,
notes: Optional[str] = ""
)Document Types:
The SDK supports various document types via the DocType enum, including:
IMAGESRENTAL_AGREEMENTINSURANCE_CARDPOLICE_REPORTINVOICE- And many more...
response = client.logtrails.create_log_trail(
file_number: int,
activity: str,
date: Optional[str] = None # Defaults to current date
)The Claim dataclass contains all claim information including:
- Basic information (filenumber, customer name, renter name)
- Insurance details (company, policy number, adjuster)
- Vehicle information (make, model, VIN, year)
- Financial data (estimate amount, settlement amounts)
- Associated documents and log trails
The InsCompany dataclass represents insurance company information:
id(int): Unique identifier for the insurance companyname(str): Full name of the insurance companyprobability(int, optional): Match confidence score (0-100) when returned from search queries
The DocFile dataclass represents uploaded documents with:
- Document type and category
- Upload date and user
- File URL and notes
The LogTrail dataclass represents activity logs with:
- Date and activity description
- User who created the entry
from hawkeye_sdk_for_python import HawkeyeClient, DocType
# Initialize client
client = HawkeyeClient("your-auth-token")
# Create a new claim
create_response = client.claims.create_claim(
rentername="Jane Smith",
insurancecompany="XYZ Insurance Co.",
dateofloss="2024-02-01",
vehmake="Honda",
vehmodel="Civic",
vehcolor="Red",
vehvin="2HGFC2F59MH123456",
clientclaimno="CLM-2024-001",
vehyear=2021
)
filenumber = create_response["filenumber"]
print(f"Created claim with file number: {filenumber}")
# Upload a document
client.docfiles.upload_file(
filenumber=filenumber,
fileurl="https://example.com/rental-agreement.pdf",
category=DocType.RENTAL_AGREEMENT,
notes="Initial rental agreement"
)
# Add a log entry
client.logtrails.create_log_trail(
file_number=filenumber,
activity="Initial claim setup completed"
)
# Retrieve the updated claim
updated_claim = client.claims.get_single_claim(filenumber)
print(f"Claim has {len(updated_claim.docfiles)} documents")
print(f"Claim has {len(updated_claim.logtrail)} log entries")try:
claim = client.claims.get_single_claim(999999)
except Exception as e:
print(f"Error retrieving claim: {e}")# Run all tests
python -m pytest tests/
# Run specific test file
python -m pytest tests/test_claims.py# Install dependencies
uv sync
# Activate virtual environment
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On WindowsFor detailed API documentation, visit the Hawkeye API Documentation.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
For support or questions, please contact the development team or open an issue on GitHub.