{"openapi":"3.0.3","info":{"title":"TAC Flow Partner API","version":"1.0.0","description":"Read-only partner REST API for external systems (ERP, BI, custom integrations). Authenticate with a company-issued API key: `Authorization: Bearer tacp_live_…`. All data is scoped to the key's company, the key's scopes, and the company's enabled modules."},"servers":[{"url":"https://tacflow.app"}],"components":{"securitySchemes":{"partnerApiKey":{"type":"http","scheme":"bearer","description":"Company-issued partner API key (format: tacp_live_…). Issued from Settings → «الربط والتكامل»."}},"responses":{"Error":{"description":"Error envelope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized","key_expired","key_revoked","insufficient_scope","module_disabled","subscription_suspended","invalid_request","rate_limited","not_found","method_not_allowed","server_error"]},"message":{"type":"string"}}}}}}}}}},"paths":{"/api/partner/v1/assets":{"get":{"summary":"Assets","description":"The full asset register (heavy equipment + vehicles) with status, location, and decommission state. Required scope: `assets:read`. Requires the company to have the owning module enabled (heavy-equipment or vehicles).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"asset_class","in":"query","schema":{"type":"string"},"description":"Filter by class: 'vehicle' | 'heavy_equipment'"},{"name":"status","in":"query","schema":{"type":"string"},"description":"Filter by operational status token"},{"name":"include_decommissioned","in":"query","schema":{"type":"boolean"},"description":"Include decommissioned assets (default: true)"}],"responses":{"200":{"description":"A page of Assets (`Asset` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/maintenance-reports":{"get":{"summary":"Maintenance reports","description":"Approved maintenance reports with tasks, costs, and meter snapshots. Required scope: `maintenance:read`. Requires the company to have the owning module enabled (preventive or reports).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"equipment_id","in":"query","schema":{"type":"string"},"description":"Filter by asset id"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Maintenance reports (`MaintenanceReport` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/incidents":{"get":{"summary":"Incidents","description":"Fault/incident reports with status and costs. Required scope: `incidents:read`. Requires the company to have the owning module enabled (incidents).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"equipment_id","in":"query","schema":{"type":"string"},"description":"Filter by asset id"},{"name":"status","in":"query","schema":{"type":"string"},"description":"Filter by status token"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Incidents (`Incident` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/movements":{"get":{"summary":"Movements & custody","description":"Asset movements and custody: origin, destination, custodian. Required scope: `movements:read`. Requires the company to have the owning module enabled (movements).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"equipment_id","in":"query","schema":{"type":"string"},"description":"Filter by asset id"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Movements & custody (`Movement` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/fuel/dispenses":{"get":{"summary":"Internal fuel dispenses","description":"Internal diesel dispense events from tankers to equipment. Required scope: `fuel:read`. Requires the company to have the owning module enabled (fuel-internal).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"equipment_id","in":"query","schema":{"type":"string"},"description":"Filter by asset id"},{"name":"tanker_id","in":"query","schema":{"type":"string"},"description":"Filter by tanker id"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Internal fuel dispenses (`FuelDispense` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/fuel/transactions":{"get":{"summary":"Fuel card transactions","description":"Vehicle fuel-card transactions (provider-neutral). Required scope: `fuel:read`. Requires the company to have the owning module enabled (fuel-analytics).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"plate_number","in":"query","schema":{"type":"string"},"description":"Filter by plate number"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Fuel card transactions (`FuelTransaction` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/meters/readings":{"get":{"summary":"Meter readings","description":"Odometer and engine-hours readings per asset. Required scope: `meters:read`. Requires the company to have the owning module enabled (heavy-equipment or vehicles).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"equipment_id","in":"query","schema":{"type":"string"},"description":"Filter by asset id"},{"name":"meter_type","in":"query","schema":{"type":"string"},"description":"Meter type token"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Meter readings (`MeterReading` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/partner/v1/inspections":{"get":{"summary":"Daily inspections","description":"Approved daily inspection results with summaries. Required scope: `inspections:read`. Requires the company to have the owning module enabled (daily-inspection).","security":[{"partnerApiKey":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Incremental sync — only records created/updated at or after this instant."},{"name":"equipment_id","in":"query","schema":{"type":"string"},"description":"Filter by asset id"},{"name":"result","in":"query","schema":{"type":"string"},"description":"Filter by result: 'pass' | 'needs_action'"},{"name":"from","in":"query","schema":{"type":"string"},"description":"From date (inclusive)"},{"name":"to","in":"query","schema":{"type":"string"},"description":"To date (inclusive)"}],"responses":{"200":{"description":"A page of Daily inspections (`Inspection` objects).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object"}},"pagination":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"has_more":{"type":"boolean"}}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}}}