{"openapi":"3.0.3","info":{"title":"Tracell battery passport API","version":"0.1.0","description":"Lifecycle and read API for LMT battery passports (SRS IO-03). Tenant endpoints take a bearer token; passport reads are public at tier 1."},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{}},"paths":{"/api/v1/models":{"get":{"summary":"List the models of the calling tenant","tags":["models"],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units":{"get":{"summary":"List units visible to the calling tenant","tags":["units"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"model","required":false},{"schema":{"type":"string"},"in":"query","name":"status","required":false},{"schema":{"type":"string"},"in":"query","name":"state","required":false},{"schema":{"type":"string"},"in":"query","name":"q","required":false},{"schema":{"type":"integer","minimum":1,"maximum":1000},"in":"query","name":"limit","required":false},{"schema":{"type":"integer","minimum":0},"in":"query","name":"offset","required":false}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Create a unit passport at end of line (FR-02)","tags":["units"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"modelId":{"type":"string","format":"uuid"},"serial":{"type":"string","minLength":1,"maxLength":61},"batch":{"type":"string","maxLength":61},"manufacturedMonth":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$"},"responsibleTenantId":{"type":"string","format":"uuid"},"bmsSerial":{"type":"string","maxLength":80},"placedOnMarketAt":{"type":"string","format":"date"},"inServiceDate":{"type":"string","format":"date"},"snapshot":{"type":"object","description":"Performance snapshot, data points #51, #53, #55, #57, #59, #60 (fades are derived)","properties":{"ratedCapacityDynamic":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"power":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"internalResistanceDynamic":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"roundTripEfficiency":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"expectedLifetimeCyclesDynamic":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"expectedLifetimeYears":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]}},"required":["ratedCapacityDynamic","power","internalResistanceDynamic","expectedLifetimeCyclesDynamic","expectedLifetimeYears"]},"snapshotTakenAt":{"type":"string","format":"date"},"snapshotReferenceTest":{"type":"string","maxLength":200},"publish":{"type":"boolean"}},"required":["modelId","serial","manufacturedMonth","snapshot"]}}}},"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units/batch":{"post":{"summary":"Create up to 5,000 units in one transaction (FR-19)","tags":["units"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"units":{"type":"array","items":{"type":"object","properties":{"modelId":{"type":"string","format":"uuid"},"serial":{"type":"string","minLength":1,"maxLength":61},"batch":{"type":"string","maxLength":61},"manufacturedMonth":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$"},"responsibleTenantId":{"type":"string","format":"uuid"},"bmsSerial":{"type":"string","maxLength":80},"placedOnMarketAt":{"type":"string","format":"date"},"inServiceDate":{"type":"string","format":"date"},"snapshot":{"type":"object","description":"Performance snapshot, data points #51, #53, #55, #57, #59, #60 (fades are derived)","properties":{"ratedCapacityDynamic":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"power":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"internalResistanceDynamic":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"roundTripEfficiency":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"expectedLifetimeCyclesDynamic":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]},"expectedLifetimeYears":{"type":"object","properties":{"value":{"type":"number"},"unit":{"type":"string"},"referenceTest":{"type":"string"}},"required":["value"]}},"required":["ratedCapacityDynamic","power","internalResistanceDynamic","expectedLifetimeCyclesDynamic","expectedLifetimeYears"]},"snapshotTakenAt":{"type":"string","format":"date"},"snapshotReferenceTest":{"type":"string","maxLength":200}},"required":["modelId","serial","manufacturedMonth","snapshot"]},"minItems":1,"maxItems":5000},"publish":{"type":"boolean"}},"required":["units"]}}}},"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units/{id}":{"get":{"summary":"Unit detail with snapshots and measurements","tags":["units"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units/{id}/publish":{"post":{"summary":"Publish a new signed passport version (FR-03)","tags":["units"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","maxLength":300}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units/{id}/label-verified":{"post":{"summary":"Record the end-of-line scan check of the printed QR code (ID-02)","tags":["units"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units/{id}/measurements":{"post":{"summary":"Record state-of-health and use values (#62-#71) entered by form or file (FR-11 at launch)","tags":["units"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"measuredAt":{"type":"string"},"source":{"type":"string","enum":["form","file"]},"sourceRef":{"type":"string","maxLength":200},"values":{"type":"object","additionalProperties":true},"publish":{"type":"boolean"}},"required":["measuredAt","values"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/passports/{token}":{"get":{"summary":"Read a passport by identifier (IO-03); the caller sees the tiers it is entitled to","tags":["passports"],"parameters":[{"schema":{"type":"integer","minimum":1},"in":"query","name":"version","required":false},{"schema":{"type":"string","format":"date"},"in":"query","name":"asOf","required":false},{"schema":{"type":"string","minLength":24,"maxLength":24},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/export/units/{id}":{"get":{"summary":"Complete export of one unit: every version, snapshot and measurement (FR-20)","tags":["export"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/export/models/{id}":{"get":{"summary":"Complete export of one model: draft data, every version and document manifest (FR-20)","tags":["export"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/units/transfer":{"post":{"summary":"Transfer units to the tenant that places them on the EU market, or to a sub-account (FR-35)","tags":["transfers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"unitIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":5000},"serials":{"type":"array","items":{"type":"string","maxLength":61},"maxItems":5000},"toTenant":{"type":"string","minLength":2,"maxLength":41,"description":"slug of the receiving tenant"},"shipmentRef":{"type":"string","maxLength":120},"note":{"type":"string","maxLength":500}},"required":["toTenant"]}}}},"responses":{"200":{"description":"Default Response"}}}},"/api/v1/transfers":{"get":{"summary":"Transfers addressed to the calling tenant (open by default) or sent by it","tags":["transfers"],"parameters":[{"schema":{"type":"string","enum":["incoming","outgoing"]},"in":"query","name":"direction","required":false},{"schema":{"type":"boolean"},"in":"query","name":"all","required":false}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/transfers/{id}/accept":{"post":{"summary":"Accept a transfer: the caller becomes the responsible operator and the passport goes live (FR-35)","tags":["transfers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"placedOnMarketAt":{"type":"string","format":"date"}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/transfers/{id}/reject":{"post":{"summary":"Reject (receiver) or withdraw (sender) an open transfer","tags":["transfers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":300}}}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/models/{id}/publications":{"post":{"summary":"Publish a model record to a tenant, which then attaches units to it (FR-32)","tags":["models"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tenant":{"type":"string","description":"slug of the subscribing tenant"}},"required":["tenant"]}}}},"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/api/v1/whoami":{"get":{"summary":"Identify the caller","tags":["auth"],"responses":{"200":{"description":"Default Response"}}}},"/.well-known/tracell-keys.json":{"get":{"summary":"Public keys that sign passport versions (SEC-03)","tags":["passports"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/context/lmt-2027.2.jsonld":{"get":{"summary":"JSON-LD context generated from the data dictionary (IO-04)","tags":["passports"],"security":[],"responses":{"200":{"description":"Default Response"}}}},"/{token}/spare-parts":{"get":{"summary":"Part numbers and sources of replacement spares: the page the registry format links to; restricted tiers need the matching access grant","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}/safety-measures":{"get":{"summary":"Safety measures: the page the registry format links to; restricted tiers need the matching access grant","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}/test-reports":{"get":{"summary":"Test reports proving compliance: the page the registry format links to; restricted tiers need the matching access grant","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}":{"get":{"summary":"Read a passport at its identifier URL: HTML for browsers; for any other client, or with a .json suffix, JSON in the registry format of the Commission battery vocabulary 1.0.0 (LMT sub-group, ADR 0010); ?format=tracell for the signed Tracell format; ?version=n or ?asOf=YYYY-MM-DD for earlier versions (IO-03, FR-18)","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}/versions":{"get":{"summary":"List the published versions of a passport with their hashes and signatures (FR-18)","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}/qr.svg":{"get":{"summary":"QR code of the identifier as SVG, error correction M (ID-02)","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}/qr.png":{"get":{"summary":"QR code of the identifier as PNG (?size=96..2048)","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/{token}/documents/{docId}":{"get":{"summary":"Download a passport document; restricted tiers need the matching access grant","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"token","required":true},{"schema":{"type":"string"},"in":"path","name":"docId","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/s/{share}":{"get":{"summary":"View a passport through a purchaser's time-limited share link (FR-25)","tags":["passports"],"security":[],"parameters":[{"schema":{"type":"string"},"in":"path","name":"share","required":true}],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://app.tracell.org"}],"security":[{"bearer":[]}]}