{
  "openapi": "3.1.0",
  "info": {
    "title": "SoSoMaps",
    "version": "0.1.0"
  },
  "paths": {
    "/api/v1/openapi.json": {
      "get": {
        "summary": "API schema",
        "description": "OpenAPI schema for v1 routes only. Authentication is not required.",
        "operationId": "openapi_json_api_v1_openapi_json_get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/docs": {
      "get": {
        "summary": "API usage documentation",
        "description": "Turkish-language v1 usage documentation without external resource loading. Authentication is not required.",
        "operationId": "docs_api_v1_docs_get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "summary": "Access key identity",
        "description": "Returns safe metadata for the key owner and the key in use. Includes neither the secret nor its digest.",
        "operationId": "me_api_v1_me_get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/projects": {
      "get": {
        "summary": "Accessible projects",
        "description": "Intersects current organisation and membership permissions with the key’s project scope. Returns projects in ID order.",
        "operationId": "projects_api_v1_projects_get",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}": {
      "get": {
        "summary": "Project information",
        "description": "Returns metadata and feature counts for enabled modules in an accessible project.",
        "operationId": "project_api_v1_projects__pid__get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/features": {
      "get": {
        "summary": "Project features",
        "description": "Paginates enabled feature types as GeoJSON in ID order. cursor is the project change cursor read before the feature query.",
        "operationId": "features_api_v1_projects__pid__features_get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Enabled feature type",
              "title": "Type"
            },
            "description": "Enabled feature type"
          },
          {
            "name": "bbox",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "WGS84 minx,miny,maxx,maxy bounds",
              "title": "Bounding box"
            },
            "description": "WGS84 minx,miny,maxx,maxy bounds"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Last returned feature ID",
              "default": "",
              "title": "After"
            },
            "description": "Last returned feature ID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Records per page: 1–5000",
              "default": 1000,
              "title": "Page size"
            },
            "description": "Records per page: 1–5000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/features/{fid}": {
      "get": {
        "summary": "Single feature",
        "description": "GeoJSON record of an undeleted feature of an enabled type. Returns 404 for inaccessible, disabled or deleted records.",
        "operationId": "feature_api_v1_projects__pid__features__fid__get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          },
          {
            "name": "fid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Feature ID"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/equipment": {
      "get": {
        "summary": "Fiber devices",
        "description": "Paginates enabled fiber devices in ID order using the existing edit response format. Returns 403 if fiber is disabled.",
        "operationId": "equipment_api_v1_projects__pid__equipment_get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          },
          {
            "name": "node_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Node ID",
              "title": "Node ID"
            },
            "description": "Node ID"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Last returned device ID",
              "default": "",
              "title": "After"
            },
            "description": "Last returned device ID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Records per page: 1–5000",
              "default": 1000,
              "title": "Page size"
            },
            "description": "Records per page: 1–5000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/connections": {
      "get": {
        "summary": "Fiber connections",
        "description": "Paginates enabled connections in ID order using the existing edit response format. Returns 403 if fiber is disabled.",
        "operationId": "connections_api_v1_projects__pid__connections_get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          },
          {
            "name": "node_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Node ID",
              "title": "Node ID"
            },
            "description": "Node ID"
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Last returned connection ID",
              "default": "",
              "title": "After"
            },
            "description": "Last returned connection ID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Records per page: 1–5000",
              "default": 1000,
              "title": "Page size"
            },
            "description": "Records per page: 1–5000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/circuits": {
      "get": {
        "summary": "Fiber circuits",
        "description": "Paginates enabled circuits using the existing edit response format. Hides the demand endpoint if the address module is disabled.",
        "operationId": "circuits_api_v1_projects__pid__circuits_get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Last returned circuit ID",
              "default": "",
              "title": "After"
            },
            "description": "Last returned circuit ID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Records per page: 1–5000",
              "default": 1000,
              "title": "Page size"
            },
            "description": "Records per page: 1–5000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/changes": {
      "get": {
        "summary": "Project change stream",
        "description": "Paginates raw changes in ascending ID order. Retains rows from disabled modules but returns gizli:true instead of before/after.",
        "operationId": "changes_api_v1_projects__pid__changes_get",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          },
          {
            "name": "after",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Last returned change ID",
              "default": 0,
              "title": "After"
            },
            "description": "Last returned change ID"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "description": "Records per page: 1–5000",
              "default": 1000,
              "title": "Page size"
            },
            "description": "Records per page: 1–5000"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/projects/{pid}/edit": {
      "post": {
        "summary": "Edit project",
        "description": "Applies existing EditIn operations in one transaction. request_id is required; retrying the same content returns the original response. Requires key write scope and project permissions.",
        "operationId": "edit_api_v1_projects__pid__edit_post",
        "parameters": [
          {
            "name": "pid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Project ID"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditIn"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EditIn": {
        "properties": {
          "ops": {
            "items": {
              "$ref": "#/components/schemas/Op"
            },
            "type": "array",
            "maxItems": 2000,
            "minItems": 1,
            "title": "Operations"
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9-]{8,64}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request ID"
          }
        },
        "type": "object",
        "required": [
          "ops"
        ],
        "title": "EditIn"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "Op": {
        "properties": {
          "op": {
            "type": "string",
            "title": "Operation"
          },
          "entity": {
            "type": "string",
            "title": "Entity",
            "default": "feature"
          },
          "id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "ID"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "node_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Node ID"
          },
          "unit_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Unit ID"
          },
          "ref_layer_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reference layer ID"
          },
          "geometry": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geometry"
          },
          "props": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Properties"
          },
          "a": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "A"
          },
          "b": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "B"
          },
          "child": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Child"
          },
          "parent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent"
          },
          "seq": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Sequence"
          },
          "via": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Via"
          },
          "via_no": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Via number"
          },
          "quality": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Quality"
          },
          "version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "parent_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parent ID"
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Location ID"
          },
          "slot": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slot"
          },
          "olculdu": {
            "anyOf": [
              {
                "items": {},
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Measured"
          },
          "endpoint_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint ID"
          },
          "yol": {
            "title": "Path"
          },
          "yol_sec": {
            "title": "Select path"
          },
          "yedek_sil": {
            "title": "Delete backup path"
          },
          "yol_degistir": {
            "title": "Change path"
          },
          "yol_secim": {
            "title": "Path selection"
          },
          "yollar": {
            "title": "Paths"
          },
          "elektrik": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Electric"
          },
          "hedef": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target"
          }
        },
        "type": "object",
        "required": [
          "op"
        ],
        "title": "Operation"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
