{"openapi":"3.1.0","info":{"title":"CarFleet API","version":"1.0.0","description":"Read access to your CarFleet workspace. Authenticate with an API key from Settings → API & MCP, sent as `Authorization: Bearer <key>`. Keys are read-only: nothing reached through this API can take a payment, issue an invoice or message a customer."},"servers":[{"url":"https://carfleet.ae/api"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key from Settings → API & MCP. Every request needs `Authorization: Bearer <key>`. A missing, unknown, revoked or expired key returns 401 with an `error.reason` naming which of those it was — a revoked key must not read as a typo. A frozen workspace returns 403."}},"schemas":{"Me":{"type":"object","properties":{"workspace":{"type":"object","properties":{"slug":{"type":"string"},"status":{"type":"string"}},"required":["slug","status"]},"role":{"type":["string","null"]}},"required":["workspace","role"]},"TestDeliveryQueued":{"type":"object","properties":{"deliveryId":{"type":"string"}},"required":["deliveryId"]}},"parameters":{}},"paths":{"/v1/me":{"get":{"security":[{"bearerAuth":[]}],"tags":["Workspace"],"summary":"Who this key is","description":"Confirms a key works and names the workspace it belongs to. Reads none of your data, so it is the safe first call when setting up an integration.","responses":{"200":{"description":"The workspace this key belongs to.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}}}}},"/v1/fleet/summary":{"get":{"security":[{"bearerAuth":[]}],"tags":["Fleet"],"summary":"Fleet size and utilisation","description":"Totals by status, how many are out, how many are idle, and current utilisation.","responses":{"200":{"description":"Fleet counters.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"total, byStatus, available, rented, inService, utilization."}}}}}}},"/v1/vehicles":{"get":{"security":[{"bearerAuth":[]}],"tags":["Fleet"],"summary":"Find vehicles, optionally free for a window","description":"Search by make, model or plate. Supply `from` and `to` to also learn whether each vehicle is FREE for that window — this is how you answer 'what can I rent out next weekend'.","parameters":[{"schema":{"type":"string","description":"Make, model or plate.","example":"Cayenne"},"required":false,"description":"Make, model or plate.","name":"q","in":"query"},{"schema":{"type":"string","description":"ISO 8601 start of an availability window."},"required":false,"description":"ISO 8601 start of an availability window.","name":"from","in":"query"},{"schema":{"type":"string","description":"ISO 8601 end of that window."},"required":false,"description":"ISO 8601 end of that window.","name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Matching vehicles.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"rows[]: id, make, model, plate, category, dailyRate — plus `available` when a window was supplied."}}}}}}},"/v1/operations/today":{"get":{"security":[{"bearerAuth":[]}],"tags":["Bookings"],"summary":"Today's handovers and returns","description":"Every vehicle going out and coming back today, with the customer's name, the car, the time and what is still owed. The operational answer to 'what is happening today'.","responses":{"200":{"description":"Today's movements.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"handovers[] and returns[]: customer, vehicle, time, amount, balanceDue."}}}}}}},"/v1/bookings/summary":{"get":{"security":[{"bearerAuth":[]}],"tags":["Bookings"],"summary":"Booking counts by status","description":"How many rentals are active, upcoming, due back and overdue, and what has been collected.","responses":{"200":{"description":"Booking counters.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"byStatus, total, active, upcoming, dueReturns, overdue, revenueCollected."}}}}}}},"/v1/finance/overview":{"get":{"security":[{"bearerAuth":[]}],"tags":["Money"],"summary":"How the business is doing","description":"Cash collected all-time and this month, what is owed, what is overdue, deposits held, expenses, net profit, a six-month trend and the top-earning vehicles. Amounts are in fils (AED minor units) — divide by 100.","responses":{"200":{"description":"Finance summary.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"collectedAllTime, collectedThisMonth, arOutstanding, arOverdue, depositsHeld, expenses, netProfitAllTime, aging[4], monthly[6], topVehicles[]."}}}}}}},"/v1/receivables":{"get":{"security":[{"bearerAuth":[]}],"tags":["Money"],"summary":"Who owes money, and how late","description":"Outstanding balance per customer with 1-30 / 31-60 / 60+ day ageing, plus the whole book's totals. Returns names and figures only — no phone numbers, emails or identity documents.","parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Receivables by customer.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"rows[]: customerId, name, billed, collected, outstanding, current, d1_30, d31_60, d60p, openInvoices. Plus portfolio totals."}}}}}}},"/v1/webhooks/{id}/test":{"post":{"security":[{"bearerAuth":[]}],"tags":["Webhooks"],"summary":"Send a test delivery","description":"Queues a `webhook.test` event to one of your endpoints. It goes through the ORDINARY queue — same signature, same retries, same delivery record — because a test that takes a different path proves nothing about the path that matters. Requires an `Idempotency-Key`.","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Queued. It will be delivered on the next sweep.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestDeliveryQueued"}}}}}}},"/v1/webhooks":{"get":{"security":[{"bearerAuth":[]}],"tags":["Webhooks"],"summary":"Your registered endpoints","description":"Where we send events, and how each one is doing — when it last accepted a delivery, and how many failures in a row it is on. Never returns a signing secret.","responses":{"200":{"description":"Endpoints.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{},"description":"rows[]: id, name, url, events, isActive, lastSuccessAt, consecutiveFailures."}}}}}}}},"webhooks":{}}