{"openapi":"3.1.0","info":{"title":"AeroCopi API","version":"1.0.0","description":"API pública REST de AeroCopi. Autenticación por clave de API (Bearer). Crea tu clave en Ajustes → API. Todos los recursos están aislados por organización."},"servers":[{"url":"https://app.aerocopi.com/api/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Clave de API con formato ak_live_..."}},"schemas":{"Drone":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"registroAesa":{"type":"string","nullable":true},"serialNumber":{"type":"string","nullable":true},"nickname":{"type":"string","nullable":true},"manufacturer":{"type":"string"},"model":{"type":"string"},"mtomGrams":{"type":"integer","nullable":true},"classDesignation":{"type":"string","nullable":true},"status":{"type":"string"},"acquiredAt":{"type":"string","format":"date","nullable":true},"insuranceExpiresAt":{"type":"string","format":"date","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Pilot":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"nationality":{"type":"string","nullable":true},"aesaPilotId":{"type":"string","nullable":true},"status":{"type":"string"},"experienceLevel":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Flight":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"droneId":{"type":"string","format":"uuid"},"pilotId":{"type":"string","format":"uuid"},"observerPilotId":{"type":"string","format":"uuid","nullable":true},"projectId":{"type":"string","format":"uuid","nullable":true},"flightDate":{"type":"string","format":"date"},"durationMin":{"type":"integer"},"locationName":{"type":"string","nullable":true},"locationLat":{"type":"string","nullable":true},"locationLon":{"type":"string","nullable":true},"purpose":{"type":"string"},"operationCategory":{"type":"string","nullable":true},"maxAltitudeM":{"type":"integer","nullable":true},"distanceKm":{"type":"string","nullable":true},"isBvlos":{"type":"boolean"},"isNight":{"type":"boolean"},"source":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"code":{"type":"string","nullable":true},"title":{"type":"string"},"description":{"type":"string","nullable":true},"clientId":{"type":"string","format":"uuid","nullable":true},"clientName":{"type":"string","nullable":true},"serviceType":{"type":"string"},"locationName":{"type":"string","nullable":true},"status":{"type":"string"},"plannedStartDate":{"type":"string","format":"date","nullable":true},"plannedEndDate":{"type":"string","format":"date","nullable":true},"budgetCents":{"type":"integer","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Client":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"contactName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"taxId":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"sector":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"Pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"total":{"type":"integer"},"hasMore":{"type":"boolean"}}}},"responses":{"Unauthorized":{"description":"Clave ausente, inválida o caducada.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"La clave no tiene el scope requerido.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Límite de peticiones superado.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/drones":{"get":{"summary":"Listar drones","tags":["Drones"],"security":[{"apiKey":["drones:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200,"minimum":1},"description":"Número de resultados (máx. 200)."},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0},"description":"Desplazamiento para paginar."},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Drone"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pilots":{"get":{"summary":"Listar pilotos","tags":["Pilotos"],"security":[{"apiKey":["pilots:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200,"minimum":1},"description":"Número de resultados (máx. 200)."},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0},"description":"Desplazamiento para paginar."},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Pilot"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flights":{"get":{"summary":"Listar vuelos","tags":["Vuelos"],"security":[{"apiKey":["flights:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200,"minimum":1},"description":"Número de resultados (máx. 200)."},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0},"description":"Desplazamiento para paginar."},{"name":"drone","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"pilot","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flight"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"Registrar un vuelo","tags":["Vuelos"],"security":[{"apiKey":["flights:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["droneId","pilotId","flightDate"],"properties":{"droneId":{"type":"string","format":"uuid"},"pilotId":{"type":"string","format":"uuid"},"flightDate":{"type":"string","format":"date"},"durationMin":{"type":"integer"},"purpose":{"type":"string"},"locationName":{"type":"string"},"notes":{"type":"string"}}}}}},"responses":{"201":{"description":"Creado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flight"}}}}}},"400":{"description":"Validación.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/projects":{"get":{"summary":"Listar trabajos","tags":["Trabajos"],"security":[{"apiKey":["projects:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200,"minimum":1},"description":"Número de resultados (máx. 200)."},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0},"description":"Desplazamiento para paginar."},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"Crear un trabajo","tags":["Trabajos"],"security":[{"apiKey":["projects:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title"],"properties":{"title":{"type":"string"},"clientId":{"type":"string","format":"uuid"},"serviceType":{"type":"string"},"locationName":{"type":"string"},"description":{"type":"string"}}}}}},"responses":{"201":{"description":"Creado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Project"}}}}}},"400":{"description":"Validación.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/clients":{"get":{"summary":"Listar clientes","tags":["Clientes"],"security":[{"apiKey":["clients:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50,"maximum":200,"minimum":1},"description":"Número de resultados (máx. 200)."},{"name":"offset","in":"query","schema":{"type":"integer","default":0,"minimum":0},"description":"Desplazamiento para paginar."}],"responses":{"200":{"description":"Lista paginada.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"meta":{"type":"object","properties":{"pagination":{"$ref":"#/components/schemas/Pagination"}}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"Crear un cliente","tags":["Clientes"],"security":[{"apiKey":["clients:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"contactName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"taxId":{"type":"string"}}}}}},"responses":{"201":{"description":"Creado.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Client"}}}}}},"400":{"description":"Validación.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}