{
    "openapi": "3.1.0",
    "info": {
        "title": "Nakordoni Developer API — Fleet History API",
        "version": "2026-12-04",
        "summary": "REST + JSON over HTTPS. One base URL, one key, predictable envelopes.",
        "description": "Generated from the Nakordoni Developer API endpoint registry (the same source as https://nakordoni.eu/api/v1/docs.md). Path-versioned per endpoint: /api/v1/… is stable; /api/v2/… and newer serve the newer behaviour only for the endpoints listed. Free key: https://nakordoni.eu/en/developers/signup",
        "termsOfService": "https://nakordoni.eu/en/p/developer_api_terms",
        "contact": {
            "name": "Nakordoni Developer Portal",
            "url": "https://nakordoni.eu/en/developers"
        },
        "license": {
            "name": "Nakordoni Developer API Terms",
            "url": "https://nakordoni.eu/en/p/developer_api_terms"
        }
    },
    "externalDocs": {
        "description": "API documentation",
        "url": "https://nakordoni.eu/en/developers/docs/fleet-history"
    },
    "servers": [
        {
            "url": "https://nakordoni.eu",
            "description": "Production"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        },
        {
            "apiKeyHeader": []
        },
        {
            "apiKeyQuery": []
        }
    ],
    "tags": [
        {
            "name": "fleet-history",
            "description": "Fleet History API",
            "externalDocs": {
                "url": "https://nakordoni.eu/en/developers/docs/fleet-history"
            }
        }
    ],
    "paths": {
        "/api/v2/data/fleet/history": {
            "get": {
                "tags": [
                    "fleet-history"
                ],
                "summary": "Fleet History API",
                "description": "Recorded GPS track of your own vehicles: every stored position point in a time window, in chronological order, with speed, bearing and accuracy. Filter to one vehicle or take the whole fleet. Window is limited to 31 days per call and 5000 points per response — page through longer periods by moving ?from= to the last returned timestamp.\n\nExample: `/api/v2/data/fleet/history?vehicle_id=1&from=2026-08-01T00:00:00Z&to=2026-08-02T00:00:00Z&limit=1000`\n\nHuman docs: https://nakordoni.eu/en/developers/docs/fleet-history",
                "operationId": "fleetHistoryV2",
                "parameters": [
                    {
                        "name": "vehicle_id",
                        "in": "query",
                        "required": false,
                        "description": "Restrict to one of your vehicles (optional; ids come from fleet/vehicles). Omit for the whole fleet.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Window start — unix timestamp or ISO-8601 datetime (default: 24 h before `to`). A datetime without an explicit offset is read as UTC.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Window end — unix timestamp or ISO-8601 datetime (default: now). The window may not exceed 31 days.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Max points returned, 1-5000 (default 1000, values above 5000 are clamped). `truncated: true` means more points exist in the window.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response (shared envelope; `data` as documented).",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "allOf": [
                                        {
                                            "$ref": "#/components/schemas/ApiEnvelope"
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "points": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "vehicle_id": {
                                                                        "description": "Vehicle the fix belongs to, with plate."
                                                                    },
                                                                    "lat": {
                                                                        "description": "Position, with lon, ts, datetime (UTC) and accuracy_m."
                                                                    },
                                                                    "speed_ms": {
                                                                        "description": "Speed in m/s at the fix, with bearing_deg."
                                                                    }
                                                                }
                                                            }
                                                        },
                                                        "from": {
                                                            "description": "Window actually queried, with to and limit."
                                                        },
                                                        "count": {
                                                            "description": "Points returned; truncated is true when count reached limit — continue from the last ts rather than widening the window."
                                                        },
                                                        "vehicle_id": {
                                                            "description": "The vehicle filtered to, null when the window covers the whole fleet."
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/E400"
                    },
                    "401": {
                        "$ref": "#/components/responses/E401"
                    },
                    "403": {
                        "$ref": "#/components/responses/E403"
                    },
                    "404": {
                        "$ref": "#/components/responses/E404"
                    },
                    "410": {
                        "$ref": "#/components/responses/E410"
                    },
                    "429": {
                        "$ref": "#/components/responses/E429"
                    },
                    "500": {
                        "$ref": "#/components/responses/E500"
                    },
                    "503": {
                        "$ref": "#/components/responses/E503"
                    },
                    "504": {
                        "$ref": "#/components/responses/E504"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "NKD-DEV-XXXX-XXXX-XXXX",
                "description": "API key from https://nakordoni.eu/en/developers, sent as `Authorization: Bearer NKD-DEV-…` (preferred)."
            },
            "apiKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-Key",
                "description": "Same API key in the X-API-Key header."
            },
            "apiKeyQuery": {
                "type": "apiKey",
                "in": "query",
                "name": "key",
                "description": "Same API key as ?key= (fallback; keys in URLs end up in logs)."
            }
        },
        "schemas": {
            "ApiEnvelope": {
                "type": "object",
                "required": [
                    "ok"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": true
                    },
                    "api_version": {
                        "type": "string",
                        "description": "Version that served the call, e.g. \"1\", \"v2\"."
                    },
                    "product": {
                        "type": "string"
                    },
                    "attribution": {
                        "type": "string",
                        "description": "Show this attribution with the data."
                    },
                    "data": {
                        "description": "Product payload — shape per product, see the operation."
                    },
                    "snapshot": {
                        "type": "object"
                    },
                    "usage": {
                        "type": "object",
                        "properties": {
                            "requests_today": {
                                "type": "integer"
                            },
                            "limit_today": {
                                "type": "integer"
                            },
                            "remaining": {
                                "type": "integer"
                            }
                        }
                    }
                }
            },
            "ApiError": {
                "type": "object",
                "required": [
                    "ok",
                    "error"
                ],
                "properties": {
                    "ok": {
                        "type": "boolean",
                        "const": false
                    },
                    "api_version": {
                        "type": "string"
                    },
                    "error": {
                        "type": "object",
                        "required": [
                            "code",
                            "message"
                        ],
                        "properties": {
                            "code": {
                                "type": "string",
                                "examples": [
                                    "bad_request",
                                    "missing_api_key",
                                    "invalid_api_key",
                                    "product_unavailable",
                                    "unknown_product",
                                    "version_sunset",
                                    "qps_exceeded",
                                    "quota_exceeded",
                                    "internal_error",
                                    "busy",
                                    "timeout"
                                ]
                            },
                            "message": {
                                "type": "string"
                            },
                            "docs": {
                                "type": "string",
                                "format": "uri"
                            },
                            "developer_portal": {
                                "type": "string",
                                "format": "uri"
                            }
                        },
                        "additionalProperties": true
                    }
                }
            }
        },
        "responses": {
            "E400": {
                "description": "Bad request (bad_request, invalid_country, unsupported_version, geocode_failed, scope_required, …).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E401": {
                "description": "Missing API key (missing_api_key).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E403": {
                "description": "Key invalid, blocked or not allowed for this product (invalid_api_key, product_unavailable, not_approved, …).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E404": {
                "description": "Unknown product (unknown_product).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E410": {
                "description": "Version retired (version_sunset, version_closed_to_new_accounts).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E429": {
                "description": "Rate or quota limit (qps_exceeded, quota_exceeded, duplicate_request, ip_temporarily_blocked). See Retry-After.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E500": {
                "description": "Internal error (internal_error).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E503": {
                "description": "Temporarily unavailable (busy).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            },
            "E504": {
                "description": "Upstream timeout (timeout).",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ApiError"
                        }
                    }
                }
            }
        }
    }
}
