{"info":{"title":"Munigrid API Docs","version":"0.0.1","description":"Documentation of the public Munigrid API."},"openapi":"3.0.0","servers":[{"url":"https://www.munigrid.de"}],"components":{"schemas":{},"parameters":{}},"paths":{"/api/v0":{"get":{"summary":"Get all organizations that publish datasets as open data.","responses":{"200":{"description":"List of organizations that publish datasets as open data.","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Organization ID"},"name":{"type":"string","description":"Organization name"},"description":{"type":"string","description":"Organization description"}}}}}}}}}},"/api/v0/org/{orgId}":{"get":{"summary":"Get an organization by ID","parameters":[{"schema":{"type":"string","description":"Organisation ID"},"required":true,"description":"Organisation ID","name":"orgId","in":"path"}],"responses":{"200":{"description":"Organization info with all datasets published by this organization.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Organisation ID"},"name":{"type":"string","description":"Organisation name"},"description":{"type":"string","description":"Organisation description"},"datasets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","description":"Dataset ID"},"key":{"type":"string","minLength":1,"pattern":"^[a-z0-9-]+$","description":"Dataset key, unique within the organization"},"title":{"type":"string","description":"Dataset title"},"description":{"type":"string","description":"Dataset description"},"license_id":{"type":"number","nullable":true,"description":"License ID"},"keywords":{"type":"string","description":"Comma-separated list of keywords"},"categories":{"type":"string","description":"Comma-separated list of categories, following the HVD conventions"},"parent_id":{"type":"number","nullable":true,"description":"Parent dataset ID"},"url":{"type":"string","nullable":true,"description":"Endpoint URL for datasets served by a separate API"}},"required":["id","key","title","description","license_id","keywords","categories","parent_id","url"]},"description":"List of datasets published by this organization"}},"required":["id","name","description","datasets"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found"]}},"required":["error"]}}}}}}},"/api/v0/dataset/{id}":{"get":{"summary":"Get a dataset by ID","parameters":[{"schema":{"type":"integer","description":"Dataset ID"},"required":true,"description":"Dataset ID","name":"id","in":"path"}],"responses":{"200":{"description":"Dataset info with all distributions in this dataset.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Dataset ID"},"key":{"type":"string","minLength":1,"pattern":"^[a-z0-9-]+$","description":"Org-wide unique dataset key"},"org_id":{"type":"string","description":"Organisation ID"},"title":{"type":"string","description":"Dataset name"},"description":{"type":"string","description":"Dataset description"},"license_id":{"type":"integer","description":"License ID"},"keywords":{"type":"array","items":{"type":"string"},"description":"Comma-separated list of keywords for this dataset"},"categories":{"type":"string","description":"Comma-separated list of categories, following the HVD conventions"},"parent_id":{"type":"number","nullable":true,"description":"Parent dataset ID"},"url":{"type":"string","nullable":true,"description":"Endpoint URL for datasets served by a separate API"},"distributions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"Distribution ID"},"name":{"type":"string","description":"Distribution name"},"type":{"type":"string","description":"MIME type"}},"required":["id","name","type"]}}},"required":["id","key","org_id","title","description","license_id","keywords","categories","parent_id","url","distributions"]}}}},"404":{"description":"Dataset not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found"]}},"required":["error"]}}}}}}},"/api/v0/distribution/{id}":{"get":{"summary":"Get a distribution by ID","parameters":[{"schema":{"type":"integer","description":"Distribution ID"},"required":true,"description":"Distribution ID","name":"id","in":"path"}],"responses":{"200":{"description":"Distribution info with current file metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"Distribution ID"},"dataset_id":{"type":"integer","description":"Dataset ID"},"name":{"type":"string","description":"Distribution name"},"key":{"type":"string","description":"Distribution key"},"is_public":{"type":"boolean"},"type":{"type":"string","description":"MIME type"},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true},"md5":{"type":"string","nullable":true},"size":{"type":"integer","nullable":true},"url":{"type":"string","nullable":true}},"required":["id","dataset_id","name","key","is_public","type","created_at","updated_at","md5","size","url"]}}}},"404":{"description":"Distribution not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found"]}},"required":["error"]}}}}}}},"/api/v0/license":{"get":{"summary":"Get all licenses","responses":{"200":{"description":"List of licenses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","description":"License ID"},"name":{"type":"string","description":"License name"},"description":{"type":"string","description":"License description"},"url":{"type":"string","description":"URL to the actual license text"},"is_open":{"type":"boolean","description":"Whether the license is an open license"},"dcat_url":{"type":"string","description":"URL to the DCAT definition of the license"}},"required":["id","name","description","url","is_open","dcat_url"]}}}}}}}},"/api/v0/license/{id}":{"get":{"summary":"Get a license by ID","parameters":[{"schema":{"type":"integer","description":"License ID"},"required":true,"description":"License ID","name":"id","in":"path"}],"responses":{"200":{"description":"License info","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","description":"License ID"},"name":{"type":"string","description":"License name"},"description":{"type":"string","description":"License description"},"url":{"type":"string","description":"URL to the actual license text"},"is_open":{"type":"boolean","description":"Whether the license is an open license"},"dcat_url":{"type":"string","description":"URL to the DCAT definition of the license"}},"required":["id","name","description","url","is_open","dcat_url"]}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","enum":["not_found"]}},"required":["error"]}}}}}}}}}