{"openapi":"3.0.4","info":{"title":"Data API","version":"v1","description":"Public, read-only HTTP interface over the Lithuanian Data Portal data lake — Apache Iceberg tables and stored files, queried through Trino. No authentication is required.\n\nBrowse namespaces and read table schemas with `GET`; query and export table rows with `POST` (the body only carries the query definition — the API stays read-only). Read rows as JSON, or export whole tables as NDJSON, JSON, CSV, Excel or Parquet. See the Guides for concepts, the real query grammar, and worked examples."},"paths":{"/namespaces":{"get":{"tags":["Namespaces"],"summary":"Retrieve namespace details or root list","description":"Fetches metadata for a specific namespace or lists all available root namespaces.\n\nBehavior:\n- With namespace provided: returns the specified namespace's identifier along with its immediate children, including sub-namespaces, tables, and files.\n- Without namespace: returns a high-level list of all top-level root namespaces available in the catalog.\n\nExample Usage:\n\n```bash\ncurl -X GET '/namespaces'\n```","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiAllNamespacesResultDataApiResponse"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"504":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}}},"operationId":"listNamespaces"}},"/namespaces/{namespace}":{"get":{"tags":["Namespaces"],"summary":"Retrieve namespace details","description":"Fetches metadata for a specific namespace.\n\nReturns the namespace identifier together with its immediate child namespaces, tables, and files.\n\nExample Usage:\n\n```bash\ncurl -X GET '/namespaces/my_org.data_warehouse'\n```","parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiCurrentNamespaceResultDataApiResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"504":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}}},"operationId":"getNamespace"}},"/namespaces/{namespace}/tables/{tableName}/schema":{"get":{"tags":["Namespaces"],"summary":"Get table schema","description":"Retrieves the current logical schema of the Iceberg table.\n\nInformation provided:\n- Field IDs used by Iceberg to track columns across renames.\n- Data types such as string, long, struct, date, timestamp.\n- Nullability for each field.\n\nExample Usage:\n\n```bash\ncurl -X GET '/namespaces/sales.emea/tables/orders/schema'\n```","parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"}},{"name":"tableName","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiTableSchemaResultDataApiResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"504":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}}},"operationId":"getTableSchema"}},"/namespaces/{namespace}/tables/{tableName}/query":{"post":{"tags":["Namespaces"],"summary":"Query table rows","description":"Queries table rows as JSON with optional column selection, filtering, sorting and offset pagination. Returns the matching rows plus pagination metadata: total, total_pages and current_page. The query is sent as a JSON request body — see the fields below, and the Querying guide for the full filter grammar and examples.","parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"}},{"name":"tableName","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiTableQueryBody"},"example":{"limit":10,"offset":0,"select":"lytis,mirties_metai,pavadinimas","filter":"lytis=Moteris","sort":"-mirties_metai","exclude_nulls":["m_konc"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiTableQueryResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"504":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}}},"operationId":"queryTable"}},"/namespaces/{namespace}/files/{fileName}":{"get":{"tags":["Namespaces"],"summary":"Download a file from object storage","description":"Downloads a file from the configured object storage bucket.\n\nPath behavior:\n- namespace is treated as the logical storage prefix.\n- fileName must be a single file basename and must not contain '/'.\n- Content-Type and filename are forwarded from the upstream response.\n\nExample Usage:\n\n```bash\ncurl -X GET '/namespaces/org.project/files/report.pdf'\n```","parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"}},{"name":"fileName","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}}}},"422":{"description":"Unprocessable Content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}}}},"502":{"description":"Bad Gateway","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"503":{"description":"Service Unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"504":{"description":"Gateway Timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}}},"operationId":"downloadFile"}},"/namespaces/{namespace}/tables/{tableName}/export":{"post":{"tags":["Namespaces"],"summary":"Export table rows","description":"Exports the matching table rows as a downloadable file stream. Takes the same JSON query body as the query endpoint (select, filter, sort, limit, offset, exclude_nulls); the format query parameter chooses the file type (ndjson, json, csv, xlsx or parquet).","parameters":[{"name":"namespace","in":"path","required":true,"schema":{"type":"string"}},{"name":"tableName","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Output file format: ndjson (default), json, csv, xlsx (Excel, capped at 1,000,000 rows) or parquet.","example":"ndjson","schema":{"type":"string","enum":["ndjson","json","csv","xlsx","parquet"],"default":"ndjson"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataApiTableQueryBody"},"example":{"limit":10,"offset":0,"select":"lytis,mirties_metai,pavadinimas","filter":"lytis=Moteris","sort":"-mirties_metai","exclude_nulls":["m_konc"]}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Bad Request","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"404":{"description":"Not Found","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}},"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorDetail"}}}},"422":{"description":"Unprocessable Content","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/DataApiValidationProblemResponse"}}}},"502":{"description":"Bad Gateway","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}},"504":{"description":"Gateway Timeout","content":{"text/csv":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/x-ndjson":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/octet-stream":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}},"application/json":{"schema":{"$ref":"#/components/schemas/DataApiErrorResponse"}}}}},"operationId":"exportTable"}}},"components":{"schemas":{"DataApiAllNamespacesResult":{"type":"object","properties":{"namespaces":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"DataApiAllNamespacesResultDataApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/DataApiAllNamespacesResult"}},"additionalProperties":false},"DataApiCurrentNamespaceResult":{"type":"object","properties":{"current_namespace":{"type":"string","nullable":true},"child_namespaces":{"type":"array","items":{"type":"string"},"nullable":true},"tables":{"type":"array","items":{"type":"string"},"nullable":true},"files":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false},"DataApiCurrentNamespaceResultDataApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/DataApiCurrentNamespaceResult"}},"additionalProperties":false},"DataApiErrorDetail":{"type":"object","properties":{"message":{"type":"string","nullable":true},"error_code":{"type":"string","nullable":true}},"additionalProperties":false},"DataApiErrorResponse":{"type":"object","properties":{"error":{"type":"string","nullable":true},"error_code":{"type":"string","nullable":true}},"additionalProperties":false},"DataApiTableQueryResponse":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","additionalProperties":{}},"nullable":true},"total":{"type":"integer","format":"int32"},"total_pages":{"type":"integer","format":"int32","nullable":true},"current_page":{"type":"integer","format":"int32","nullable":true}},"additionalProperties":false},"DataApiTableSchema":{"type":"object","properties":{"type":{"type":"string","nullable":true},"fields":{"type":"array","items":{"$ref":"#/components/schemas/DataApiTableSchemaField"},"nullable":true},"schema-id":{"type":"integer","format":"int32"},"identifier-field-ids":{"type":"array","items":{"type":"integer","format":"int32"},"nullable":true}},"additionalProperties":false},"DataApiTableSchemaField":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"required":{"type":"boolean"}},"additionalProperties":false},"DataApiTableSchemaResult":{"type":"object","properties":{"table_identifier":{"type":"string","nullable":true},"schema":{"$ref":"#/components/schemas/DataApiTableSchema"}},"additionalProperties":false},"DataApiTableSchemaResultDataApiResponse":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/DataApiTableSchemaResult"}},"additionalProperties":false},"DataApiValidationErrorDetail":{"type":"object","properties":{"loc":{"type":"array","items":{},"nullable":true},"msg":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"input":{"type":"string","nullable":true},"ctx":{"type":"object","additionalProperties":{},"nullable":true}},"additionalProperties":false},"DataApiValidationProblemResponse":{"type":"object","properties":{"detail":{"type":"array","items":{"$ref":"#/components/schemas/DataApiValidationErrorDetail"},"nullable":true}},"additionalProperties":false},"DataApiTableQueryBody":{"type":"object","description":"Query definition sent as the JSON request body. All fields are optional; an empty body `{}` returns the first page of all columns.","properties":{"limit":{"type":"integer","format":"int32","description":"Maximum number of rows to return (page size). Maps to SQL LIMIT.","example":10},"offset":{"type":"integer","format":"int32","default":0,"description":"Number of rows to skip before returning results. offset = (page − 1) × limit. Maps to SQL OFFSET.","example":0},"filter":{"type":"string","description":"URL-style filter: column=value conditions joined with &, values bare. Dotted two-letter operators: ._gt ._ge ._lt ._le ._co ._sw ._ew. Combine with _and. / _or. Use ._ge not ._gte (three-letter forms are rejected).","example":"pavadinimas._co=Etan&_and.mirties_metai._ge=2018"},"sort":{"type":"string","description":"Comma-separated sort keys. Prefix - for descending, + or none for ascending.","example":"-mirties_metai"},"select":{"type":"string","description":"Comma-separated list of column names to return. Omit for all columns.","example":"lytis,mirties_metai,pavadinimas"},"exclude_nulls":{"type":"array","items":{"type":"string"},"description":"Column name(s) that must be non-null; rows with a null in any listed column are dropped. Repeat the parameter for several columns.","example":"m_konc"}}}}},"tags":[{"name":"Namespaces"}],"servers":[{"url":"https://api.dataportal.gov.lt","description":"Configured with OPENAPI_SERVER_URL (.env)"}]}