{
  "openapi": "3.1.0",
  "info": {
    "title": "AVDRA API",
    "version": "1.0.0",
    "description": "Projects, rooms, designs, BOMs, quotes and enterprise exports for an AVDRA account. Keys are created by an account owner or admin under Account → API & webhooks."
  },
  "servers": [
    {
      "url": "https://avdra.io/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "avdra_sk_… key from Account → API & webhooks"
      },
      "cronSecret": {
        "type": "http",
        "scheme": "bearer",
        "description": "The deployment's CRON_SECRET"
      }
    }
  },
  "paths": {
    "/projects": {
      "get": {
        "summary": "List projects",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "draft, in_review, approved or archived",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–200, default 50",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Paging offset",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Project[], total, limit, offset }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      },
      "post": {
        "summary": "Create a project (e.g. from a CRM opportunity)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "write",
        "parameters": [],
        "responses": {
          "200": {
            "description": "{ data: Project }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "string, required"
                  },
                  "client_name": {
                    "type": "string",
                    "description": "string"
                  },
                  "location": {
                    "type": "string",
                    "description": "string"
                  },
                  "target_ecosystem": {
                    "type": "string",
                    "description": "teams | zoom | google_meet | webex | tencent | agnostic"
                  },
                  "preferred_brand": {
                    "type": "string",
                    "description": "string"
                  },
                  "notes": {
                    "type": "string",
                    "description": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}": {
      "get": {
        "summary": "A project with its rooms",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Project & { rooms: Room[] } }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/projects/{projectId}/rooms": {
      "get": {
        "summary": "List a project's rooms",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Room[] }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      },
      "post": {
        "summary": "Add a room from a room type",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "write",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Room }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "string"
                  },
                  "room_type": {
                    "type": "string",
                    "description": "huddle | small | medium | large | boardroom | … (see /room-types)"
                  },
                  "width_m": {
                    "type": "string",
                    "description": "number"
                  },
                  "length_m": {
                    "type": "string",
                    "description": "number"
                  },
                  "ceiling_height_m": {
                    "type": "string",
                    "description": "number"
                  },
                  "seats": {
                    "type": "string",
                    "description": "integer"
                  },
                  "floor_id": {
                    "type": "string",
                    "description": "uuid"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/projects/{projectId}/quotes": {
      "get": {
        "summary": "A project's quotes",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Quote[] }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/projects/{projectId}/ifc": {
      "get": {
        "summary": "IFC4 model of every room (Revit, ArchiCAD, Navisworks)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "application/x-step"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/projects/{projectId}/places": {
      "get": {
        "summary": "Microsoft Places room metadata for Outlook and Teams room finder",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Mail domain for room mailboxes",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "json (Graph), ps1 (Set-PlaceV3 script) or csv",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Graph room JSON, PowerShell or CSV"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/projects/{projectId}/cmdb": {
      "get": {
        "summary": "ServiceNow CMDB import: one configuration item per device",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "csv (default) or json",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "planned (default) or installed",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "text/csv or JSON"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/rooms/{roomId}": {
      "get": {
        "summary": "A room and its latest design",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Room & { design } }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/rooms/{roomId}/bom": {
      "get": {
        "summary": "The room's bill of materials with list prices and supply state",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: BomLine[], currency }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/rooms/{roomId}/ifc": {
      "get": {
        "summary": "IFC4 model of one room",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "roomId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "application/x-step"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/quotes": {
      "get": {
        "summary": "List quotes",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": false,
            "description": "Filter by project",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "draft, pending_approval, approved, issued, accepted, declined, superseded",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ data: Quote[], total }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/webhooks/events": {
      "get": {
        "summary": "Webhook event types",
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "{ data: { id, name }[] }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    },
    "/webhooks/deliver": {
      "post": {
        "summary": "Deliver queued webhooks (your scheduler calls this with Authorization: Bearer CRON_SECRET)",
        "security": [
          {
            "cronSecret": []
          }
        ],
        "x-scope": "cron",
        "parameters": [],
        "responses": {
          "200": {
            "description": "{ attempted, delivered, failed }"
          },
          "401": {
            "description": "Missing, unknown, expired or revoked key"
          },
          "403": {
            "description": "Key lacks the scope, or the account's plan doesn't include the API"
          },
          "404": {
            "description": "Not found in this account"
          },
          "429": {
            "description": "Rate limited (120 requests a minute per key)"
          }
        }
      }
    }
  },
  "x-webhooks": [
    {
      "id": "project.created",
      "name": "A project is created"
    },
    {
      "id": "project.updated",
      "name": "A project's details change"
    },
    {
      "id": "project.status_changed",
      "name": "A project moves between draft, in review, approved and archived"
    },
    {
      "id": "project.deleted",
      "name": "A project is deleted"
    },
    {
      "id": "room.created",
      "name": "A room is added"
    },
    {
      "id": "room.updated",
      "name": "A room's size, type, seats or screens change"
    },
    {
      "id": "room.deleted",
      "name": "A room is removed"
    },
    {
      "id": "design.updated",
      "name": "A room's design (kit, layout, BOM) is saved"
    },
    {
      "id": "quote.created",
      "name": "A quote is started"
    },
    {
      "id": "quote.status_changed",
      "name": "A quote is submitted, approved, issued, accepted or declined"
    }
  ]
}