{"info":{"contact":{"name":"ESRA Team","url":"https://github.com/MusannaGalib/esra-platform"},"description":"ESRA: Energy Storage Research Assistant \u2014 REST API for querying, browsing, and downloading materials science experimental datasets stored at Argonne National Laboratory.","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"title":"ESRA API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/browse":{"get":{"description":"Returns metadata for uploads matching the given filters.","parameters":[{"description":"Free-text search","in":"query","name":"q","schema":{"type":"string"}},{"description":"Experiment type (TEM, EIS, \u2026)","in":"query","name":"type","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"default":20,"type":"integer"}}],"responses":{"200":{"description":"Array of dataset metadata"}},"summary":"Browse and filter datasets"}},"/chat":{"post":{"description":"Submit a plain-English question. Returns a structured answer from the SQL, MCP-tool, or LLM layer. Rate-limited to 60 req/hour per user.","requestBody":{"content":{"application/json":{"schema":{"properties":{"query":{"example":"how many TEM files at 300 kV?","type":"string"},"user_id":{"description":"Optional stable user ID for multi-turn sessions","type":"string"}},"required":["query"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"images":{"items":{"type":"string"},"type":"array"},"layer":{"enum":["sql","tool","semantic","llm"],"type":"string"},"text":{"type":"string"}},"type":"object"}}},"description":"Answer returned"},"429":{"description":"Rate limit exceeded"}},"summary":"Natural-language query"}},"/datasets/{upload_id}/jsonld":{"get":{"parameters":[{"in":"path","name":"upload_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/ld+json":{}},"description":"JSON-LD document"},"404":{"description":"Dataset not found"}},"summary":"Download JSON-LD for a dataset"}},"/endpoints":{"get":{"responses":{"200":{"description":"Array of Globus endpoint descriptors"}},"summary":"List researcher's Globus endpoints"}},"/transfer":{"post":{"description":"Transfers dataset files to the researcher's Globus endpoint.","requestBody":{"content":{"application/json":{"schema":{"properties":{"destination_base":{"default":"/~/Downloads","description":"Globus destination folder. Use /~/ for the home directory \u2014 a bare ~ is a literal directory name to the Transfer API.","type":"string"},"destination_endpoint":{"type":"string"},"upload_ids":{"items":{"type":"string"},"type":"array"}},"required":["upload_ids","destination_endpoint"],"type":"object"}}},"required":true},"responses":{"200":{"description":"Transfer initiated"}},"summary":"Initiate Globus transfer"}}},"servers":[{"description":"ESRA v1 API","url":"/api/v1"}]}
