{
 "openapi": "3.0.3",
 "info": {
  "title": "Bramble Atlas API",
  "version": "2026-11-13",
  "description": "Bramble Atlas is IT documentation for MSPs: organisations (your PSA customers) and their people, locations, configurations and flexible assets, the password vault, documents with versions, domains and certificates with expiry checks, files, relationships, and network and rack diagrams.\n"
 },
 "servers": [
  {
   "url": "https://{org}.brambleit.cloud/atlas",
   "variables": {
    "org": {
     "default": "your-org"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   },
   "session": {
    "type": "apiKey",
    "in": "cookie",
    "name": "sso_session"
   },
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT"
   }
  }
 },
 "tags": [
  {
   "name": "Home & search",
   "description": "The home page, search across everything, things expiring soon, people (for pickers), and the password generator."
  },
  {
   "name": "Organisations",
   "description": "Organisations with their overview, activity, contacts, locations, RMM link, and lists of their assets, passwords, documents, domains and diagrams."
  },
  {
   "name": "Contacts",
   "description": "People and locations at an organisation."
  },
  {
   "name": "Configurations & assets",
   "description": "Configurations (servers, workstations, network kit…) and flexible assets of any type your admins define. Assets can be linked to RMM devices and kept in step with them, and related to each other.\n"
  },
  {
   "name": "Password vault",
   "description": "Stored passwords, with TOTP codes. Values are encrypted; reading one is a separate, logged `reveal`.\n"
  },
  {
   "name": "Documents",
   "description": "Documents and procedures with full version history. Library documents can be copied into an organisation."
  },
  {
   "name": "Domains & certificates",
   "description": "Domains and their SSL certificates, checked daily (registration expiry from RDAP, certificate from port 443)."
  },
  {
   "name": "Diagrams",
   "description": "Network diagrams and rack layouts with versions. \"Generate\" draws a starting diagram from Atlas assets, RMM network discovery and UniFi topology.\n"
  },
  {
   "name": "Files",
   "description": "Attachments on any record, stored encrypted in Bramble."
  },
  {
   "name": "Admin",
   "description": "Asset types and their fields, Atlas settings and storage. Needs Global Administrator or Atlas Admin."
  }
 ],
 "paths": {
  "/api/admin/overview": {
   "get": {
    "tags": [
     "Admin"
    ],
    "summary": "Atlas admin overview",
    "operationId": "get-api-admin-overview",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Admins only (Global Administrator or the app's admin role).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "types": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "assets": {
              "type": "integer"
             }
            }
           }
          },
          "field_types": {
           "type": "array",
           "items": {}
          },
          "ref_kinds": {
           "type": "array",
           "items": {}
          },
          "settings": {
           "type": "object",
           "properties": {
            "warn_days": {}
           }
          },
          "counts": {
           "type": "object",
           "properties": {
            "licensed_users": {
             "type": "integer"
            }
           }
          },
          "admins": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/admin/types": {
   "post": {
    "tags": [
     "Admin"
    ],
    "summary": "Create an asset type",
    "operationId": "post-api-admin-types",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Admins only (Global Administrator or the app's admin role).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "type": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "The type's name."
         },
         "category": {
          "type": "string",
          "description": "Where it's grouped."
         },
         "icon": {},
         "colour": {},
         "description": {
          "type": "string"
         },
         "fields": {
          "type": "array",
          "items": {},
          "description": "The type's fields (name, kind, required, secret…)."
         },
         "sort": {
          "type": "number"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/admin/types/{id}": {
   "put": {
    "tags": [
     "Admin"
    ],
    "summary": "Update an asset type",
    "operationId": "put-api-admin-types-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Admins only (Global Administrator or the app's admin role).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "type": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Type not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "fields": {
          "type": "array",
          "items": {}
         },
         "archived": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/admin/settings": {
   "put": {
    "tags": [
     "Admin"
    ],
    "summary": "Update Atlas settings",
    "operationId": "put-api-admin-settings",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Admins only (Global Administrator or the app's admin role).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "settings": {
           "type": "object",
           "properties": {
            "warn_days": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "warn_days": {
          "type": "number",
          "description": "Days before an expiry to warn."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/admin/storage": {
   "get": {
    "tags": [
     "Admin"
    ],
    "summary": "What Atlas keeps in BRM-Blob: Blob's own figures for app \"atlas\" (used, any Atlas limit, the tenant pool) plus a breakdown from the files table by kind and o…",
    "operationId": "get-api-admin-storage",
    "description": "What Atlas keeps in BRM-Blob: Blob's own figures for app \"atlas\" (used, any Atlas limit, the tenant pool) plus a breakdown from the files table by kind and organisation, the largest files, and what can be freed.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Admins only (Global Administrator or the app's admin role).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "usage": {},
          "kinds": {
           "type": "array",
           "items": {}
          },
          "orgs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "name": {
              "type": "string",
              "nullable": true
             }
            }
           }
          },
          "largest": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "size": {
              "type": "number"
             },
             "org_name": {
              "nullable": true
             }
            }
           }
          },
          "spare": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/admin/storage/free": {
   "post": {
    "tags": [
     "Admin"
    ],
    "summary": "Deletes the files counted in \"spare\": attachments of records deleted more than 30 days ago, and document images that were never saved into a document",
    "operationId": "post-api-admin-storage-free",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Admins only (Global Administrator or the app's admin role).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/me": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Who you are: the signed-in person and what they can do here",
    "operationId": "get-api-me",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "user": {},
          "types": {
           "type": "array",
           "items": {}
          },
          "settings": {
           "type": "object",
           "properties": {
            "warn_days": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/home": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Home page summary",
    "operationId": "get-api-home",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "recents": {
           "type": "array",
           "items": {}
          },
          "expiring": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "kind": {
              "type": "string"
             },
             "ref_id": {
              "type": "integer"
             },
             "field": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "expires_on": {
              "type": "string",
              "format": "date"
             },
             "customer_id": {
              "type": "integer",
              "nullable": true
             }
            }
           }
          },
          "counts": {
           "type": "object",
           "properties": {
            "orgs": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "List organisations",
    "operationId": "get-api-orgs",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "orgs": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "short_name": {
              "type": "string",
              "nullable": true
             },
             "domain": {
              "type": "string",
              "nullable": true
             },
             "website": {
              "type": "string",
              "nullable": true
             },
             "phone": {
              "type": "string",
              "nullable": true
             },
             "status": {
              "type": "string"
             },
             "org_type": {
              "type": "string",
              "nullable": true
             },
             "alert_note": {
              "type": "string",
              "nullable": true
             },
             "account_manager_id": {
              "type": "integer",
              "nullable": true
             },
             "logo_file_id": {
              "type": "integer",
              "nullable": true
             },
             "updated_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "contacts": {
              "type": "boolean"
             },
             "open_tickets": {
              "type": "boolean"
             },
             "assets": {
              "type": "integer"
             },
             "passwords": {
              "type": "integer"
             },
             "documents": {
              "type": "integer"
             },
             "expiring": {
              "type": "integer"
             },
             "devices": {
              "type": "number"
             },
             "devices_online": {
              "type": "number"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Create an organisation",
    "operationId": "post-api-orgs",
    "description": "Creates the customer (it also appears in PSA).\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "org": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "short_name": {
          "type": "string"
         },
         "domain": {
          "type": "string"
         },
         "website": {
          "type": "string"
         },
         "phone": {
          "type": "string"
         },
         "address": {
          "type": "string"
         },
         "notes": {
          "type": "string"
         },
         "alert_note": {
          "type": "string"
         },
         "status": {
          "type": "string"
         },
         "org_type": {
          "type": "string"
         },
         "account_manager_id": {
          "type": "integer"
         },
         "primary_contact_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/orgs/{id}": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "Get an organisation",
    "operationId": "get-api-orgs-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "org": {},
          "counts": {
           "type": "object",
           "properties": {
            "contacts": {
             "type": "integer"
            },
            "types": {
             "type": "array",
             "items": {}
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Organisations"
    ],
    "summary": "Update an organisation",
    "operationId": "put-api-orgs-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "org": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/logo": {
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "The organisation's logo: a PNG/JPEG/WebP (the page scales it to 256 px first), kept as an Atlas file in Blob",
    "operationId": "post-api-orgs-id-logo",
    "description": "The organisation's logo: a PNG/JPEG/WebP (the page scales it to 256 px first), kept as an Atlas file in Blob. Replacing or removing it deletes the old one.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "logo_file_id": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Organisations"
    ],
    "summary": "Remove an organisation's logo",
    "operationId": "delete-api-orgs-id-logo",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/overview": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "The organisation's one-page summary: open tickets, devices, what's running out, what changed, pinned documents",
    "operationId": "get-api-orgs-id-overview",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "tickets": {
           "type": "array",
           "items": {}
          },
          "ticket_stats": {
           "type": "object",
           "properties": {
            "open": {
             "type": "number"
            },
            "closed_30d": {
             "type": "number"
            },
            "new_30d": {
             "type": "number"
            }
           }
          },
          "devices": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "online": {},
             "os_type": {
              "type": "string"
             },
             "device_type": {
              "type": "string"
             },
             "last_seen": {},
             "asset": {}
            }
           }
          },
          "expiring": {},
          "recent": {},
          "pinned": {},
          "location": {
           "type": "object",
           "nullable": true,
           "properties": {
            "id": {
             "type": "integer",
             "nullable": true
            },
            "tenant_id": {
             "type": "integer"
            },
            "customer_id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "address1": {
             "type": "string",
             "nullable": true
            },
            "address2": {
             "type": "string",
             "nullable": true
            },
            "city": {
             "type": "string",
             "nullable": true
            },
            "region": {
             "type": "string",
             "nullable": true
            },
            "postcode": {
             "type": "string",
             "nullable": true
            },
            "country": {
             "type": "string",
             "nullable": true
            },
            "phone": {
             "type": "string",
             "nullable": true
            },
            "is_primary": {
             "type": "boolean"
            },
            "notes": {
             "type": "string",
             "nullable": true
            },
            "created_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            },
            "updated_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            },
            "archived_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            }
           }
          },
          "primary_contact": {},
          "important": {},
          "manager": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/activity": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's recent activity",
    "operationId": "get-api-orgs-id-activity",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "before",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "activity": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "actor_name": {},
             "action": {
              "type": "string"
             },
             "kind": {
              "type": "string"
             },
             "ref_id": {},
             "detail": {
              "type": "string",
              "nullable": true
             },
             "created_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/contacts": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's contacts",
    "operationId": "get-api-orgs-id-contacts",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "contacts": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Add a contact",
    "operationId": "post-api-orgs-id-contacts",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "contact": {
           "type": "object"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "first_name": {
          "type": "string"
         },
         "last_name": {
          "type": "string"
         },
         "email": {
          "type": "string"
         },
         "phone": {
          "type": "string"
         },
         "mobile": {
          "type": "string"
         },
         "job_title": {
          "type": "string"
         },
         "contact_type": {
          "type": "string"
         },
         "location_id": {
          "type": "integer"
         },
         "is_important": {
          "type": "boolean"
         },
         "notes": {
          "type": "string"
         },
         "primary": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/contacts/{id}": {
   "get": {
    "tags": [
     "Contacts"
    ],
    "summary": "Get a contact",
    "operationId": "get-api-contacts-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "contact": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Contacts"
    ],
    "summary": "Update a contact",
    "operationId": "put-api-contacts-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "contact": {
           "type": "object",
           "properties": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "primary": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Contacts"
    ],
    "summary": "Delete a contact",
    "operationId": "delete-api-contacts-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/locations": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's locations",
    "operationId": "get-api-orgs-id-locations",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "locations": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "tenant_id": {
              "type": "integer"
             },
             "customer_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "address1": {
              "type": "string",
              "nullable": true
             },
             "address2": {
              "type": "string",
              "nullable": true
             },
             "city": {
              "type": "string",
              "nullable": true
             },
             "region": {
              "type": "string",
              "nullable": true
             },
             "postcode": {
              "type": "string",
              "nullable": true
             },
             "country": {
              "type": "string",
              "nullable": true
             },
             "phone": {
              "type": "string",
              "nullable": true
             },
             "is_primary": {
              "type": "boolean"
             },
             "notes": {
              "type": "string",
              "nullable": true
             },
             "created_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "updated_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "archived_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Add a location",
    "operationId": "post-api-orgs-id-locations",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "location": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer",
             "nullable": true
            },
            "tenant_id": {
             "type": "integer"
            },
            "customer_id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "address1": {
             "type": "string",
             "nullable": true
            },
            "address2": {
             "type": "string",
             "nullable": true
            },
            "city": {
             "type": "string",
             "nullable": true
            },
            "region": {
             "type": "string",
             "nullable": true
            },
            "postcode": {
             "type": "string",
             "nullable": true
            },
            "country": {
             "type": "string",
             "nullable": true
            },
            "phone": {
             "type": "string",
             "nullable": true
            },
            "is_primary": {
             "type": "boolean"
            },
            "notes": {
             "type": "string",
             "nullable": true
            },
            "created_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            },
            "updated_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            },
            "archived_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "address1": {
          "type": "string"
         },
         "address2": {
          "type": "string"
         },
         "city": {
          "type": "string"
         },
         "region": {
          "type": "string"
         },
         "postcode": {
          "type": "string"
         },
         "country": {
          "type": "string"
         },
         "phone": {
          "type": "string"
         },
         "is_primary": {
          "type": "boolean"
         },
         "notes": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/locations/{id}": {
   "put": {
    "tags": [
     "Contacts"
    ],
    "summary": "Update a location",
    "operationId": "put-api-locations-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "location": {
           "type": "object",
           "properties": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Contacts"
    ],
    "summary": "Delete a location",
    "operationId": "delete-api-locations-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/rmm": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "The organisation's RMM sites and devices",
    "operationId": "get-api-orgs-id-rmm",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {}
          },
          "devices": {
           "type": "array",
           "items": {}
          },
          "available_sites": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/rmm/link-site": {
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Link an RMM site to the organisation",
    "operationId": "post-api-orgs-id-rmm-link-site",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "site_id": {
          "type": "integer",
          "description": "The RMM site."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/orgs/{id}/rmm/unlink-site": {
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Unlink an RMM site",
    "operationId": "post-api-orgs-id-rmm-unlink-site",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "site_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/orgs/{id}/rmm/import": {
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Import RMM devices as configurations",
    "operationId": "post-api-orgs-id-rmm-import",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "imported": {
           "type": "integer"
          },
          "ids": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_ids": {
          "type": "array",
          "items": {},
          "description": "The devices to import."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/search": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Search Atlas",
    "operationId": "get-api-search",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {},
      "description": "Text to search for."
     },
     {
      "name": "org",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      },
      "description": "Only within this organisation."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "results": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/expiries": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Things expiring soon",
    "operationId": "get-api-expiries",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "days",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      },
      "description": "How far ahead to look."
     },
     {
      "name": "org",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      },
      "description": "Only this organisation."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "expiries": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "kind": {
              "type": "string"
             },
             "ref_id": {
              "type": "integer"
             },
             "field": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "expires_on": {
              "type": "string",
              "format": "date"
             },
             "customer_id": {
              "type": "integer",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/users": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "People in the tenant (account manager pickers)",
    "operationId": "get-api-users",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "users": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "email": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/assets": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's assets",
    "operationId": "get-api-orgs-id-assets",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      },
      "description": "Only this asset type."
     },
     {
      "name": "category",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string",
       "enum": [
        "configuration",
        "flexible"
       ]
      },
      "description": "Only this category."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "assets": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "location_name": {
              "type": "string"
             },
             "data": {
              "type": "object"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Add an asset",
    "operationId": "post-api-orgs-id-assets",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "asset": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "status": {
          "type": "string"
         },
         "location_id": {
          "type": "integer"
         },
         "contact_id": {
          "type": "integer"
         },
         "notes": {
          "type": "array",
          "items": {}
         },
         "hostname": {
          "type": "string"
         },
         "ip": {
          "type": "string"
         },
         "mac": {
          "type": "string"
         },
         "serial": {
          "type": "string"
         },
         "manufacturer": {
          "type": "string"
         },
         "model": {
          "type": "string"
         },
         "os": {
          "type": "string"
         },
         "purchased_on": {
          "type": "string",
          "format": "date"
         },
         "warranty_expires": {
          "type": "string",
          "format": "date"
         },
         "type_id": {
          "type": "integer"
         },
         "data": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/assets/{id}": {
   "get": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Get an asset",
    "operationId": "get-api-assets-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "asset": {},
          "type": {
           "type": "string"
          },
          "refs": {
           "type": "array",
           "items": {}
          },
          "rmm": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Update an asset",
    "operationId": "put-api-assets-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "data": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Delete an asset",
    "operationId": "delete-api-assets-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/assets/{id}/reveal": {
   "post": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Reveal a secret field",
    "operationId": "post-api-assets-id-reveal",
    "description": "Returns one secret field's value and logs it.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "value": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "No such secret field"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "key": {
          "type": "string",
          "description": "The field."
         },
         "copy": {
          "description": "`true` when it's being copied rather than shown (recorded in the log)."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/assets/{id}/rmm-sync": {
   "post": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Update an asset from its RMM device",
    "operationId": "post-api-assets-id-rmm-sync",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "rmm": {}
         }
        }
       }
      }
     },
     "404": {
      "description": "The RMM device has gone"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/assets/{id}/rmm-link": {
   "post": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Link an asset to an RMM device",
    "operationId": "post-api-assets-id-rmm-link",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "device_id": {
          "type": "integer",
          "description": "The device."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/relations": {
   "get": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "What a record is related to",
    "operationId": "get-api-relations",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "The record's kind (asset, password, document…)."
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      },
      "description": "Its id."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "relations": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Relate two records",
    "operationId": "post-api-relations",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Record not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "a_kind": {
          "type": "string"
         },
         "b_kind": {
          "type": "string"
         },
         "note": {
          "type": "string"
         },
         "a_id": {
          "type": "integer"
         },
         "b_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/relations/{id}": {
   "delete": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Remove a relation",
    "operationId": "delete-api-relations-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/files": {
   "get": {
    "tags": [
     "Files"
    ],
    "summary": "Files on a record",
    "operationId": "get-api-files",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "The record's kind."
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      },
      "description": "Its id."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "files": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "filename": {
              "type": "string"
             },
             "mime": {
              "type": "string"
             },
             "size": {
              "type": "integer"
             },
             "uploaded_name": {
              "type": "string",
              "nullable": true
             },
             "created_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Files"
    ],
    "summary": "Attach a file",
    "operationId": "post-api-files",
    "description": "The request body is the file's bytes; `kind`, `id` and `name` are in the query string.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "name",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "file": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "filename": {
             "type": "string"
            },
            "mime": {},
            "size": {
             "type": "integer"
            },
            "url": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "411": {
      "description": "The upload has no size"
     },
     "413": {
      "description": "Images can be up to 25 MB"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/files/{id}": {
   "get": {
    "tags": [
     "Files"
    ],
    "summary": "Download a file",
    "operationId": "get-api-files-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "download",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "404": {
      "description": "File not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Files"
    ],
    "summary": "Delete a file",
    "operationId": "delete-api-files-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "File not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/passwords": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's passwords",
    "operationId": "get-api-orgs-id-passwords",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "passwords": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Add a password to an organisation",
    "operationId": "post-api-orgs-id-passwords",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/passwords": {
   "get": {
    "tags": [
     "Password vault"
    ],
    "summary": "Passwords that belong to no organisation: the MSP's own (distributors, vendor portals...)",
    "operationId": "get-api-passwords",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "asset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "passwords": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Password vault"
    ],
    "summary": "Add a password with no organisation",
    "operationId": "post-api-passwords",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/passwords/{id}": {
   "get": {
    "tags": [
     "Password vault"
    ],
    "summary": "Get a password's details (not its value)",
    "operationId": "get-api-passwords-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "password": {
           "type": "object"
          },
          "asset": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Password vault"
    ],
    "summary": "Update a password",
    "operationId": "put-api-passwords-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Only Atlas administrators can change who sees a password"
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "restricted": {
          "type": "boolean",
          "description": "Only Atlas admins may reveal it."
         },
         "password": {
          "description": "A new value (leave out to keep the current one)."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Password vault"
    ],
    "summary": "Delete a password",
    "operationId": "delete-api-passwords-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/passwords/{id}/reveal": {
   "post": {
    "tags": [
     "Password vault"
    ],
    "summary": "Reveal a password",
    "operationId": "post-api-passwords-id-reveal",
    "description": "Returns the value and logs it.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "value": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "what": {
          "type": "string",
          "description": "`password` or `notes`."
         },
         "copy": {
          "description": "`true` when it's being copied rather than shown."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/passwords/{id}/totp": {
   "post": {
    "tags": [
     "Password vault"
    ],
    "summary": "Current TOTP code for a password",
    "operationId": "post-api-passwords-id-totp",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/generate": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Generate a strong password",
    "operationId": "get-api-generate",
    "description": "A strong random password (the generator in the edit sheet).\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "length",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      },
      "description": "Number of characters."
     },
     {
      "name": "k",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "password": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/documents": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's documents",
    "operationId": "get-api-orgs-id-documents",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "documents": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Add a document to an organisation",
    "operationId": "post-api-orgs-id-documents",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/documents": {
   "get": {
    "tags": [
     "Documents"
    ],
    "summary": "Library documents",
    "operationId": "get-api-documents",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "documents": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Documents"
    ],
    "summary": "Add a library document",
    "operationId": "post-api-documents",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/documents/{id}": {
   "get": {
    "tags": [
     "Documents"
    ],
    "summary": "Get a document",
    "operationId": "get-api-documents-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "document": {},
          "versions": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Documents"
    ],
    "summary": "Save a document",
    "operationId": "put-api-documents-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "updated_at": {
           "type": "string",
           "format": "date-time"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "base_updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "The `updated_at` you started editing from. If it has changed, you get `409`."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Documents"
    ],
    "summary": "Archive a document",
    "operationId": "delete-api-documents-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/documents/{id}/versions": {
   "get": {
    "tags": [
     "Documents"
    ],
    "summary": "A document's versions",
    "operationId": "get-api-documents-id-versions",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "versions": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "title": {
              "type": "string"
             },
             "saved_name": {
              "type": "string",
              "nullable": true
             },
             "saved_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/documents/{id}/versions/{vid}": {
   "get": {
    "tags": [
     "Documents"
    ],
    "summary": "Get a document version",
    "operationId": "get-api-documents-id-versions-vid",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "version": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer",
             "nullable": true
            },
            "document_id": {
             "type": "integer"
            },
            "title": {
             "type": "string"
            },
            "body": {
             "type": "string",
             "nullable": true
            },
            "saved_by": {
             "type": "integer",
             "nullable": true
            },
            "saved_name": {
             "type": "string",
             "nullable": true
            },
            "saved_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Version not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/documents/{id}/versions/{vid}/restore": {
   "post": {
    "tags": [
     "Documents"
    ],
    "summary": "Restore a document version",
    "operationId": "post-api-documents-id-versions-vid-restore",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Version not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/documents/{id}/copy": {
   "post": {
    "tags": [
     "Documents"
    ],
    "summary": "Copy a library document (e.g",
    "operationId": "post-api-documents-id-copy",
    "description": "Copy a library document (e.g. an SOP template) into an organisation.\n\nRequires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "document": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "org": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/orgs/{id}/domains": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's domains",
    "operationId": "get-api-orgs-id-domains",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "domains": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "tenant_id": {
              "type": "integer"
             },
             "customer_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "registrar": {
              "type": "string",
              "nullable": true
             },
             "dns_host": {
              "type": "string",
              "nullable": true
             },
             "expires_on": {
              "type": "string",
              "format": "date",
              "nullable": true
             },
             "auto_check": {
              "type": "boolean"
             },
             "check_ssl": {
              "type": "boolean"
             },
             "ssl_host": {
              "type": "string",
              "nullable": true
             },
             "ssl_expires_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "ssl_issuer": {
              "type": "string",
              "nullable": true
             },
             "ssl_subject": {
              "type": "string",
              "nullable": true
             },
             "nameservers": {
              "type": "string",
              "nullable": true
             },
             "last_checked_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "last_error": {
              "type": "string",
              "nullable": true
             },
             "notes": {
              "type": "string",
              "nullable": true
             },
             "created_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "updated_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "archived_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Add a domain",
    "operationId": "post-api-orgs-id-domains",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "domain": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/domains/{id}": {
   "put": {
    "tags": [
     "Domains & certificates"
    ],
    "summary": "Update a domain",
    "operationId": "put-api-domains-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Domains & certificates"
    ],
    "summary": "Delete a domain",
    "operationId": "delete-api-domains-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/domains/{id}/check": {
   "post": {
    "tags": [
     "Domains & certificates"
    ],
    "summary": "Check a domain and its certificate now",
    "operationId": "post-api-domains-id-check",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "domain": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "Checked less than a minute ago — try again shortly"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/diagrams": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "An organisation's diagrams",
    "operationId": "get-api-orgs-id-diagrams",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "diagrams": {
           "type": "array",
           "items": {
            "type": "object"
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Create a diagram",
    "operationId": "post-api-orgs-id-diagrams",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "diagram": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string",
          "description": "`network` or `rack`."
         },
         "name": {
          "type": "string",
          "description": "The diagram's name."
         },
         "data": {
          "description": "The diagram itself (editor JSON)."
         },
         "description": {
          "type": "string"
         },
         "location_id": {
          "type": "integer"
         },
         "thumb": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/diagrams/{id}": {
   "get": {
    "tags": [
     "Diagrams"
    ],
    "summary": "Get a diagram",
    "operationId": "get-api-diagrams-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "diagram": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   },
   "put": {
    "tags": [
     "Diagrams"
    ],
    "summary": "Save a diagram",
    "operationId": "put-api-diagrams-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "version": {},
          "updated_at": {
           "type": "string",
           "format": "date-time"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "base_version": {
          "type": "number",
          "description": "The version you started from. If it has changed, you get `409`."
         },
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "location_id": {
          "type": "integer"
         },
         "pinned": {
          "type": "boolean"
         },
         "thumb": {},
         "data": {},
         "checkpoint": {
          "description": "Keep this save as a named version."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Diagrams"
    ],
    "summary": "Archive a diagram",
    "operationId": "delete-api-diagrams-id",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/diagrams/{id}/duplicate": {
   "post": {
    "tags": [
     "Diagrams"
    ],
    "summary": "Copy a diagram",
    "operationId": "post-api-diagrams-id-duplicate",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "diagram": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/diagrams/{id}/versions": {
   "get": {
    "tags": [
     "Diagrams"
    ],
    "summary": "A diagram's versions",
    "operationId": "get-api-diagrams-id-versions",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "versions": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "version": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "saved_name": {
              "type": "string",
              "nullable": true
             },
             "saved_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/diagrams/{id}/versions/{vid}": {
   "get": {
    "tags": [
     "Diagrams"
    ],
    "summary": "Get a diagram version",
    "operationId": "get-api-diagrams-id-versions-vid",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "version": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer",
             "nullable": true
            },
            "diagram_id": {
             "type": "integer"
            },
            "version": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "data": {
             "type": "string"
            },
            "saved_by": {
             "type": "integer",
             "nullable": true
            },
            "saved_name": {
             "type": "string",
             "nullable": true
            },
            "saved_at": {
             "type": "string",
             "format": "date-time",
             "nullable": true
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Version not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/diagrams/{id}/versions/{vid}/restore": {
   "post": {
    "tags": [
     "Diagrams"
    ],
    "summary": "Restore a diagram version",
    "operationId": "post-api-diagrams-id-versions-vid-restore",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Version not found"
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/diagram-sources": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "Everything the editor's side panels and live overlay need",
    "operationId": "get-api-orgs-id-diagram-sources",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "assets": {
           "type": "array",
           "items": {}
          },
          "lans": {
           "type": "array",
           "items": {}
          },
          "internet": {},
          "locations": {
           "type": "array",
           "items": {}
          },
          "unifi": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "connector_id": {
              "type": "integer"
             },
             "updated_at": {
              "type": "string",
              "format": "date-time"
             },
             "sites": {
              "type": "array",
              "items": {}
             }
            }
           }
          },
          "discovered": {},
          "rmm_sites": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/diagram-status": {
   "get": {
    "tags": [
     "Organisations"
    ],
    "summary": "Live state of the assets on a diagram (polled by the editor)",
    "operationId": "get-api-orgs-id-diagram-status",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "at": {
           "type": "string"
          },
          "assets": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  },
  "/api/orgs/{id}/diagrams/generate": {
   "post": {
    "tags": [
     "Organisations"
    ],
    "summary": "Draw a diagram from network data",
    "operationId": "post-api-orgs-id-diagrams-generate",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sources": {
           "type": "object",
           "properties": {
            "assets": {
             "type": "integer"
            },
            "unifi": {
             "type": "integer"
            },
            "discovered": {
             "type": "integer"
            },
            "internet": {
             "type": "integer"
            },
            "lans": {
             "type": "array",
             "items": {}
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "clients": {
          "type": "boolean",
          "description": "Include client devices from UniFi."
         },
         "discovered": {
          "type": "boolean",
          "description": "Include devices found by RMM network discovery."
         },
         "guess": {
          "type": "boolean",
          "description": "Guess links where the data doesn't say."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/assets/{id}/diagrams": {
   "get": {
    "tags": [
     "Configurations & assets"
    ],
    "summary": "Diagrams an asset appears on (asset page)",
    "operationId": "get-api-assets-id-diagrams",
    "description": "Requires: Signed-in browser session (the `sso_session` / `session_id` cookies from Bramble sign-in). Licence: Atlas.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "diagrams": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer",
              "nullable": true
             },
             "kind": {
              "type": "string"
             },
             "name": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "session": []
     }
    ]
   }
  }
 }
}