{"openapi":"3.0.0","info":{"title":"Ciconia API","version":"1.0","description":"Read your Ciconia trackers, their latest positions and history.\nSend your personal API token (Integrations page) as a bearer token\nwith every request.\n\nPositions are read live on every request, never from a cache.\n"},"servers":[{"url":"/"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/devices":{"get":{"operationId":"listDevices","summary":"List every device under the authenticated account","description":"Names and IDs only, no positions, so it's always fast. Get a\ntracker's position with GET /api/v1/devices/{public_id}.\n","responses":{"200":{"description":"The trackers. An empty list if the account has none yet.","content":{"application/json":{"schema":{"type":"object","properties":{"devices":{"type":"array","items":{"$ref":"#/components/schemas/DeviceSummary"}}},"required":["devices"]}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/devices/{public_id}":{"get":{"operationId":"getDevice","summary":"Get a device's current position and status","description":"The tracker's latest position, read live. Every field is always\nthere, with the same shape for every tracker model; a value the\ntracker hasn't reported is null (a new tracker has no position\nyet).\n","parameters":[{"name":"public_id","in":"path","required":true,"description":"The tracker's ID (device_id), shown as Device ID on its page.","schema":{"type":"string"}}],"responses":{"200":{"description":"The tracker's data.","content":{"application/json":{"schema":{"type":"object","properties":{"device":{"$ref":"#/components/schemas/Device"}},"required":["device"]}}}},"401":{"description":"Missing or invalid token, or a public_id that isn't on this\naccount. Both get the same answer, so IDs can't be guessed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Ciconia couldn't read the tracker's data just now. Try again on\nyour next poll.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v1/devices/{public_id}/history":{"get":{"operationId":"getDeviceHistory","summary":"Get a device's position history, newest first","description":"50 positions per page, newest first, read live on every request.\nA page can shift when new positions arrive between requests.\n","parameters":[{"name":"public_id","in":"path","required":true,"description":"The tracker's ID (device_id), shown as Device ID on its page.","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number, from 1 (the newest 50 positions).","schema":{"type":"integer","default":1}}],"responses":{"200":{"description":"The tracker's data.","content":{"application/json":{"schema":{"type":"object","properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/HistoryPosition"}},"page":{"type":"integer"},"per_page":{"type":"integer"},"total_count":{"type":"integer"},"total_pages":{"type":"integer"}},"required":["positions","page","per_page","total_count","total_pages"]}}}},"401":{"description":"Missing or invalid token, or a public_id that isn't on this\naccount. Both get the same answer, so IDs can't be guessed.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Ciconia couldn't read the tracker's data just now. Try again on\nyour next poll.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Your personal API token, from the Integrations page. It covers\nevery tracker on the account. \"Regenerate token\" there replaces it;\nthe old one stops working at once.\n"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},"DeviceSummary":{"type":"object","properties":{"device_id":{"type":"string","description":"The device's public_id.","example":"dv_8f2a1c4b9e6d"},"name":{"type":"string","example":"Dad's Car"},"model":{"type":"string","nullable":true,"example":"Basic"},"status":{"type":"string","enum":["provisioning","ready"],"description":"provisioning: still being activated, so it has no position yet (asking for it gives 502). ready: active."}},"required":["device_id","name","model","status"]},"Device":{"type":"object","properties":{"device_id":{"type":"string","description":"The tracker's ID, the same one the URLs use as {public_id}. Shown as Device ID on the tracker's page.","example":"dv_8f2a1c4b9e6d"},"name":{"type":"string","description":"The tracker's name, as set in the web app.","example":"Dad's Car"},"model":{"type":"string","nullable":true,"description":"The tracker model, or null if unknown.","example":"Basic"},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"altitude":{"type":"number","nullable":true},"speed":{"type":"number","nullable":true,"description":"Speed in km/h."},"battery_level":{"type":"number","nullable":true,"description":"Battery level. A percentage (0–100) for most trackers; some models report a supply voltage here instead."},"gsm_signal":{"type":"integer","nullable":true},"gsm_operator_code":{"type":"integer","nullable":true},"chip_temperature":{"type":"number","nullable":true,"description":"Temperature inside the tracker, in °C. Not the air around it."},"satellites":{"type":"integer","nullable":true},"hdop":{"type":"number","nullable":true,"description":"Horizontal dilution of precision: how well spread the satellites are. Lower is better; under 2 is good.","example":1.2},"gps_signal":{"type":"integer","nullable":true,"description":"Position quality 0–5, from hdop: 5 ideal (under 1), 4 excellent (1–2), 3 good (2–5), 2 moderate (5–10), 1 fair (10–20), 0 poor (over 20) or no fix.","example":4},"fixed_time":{"type":"string","format":"date-time","nullable":true,"description":"When the tracker measured this position. Use it, or fix_age_seconds, to tell how old the position is."},"fix_age_seconds":{"type":"integer","nullable":true,"description":"Seconds since fixed_time. Keeps growing while the tracker sends nothing new."},"device_time":{"type":"string","format":"date-time","nullable":true,"description":"The tracker's own clock at that moment. A big gap from fixed_time means the tracker's clock is off."},"server_time":{"type":"string","format":"date-time","nullable":true,"description":"When Ciconia received this position."},"attributes":{"type":"object","description":"Every raw value the tracker reported, unfiltered; what's in it depends on the model. {} before the first position. The fields above are taken from these."}},"required":["device_id","name","model","latitude","longitude","altitude","speed","battery_level","gsm_signal","gsm_operator_code","chip_temperature","satellites","hdop","gps_signal","fixed_time","fix_age_seconds","device_time","server_time","attributes"]},"HistoryPosition":{"type":"object","description":"The same fields as a device, without device_id, name and model.","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"},"altitude":{"type":"number"},"speed":{"type":"number"},"battery_level":{"type":"number","nullable":true},"gsm_signal":{"type":"integer","nullable":true},"gsm_operator_code":{"type":"integer","nullable":true},"chip_temperature":{"type":"number","nullable":true},"satellites":{"type":"integer","nullable":true},"hdop":{"type":"number","nullable":true},"gps_signal":{"type":"integer","nullable":true},"fixed_time":{"type":"string","format":"date-time"},"fix_age_seconds":{"type":"integer"},"device_time":{"type":"string","format":"date-time","nullable":true},"server_time":{"type":"string","format":"date-time","nullable":true},"attributes":{"type":"object"}},"required":["latitude","longitude","altitude","speed","battery_level","gsm_signal","gsm_operator_code","chip_temperature","satellites","hdop","gps_signal","fixed_time","fix_age_seconds","device_time","server_time","attributes"]}}}}