# Get all phytosanitary records for the company Retrieves all individual phytosanitary monitoring records for the authenticated company within a specified time range. Unlike /company-summary which returns aggregated incidence/severity metrics, this endpoint returns the raw records with full detail: dates, user information, location, and each pest/disease response. Requires API token authentication with read:phytosanitary scope via the x-api-key header. Key features: - Automatically uses companyId from the authenticated API token - Returns individual records (not aggregated) - Each record includes: dates, user id/name, project, sector, crop, coordinates - Each record includes its pest/disease responses with value and severity - Maximum range: 180 days - Dates must be in YYYY-MM-DD format (local time, no timezone suffix) Endpoint: GET /api/control/phytosanitary/company-records Version: 2.0.0 Security: apiKeyAuth ## Query parameters: - `startTime` (string, required) Start date in YYYY-MM-DD format (local time, no timezone suffix) Example: "2025-10-01" - `endTime` (string, required) End date in YYYY-MM-DD format (local time, no timezone suffix) Example: "2025-10-09" ## Response 200 fields (application/json): - `status` (string) Enum: "success" - `range` (object) - `range.startTime` (string) Example: "2025-10-01" - `range.endTime` (string) Example: "2025-10-09" - `companyTimezone` (string) Timezone resolved from company's projects Example: "America/Monterrey" - `companyId` (string) Company identifier from authenticated token Example: "comp_12345" - `totalRecords` (integer) Total number of phytosanitary records found Example: 3 - `records` (array) - `records.record_id` (string) Unique identifier of the record Example: "rec_abc123" - `records.created_at` (string) Timestamp when the record was created (UTC) Example: "2025-10-05T14:30:00.000Z" - `records.record_time` (string,null) Timestamp of the actual field observation (UTC) Example: "2025-10-05T14:25:00.000Z" - `records.user_id` (string) Unique identifier of the user who created the record Example: "user_789" - `records.user_name` (string) Full name of the user who created the record Example: "Juan Pérez" - `records.projectId` (string,null) Project identifier Example: "proj_123" - `records.project_name` (string,null) Project name Example: "Rancho San Pedro" - `records.sectorId` (string,null) Sector identifier Example: "sec_456" - `records.sector_name` (string,null) Sector name Example: "Lote A-1" - `records.crop` (string,null) Crop type Example: "Tomato" - `records.variety` (string,null) Crop variety Example: "Saladette" - `records.latitude` (number,null) GPS latitude of the observation Example: 25.6866 - `records.longitude` (number,null) GPS longitude of the observation Example: -100.3161 - `records.responses` (array) Pest and disease observations for this record - `records.responses.response_id` (string) Unique identifier of the response Example: "resp_001" - `records.responses.variable_name` (string) Internal variable name Example: "aphids_count" - `records.responses.variable_type` (string) Type of variable (pest or disease) Enum: "pests", "diseases" - `records.responses.name` (string) Display name of the pest or disease Example: "Aphids" - `records.responses.value_number` (number,null) Observed count or value Example: 5 - `records.responses.severity` (number,null) Severity level of the observation Example: 2.5 ## Response 400 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 401 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 403 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 422 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information" ## Response 500 fields (application/json): - `status` (string) Example: "error" - `message` (string) Example: "Error message description" - `error` (string) Example: "Detailed error information"