{
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "description": "API key (lk_live_..., lk_test_..., or lk_pub_...)",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Read-only access to tenant-owned warehouse layout projects. Create API keys in LOCURA Hub and use the modeler:projects:read scope.",
    "title": "LOCURA Modeler API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/projects": {
      "get": {
        "description": "Lists projects owned by the Hub client UUID stored as companyId on the API key.",
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "schema": {
              "default": 1,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "per_page",
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "building": {
                            "additionalProperties": false,
                            "properties": {
                              "columns": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "floor_type": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "outline_points": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "temperature": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "wall_height": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "outline_points",
                              "columns",
                              "wall_height",
                              "floor_type",
                              "temperature"
                            ],
                            "type": "object"
                          },
                          "counts": {
                            "additionalProperties": false,
                            "properties": {
                              "automation_paths": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "docks": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "doors": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "equipment": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "floors": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "multi_level_systems": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "sub_buildings": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "zones": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            },
                            "required": [
                              "floors",
                              "docks",
                              "doors",
                              "zones",
                              "equipment",
                              "automation_paths",
                              "multi_level_systems",
                              "sub_buildings"
                            ],
                            "type": "object"
                          },
                          "has_underlay": {
                            "type": "boolean"
                          },
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "revision": {
                            "anyOf": [
                              {
                                "minimum": 0,
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "updated_at": {
                            "anyOf": [
                              {
                                "format": "date-time",
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "version": {
                            "minimum": 1,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "version",
                          "revision",
                          "updated_at",
                          "building",
                          "counts",
                          "has_underlay"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "pagination": {
                      "additionalProperties": false,
                      "properties": {
                        "page": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "per_page": {
                          "maximum": 100,
                          "minimum": 1,
                          "type": "integer"
                        },
                        "total": {
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "page",
                        "per_page",
                        "total"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key"
          },
          "403": {
            "description": "Forbidden - missing required scope"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "List Modeler projects",
        "tags": [
          "Projects"
        ],
        "x-required-scope": "modeler:projects:read"
      }
    },
    "/api/v1/projects/{id}": {
      "get": {
        "description": "Returns layout geometry and project metadata for one tenant-owned project. Raw underlay image data, share tokens, PINs and internal R2 paths are excluded.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "pattern": "^[A-Za-z0-9_-]{1,200}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "data": {
                      "additionalProperties": false,
                      "properties": {
                        "automation_paths": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "building": {
                          "additionalProperties": false,
                          "properties": {
                            "columns": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "floor_type": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "outline_points": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "temperature": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "wall_height": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "outline_points",
                            "columns",
                            "wall_height",
                            "floor_type",
                            "temperature"
                          ],
                          "type": "object"
                        },
                        "building_layout": {
                          "type": "object"
                        },
                        "counts": {
                          "additionalProperties": false,
                          "properties": {
                            "automation_paths": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "docks": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "doors": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "equipment": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "floors": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "multi_level_systems": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "sub_buildings": {
                              "minimum": 0,
                              "type": "integer"
                            },
                            "zones": {
                              "minimum": 0,
                              "type": "integer"
                            }
                          },
                          "required": [
                            "floors",
                            "docks",
                            "doors",
                            "zones",
                            "equipment",
                            "automation_paths",
                            "multi_level_systems",
                            "sub_buildings"
                          ],
                          "type": "object"
                        },
                        "docks": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "doors": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "equipment": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "floors": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "has_underlay": {
                          "type": "boolean"
                        },
                        "id": {
                          "type": "string"
                        },
                        "multi_level_systems": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "name": {
                          "type": "string"
                        },
                        "project_rules": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "revision": {
                          "anyOf": [
                            {
                              "minimum": 0,
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sub_buildings": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "underlay": {
                          "additionalProperties": false,
                          "description": "Calibration metadata only. Raw bgImageData and storage chunks are never returned.",
                          "properties": {
                            "offset_x": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "offset_y": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "present": {
                              "type": "boolean"
                            },
                            "rotation": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "scale": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          },
                          "required": [
                            "present",
                            "scale",
                            "offset_x",
                            "offset_y",
                            "rotation"
                          ],
                          "type": "object"
                        },
                        "updated_at": {
                          "anyOf": [
                            {
                              "format": "date-time",
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "version": {
                          "minimum": 1,
                          "type": "integer"
                        },
                        "zones": {
                          "items": {
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "version",
                        "revision",
                        "updated_at",
                        "building",
                        "counts",
                        "has_underlay",
                        "building_layout",
                        "floors",
                        "docks",
                        "doors",
                        "zones",
                        "equipment",
                        "automation_paths",
                        "multi_level_systems",
                        "sub_buildings",
                        "project_rules",
                        "underlay"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success"
          },
          "401": {
            "description": "Unauthorized - missing or invalid API key"
          },
          "403": {
            "description": "Forbidden - missing required scope"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Internal server error"
          }
        },
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "summary": "Get a Modeler project",
        "tags": [
          "Projects"
        ],
        "x-required-scope": "modeler:projects:read"
      }
    }
  },
  "servers": [
    {
      "url": "https://modeler.locura.tech"
    }
  ]
}
