{
 "openapi": "3.1.0",
 "info": {
  "title": "Axsync API",
  "version": "2.14.0",
  "description": "REST API for Axsync notes, sync and search.",
  "contact": {
   "email": "api@axnode.net"
  }
 },
 "servers": [
  {
   "url": "https://api.axnode.net/v2"
  }
 ],
 "paths": {
  "/notes": {
   "get": {
    "tags": [
     "Notes"
    ],
    "summary": "List notes",
    "description": "Returns a paginated list of notes.",
    "operationId": "get_notes",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Notes"
    ],
    "summary": "Create a note",
    "description": "Creates a note.",
    "operationId": "post_notes",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Note"
       }
      }
     }
    }
   }
  },
  "/notes/{id}": {
   "get": {
    "tags": [
     "Notes"
    ],
    "summary": "Retrieve a note",
    "description": "Retrieves a note by its identifier.",
    "operationId": "get_notes_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Notes"
    ],
    "summary": "Update a note",
    "description": "Updates fields of a note. Only supplied fields change.",
    "operationId": "patch_notes_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Note"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Notes"
    ],
    "summary": "Delete a note",
    "description": "Permanently deletes a note. This cannot be undone.",
    "operationId": "delete_notes_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/notes/{id}/duplicate": {
   "post": {
    "tags": [
     "Notes"
    ],
    "summary": "Duplicate a note",
    "description": "Creates a copy with `(copy)` appended to the title.",
    "operationId": "post_notes_id_duplicate",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Note"
       }
      }
     }
    }
   }
  },
  "/notes/{id}/archive": {
   "post": {
    "tags": [
     "Notes"
    ],
    "summary": "Archive a note",
    "description": "Moves the note out of default listings without deleting it.",
    "operationId": "post_notes_id_archive",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Note"
       }
      }
     }
    }
   }
  },
  "/notes/{id}/restore": {
   "post": {
    "tags": [
     "Notes"
    ],
    "summary": "Restore a note",
    "description": "Restores an archived or recently deleted note (within 30 days).",
    "operationId": "post_notes_id_restore",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Note"
       }
      }
     }
    }
   }
  },
  "/notes/{id}/versions": {
   "get": {
    "tags": [
     "Notes"
    ],
    "summary": "List note versions",
    "description": "Returns the version history, newest first.",
    "operationId": "get_notes_id_versions",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/notes/{id}/versions/{version}/restore": {
   "post": {
    "tags": [
     "Notes"
    ],
    "summary": "Restore a version",
    "description": "Makes an earlier version current by creating a new version with its content.",
    "operationId": "post_notes_id_versions_version_restore",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Note"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "version",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Note"
       }
      }
     }
    }
   }
  },
  "/notebooks": {
   "get": {
    "tags": [
     "Notebooks"
    ],
    "summary": "List notebooks",
    "description": "Returns a paginated list of notebooks.",
    "operationId": "get_notebooks",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Notebook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Notebooks"
    ],
    "summary": "Create a notebook",
    "description": "Creates a notebook.",
    "operationId": "post_notebooks",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Notebook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Notebook"
       }
      }
     }
    }
   }
  },
  "/notebooks/{id}": {
   "get": {
    "tags": [
     "Notebooks"
    ],
    "summary": "Retrieve a notebook",
    "description": "Retrieves a notebook by its identifier.",
    "operationId": "get_notebooks_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Notebook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Notebooks"
    ],
    "summary": "Update a notebook",
    "description": "Updates fields of a notebook. Only supplied fields change.",
    "operationId": "patch_notebooks_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Notebook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Notebook"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Notebooks"
    ],
    "summary": "Delete a notebook",
    "description": "Permanently deletes a notebook. This cannot be undone.",
    "operationId": "delete_notebooks_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Notebook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/notebooks/{id}/move": {
   "post": {
    "tags": [
     "Notebooks"
    ],
    "summary": "Move a notebook",
    "description": "Changes the parent notebook. Moving into a descendant is rejected.",
    "operationId": "post_notebooks_id_move",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Notebook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Notebook"
       }
      }
     }
    }
   }
  },
  "/tags": {
   "get": {
    "tags": [
     "Tags"
    ],
    "summary": "List tags",
    "description": "Returns a paginated list of tags.",
    "operationId": "get_tags",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Tag"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Tags"
    ],
    "summary": "Create a tag",
    "description": "Creates a tag.",
    "operationId": "post_tags",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Tag"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Tag"
       }
      }
     }
    }
   }
  },
  "/tags/{id}": {
   "get": {
    "tags": [
     "Tags"
    ],
    "summary": "Retrieve a tag",
    "description": "Retrieves a tag by its identifier.",
    "operationId": "get_tags_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Tag"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Tags"
    ],
    "summary": "Update a tag",
    "description": "Updates fields of a tag. Only supplied fields change.",
    "operationId": "patch_tags_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Tag"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Tag"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Tags"
    ],
    "summary": "Delete a tag",
    "description": "Permanently deletes a tag. This cannot be undone.",
    "operationId": "delete_tags_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Tag"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/tags/merge": {
   "post": {
    "tags": [
     "Tags"
    ],
    "summary": "Merge tags",
    "description": "Moves all notes from the source tags to the target tag and deletes the sources.",
    "operationId": "post_tags_merge",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Tag"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Tag"
       }
      }
     }
    }
   }
  },
  "/attachments": {
   "get": {
    "tags": [
     "Attachments"
    ],
    "summary": "List attachments",
    "description": "Returns a paginated list of attachments.",
    "operationId": "get_attachments",
    "security": [
     {
      "bearerAuth": [
       "files:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Attachments"
    ],
    "summary": "Create an attachment",
    "description": "Creates an attachment.",
    "operationId": "post_attachments",
    "security": [
     {
      "bearerAuth": [
       "files:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Attachment"
       }
      }
     }
    }
   }
  },
  "/attachments/{id}": {
   "get": {
    "tags": [
     "Attachments"
    ],
    "summary": "Retrieve an attachment",
    "description": "Retrieves an attachment by its identifier.",
    "operationId": "get_attachments_id",
    "security": [
     {
      "bearerAuth": [
       "files:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Attachments"
    ],
    "summary": "Update an attachment",
    "description": "Updates fields of an attachment. Only supplied fields change.",
    "operationId": "patch_attachments_id",
    "security": [
     {
      "bearerAuth": [
       "files:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Attachment"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Attachments"
    ],
    "summary": "Delete an attachment",
    "description": "Permanently deletes an attachment. This cannot be undone.",
    "operationId": "delete_attachments_id",
    "security": [
     {
      "bearerAuth": [
       "files:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/attachments/uploads": {
   "post": {
    "tags": [
     "Attachments"
    ],
    "summary": "Create an upload",
    "description": "Returns a signed upload URL and the attachment record in `pending` state.",
    "operationId": "post_attachments_uploads",
    "security": [
     {
      "bearerAuth": [
       "files:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Attachment"
       }
      }
     }
    }
   }
  },
  "/attachments/{id}/download": {
   "get": {
    "tags": [
     "Attachments"
    ],
    "summary": "Get a download URL",
    "description": "Returns a fresh signed URL for the file.",
    "operationId": "get_attachments_id_download",
    "security": [
     {
      "bearerAuth": [
       "files:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Attachment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/sync/pull": {
   "post": {
    "tags": [
     "Sync"
    ],
    "summary": "Pull changes",
    "description": "Returns changes after the supplied cursor, up to `limit` records.",
    "operationId": "post_sync_pull",
    "security": [
     {
      "bearerAuth": [
       "sync"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sync"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Sync"
       }
      }
     }
    }
   }
  },
  "/sync/push": {
   "post": {
    "tags": [
     "Sync"
    ],
    "summary": "Push changes",
    "description": "Applies local changes atomically per record; conflicts are returned, not overwritten.",
    "operationId": "post_sync_push",
    "security": [
     {
      "bearerAuth": [
       "sync"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sync"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Sync"
       }
      }
     }
    }
   }
  },
  "/sync/stream": {
   "get": {
    "tags": [
     "Sync"
    ],
    "summary": "Stream changes",
    "description": "Opens a long-lived server-sent events stream of changes. Reconnect with the last cursor to resume without gaps.",
    "operationId": "get_sync_stream",
    "security": [
     {
      "bearerAuth": [
       "sync"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sync"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/sync/cursor": {
   "get": {
    "tags": [
     "Sync"
    ],
    "summary": "Get the latest cursor",
    "description": "Returns the newest cursor, useful for bootstrapping a new device.",
    "operationId": "get_sync_cursor",
    "security": [
     {
      "bearerAuth": [
       "sync"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sync"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/sync/devices": {
   "get": {
    "tags": [
     "Sync"
    ],
    "summary": "List devices",
    "description": "Lists devices that synced in the last 90 days.",
    "operationId": "get_sync_devices",
    "security": [
     {
      "bearerAuth": [
       "sync"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sync"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/sync/devices/{id}": {
   "delete": {
    "tags": [
     "Sync"
    ],
    "summary": "Revoke a device",
    "description": "Removes a device and invalidates its refresh token.",
    "operationId": "delete_sync_devices_id",
    "security": [
     {
      "bearerAuth": [
       "sync"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Sync"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/search": {
   "post": {
    "tags": [
     "Search"
    ],
    "summary": "Search notes",
    "description": "Runs a search with optional filters on notebook, tags, and date range.",
    "operationId": "post_search",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Search"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Search"
       }
      }
     }
    }
   }
  },
  "/search/suggest": {
   "get": {
    "tags": [
     "Search"
    ],
    "summary": "Suggest completions",
    "description": "Returns up to ten tag and title completions for a prefix.",
    "operationId": "get_search_suggest",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Search"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/me": {
   "get": {
    "tags": [
     "Current user"
    ],
    "summary": "Get the current user",
    "description": "Returns the user the access token belongs to.",
    "operationId": "get_me",
    "security": [
     {
      "bearerAuth": [
       "profile"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Currentuser"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Current user"
    ],
    "summary": "Update the current user",
    "description": "Updates profile fields.",
    "operationId": "patch_me",
    "security": [
     {
      "bearerAuth": [
       "profile"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Currentuser"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Currentuser"
       }
      }
     }
    }
   }
  },
  "/me/sessions": {
   "get": {
    "tags": [
     "Current user"
    ],
    "summary": "List sessions",
    "description": "Active sign-ins with device and last activity.",
    "operationId": "get_me_sessions",
    "security": [
     {
      "bearerAuth": [
       "profile"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Currentuser"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/me/sessions/{id}": {
   "delete": {
    "tags": [
     "Current user"
    ],
    "summary": "Revoke a session",
    "description": "Signs the session out immediately.",
    "operationId": "delete_me_sessions_id",
    "security": [
     {
      "bearerAuth": [
       "profile"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Currentuser"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/workspaces": {
   "get": {
    "tags": [
     "Workspaces"
    ],
    "summary": "List workspaces",
    "description": "Returns a paginated list of workspaces.",
    "operationId": "get_workspaces",
    "security": [
     {
      "bearerAuth": [
       "workspaces:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Workspace"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Workspaces"
    ],
    "summary": "Create a workspace",
    "description": "Creates a workspace.",
    "operationId": "post_workspaces",
    "security": [
     {
      "bearerAuth": [
       "workspaces:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Workspace"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Workspace"
       }
      }
     }
    }
   }
  },
  "/workspaces/{id}": {
   "get": {
    "tags": [
     "Workspaces"
    ],
    "summary": "Retrieve a workspace",
    "description": "Retrieves a workspace by its identifier.",
    "operationId": "get_workspaces_id",
    "security": [
     {
      "bearerAuth": [
       "workspaces:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Workspace"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Workspaces"
    ],
    "summary": "Update a workspace",
    "description": "Updates fields of a workspace. Only supplied fields change.",
    "operationId": "patch_workspaces_id",
    "security": [
     {
      "bearerAuth": [
       "workspaces:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Workspace"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Workspace"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Workspaces"
    ],
    "summary": "Delete a workspace",
    "description": "Permanently deletes a workspace. This cannot be undone.",
    "operationId": "delete_workspaces_id",
    "security": [
     {
      "bearerAuth": [
       "workspaces:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Workspace"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/workspaces/{workspace_id}/members": {
   "get": {
    "tags": [
     "Members"
    ],
    "summary": "List members",
    "description": "Returns a paginated list of members.",
    "operationId": "get_workspaces_workspace_id_members",
    "security": [
     {
      "bearerAuth": [
       "members:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Member"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/workspaces/{workspace_id}/members/{id}": {
   "get": {
    "tags": [
     "Members"
    ],
    "summary": "Retrieve a member",
    "description": "Retrieves a member by its identifier.",
    "operationId": "get_workspaces_workspace_id_members_id",
    "security": [
     {
      "bearerAuth": [
       "members:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Member"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Members"
    ],
    "summary": "Update a member",
    "description": "Updates fields of a member. Only supplied fields change.",
    "operationId": "patch_workspaces_workspace_id_members_id",
    "security": [
     {
      "bearerAuth": [
       "members:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Member"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Member"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Members"
    ],
    "summary": "Delete a member",
    "description": "Permanently deletes a member. This cannot be undone.",
    "operationId": "delete_workspaces_workspace_id_members_id",
    "security": [
     {
      "bearerAuth": [
       "members:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Member"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/workspaces/{workspace_id}/invitations": {
   "get": {
    "tags": [
     "Invitations"
    ],
    "summary": "List invitations",
    "description": "Returns a paginated list of invitations.",
    "operationId": "get_workspaces_workspace_id_invitations",
    "security": [
     {
      "bearerAuth": [
       "members:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Invitation"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Invitations"
    ],
    "summary": "Create an invitation",
    "description": "Creates an invitation.",
    "operationId": "post_workspaces_workspace_id_invitations",
    "security": [
     {
      "bearerAuth": [
       "members:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Invitation"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Invitation"
       }
      }
     }
    }
   }
  },
  "/workspaces/{workspace_id}/invitations/{id}": {
   "get": {
    "tags": [
     "Invitations"
    ],
    "summary": "Retrieve an invitation",
    "description": "Retrieves an invitation by its identifier.",
    "operationId": "get_workspaces_workspace_id_invitations_id",
    "security": [
     {
      "bearerAuth": [
       "members:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Invitation"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "delete": {
    "tags": [
     "Invitations"
    ],
    "summary": "Delete an invitation",
    "description": "Permanently deletes an invitation. This cannot be undone.",
    "operationId": "delete_workspaces_workspace_id_invitations_id",
    "security": [
     {
      "bearerAuth": [
       "members:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Invitation"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/workspaces/{workspace_id}/invitations/{id}/resend": {
   "post": {
    "tags": [
     "Invitations"
    ],
    "summary": "Resend an invitation",
    "description": "Sends the email again and extends the expiry.",
    "operationId": "post_workspaces_workspace_id_invitations_id_resend",
    "security": [
     {
      "bearerAuth": [
       "members:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Invitation"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "workspace_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Invitation"
       }
      }
     }
    }
   }
  },
  "/api-keys": {
   "get": {
    "tags": [
     "API keys"
    ],
    "summary": "List api keys",
    "description": "Returns a paginated list of api keys.",
    "operationId": "get_api_keys",
    "security": [
     {
      "bearerAuth": [
       "keys:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/APIkey"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "API keys"
    ],
    "summary": "Create a API key",
    "description": "Creates a API key.",
    "operationId": "post_api_keys",
    "security": [
     {
      "bearerAuth": [
       "keys:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/APIkey"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/APIkey"
       }
      }
     }
    }
   }
  },
  "/api-keys/{id}": {
   "get": {
    "tags": [
     "API keys"
    ],
    "summary": "Retrieve a API key",
    "description": "Retrieves a API key by its identifier.",
    "operationId": "get_api_keys_id",
    "security": [
     {
      "bearerAuth": [
       "keys:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/APIkey"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "delete": {
    "tags": [
     "API keys"
    ],
    "summary": "Delete a API key",
    "description": "Permanently deletes a API key. This cannot be undone.",
    "operationId": "delete_api_keys_id",
    "security": [
     {
      "bearerAuth": [
       "keys:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/APIkey"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/api-keys/{id}/rotate": {
   "post": {
    "tags": [
     "API keys"
    ],
    "summary": "Rotate an API key",
    "description": "Issues a new secret; the old one stays valid for 24 hours.",
    "operationId": "post_api_keys_id_rotate",
    "security": [
     {
      "bearerAuth": [
       "keys:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/APIkey"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/APIkey"
       }
      }
     }
    }
   }
  },
  "/webhooks": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "List webhooks",
    "description": "Returns a paginated list of webhooks.",
    "operationId": "get_webhooks",
    "security": [
     {
      "bearerAuth": [
       "webhooks:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Create a webhook",
    "description": "Creates a webhook.",
    "operationId": "post_webhooks",
    "security": [
     {
      "bearerAuth": [
       "webhooks:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Webhook"
       }
      }
     }
    }
   }
  },
  "/webhooks/{id}": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Retrieve a webhook",
    "description": "Retrieves a webhook by its identifier.",
    "operationId": "get_webhooks_id",
    "security": [
     {
      "bearerAuth": [
       "webhooks:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Update a webhook",
    "description": "Updates fields of a webhook. Only supplied fields change.",
    "operationId": "patch_webhooks_id",
    "security": [
     {
      "bearerAuth": [
       "webhooks:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Webhook"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Delete a webhook",
    "description": "Permanently deletes a webhook. This cannot be undone.",
    "operationId": "delete_webhooks_id",
    "security": [
     {
      "bearerAuth": [
       "webhooks:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/webhooks/{id}/test": {
   "post": {
    "tags": [
     "Webhooks"
    ],
    "summary": "Send a test event",
    "description": "Delivers a sample `ping` event to the endpoint.",
    "operationId": "post_webhooks_id_test",
    "security": [
     {
      "bearerAuth": [
       "webhooks:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Webhook"
       }
      }
     }
    }
   }
  },
  "/webhooks/{id}/deliveries": {
   "get": {
    "tags": [
     "Webhooks"
    ],
    "summary": "List deliveries",
    "description": "Recent delivery attempts with status codes and latency.",
    "operationId": "get_webhooks_id_deliveries",
    "security": [
     {
      "bearerAuth": [
       "webhooks:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Webhook"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/events": {
   "get": {
    "tags": [
     "Events"
    ],
    "summary": "List events",
    "description": "Returns a paginated list of events.",
    "operationId": "get_events",
    "security": [
     {
      "bearerAuth": [
       "events:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Event"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/events/{id}": {
   "get": {
    "tags": [
     "Events"
    ],
    "summary": "Retrieve an event",
    "description": "Retrieves an event by its identifier.",
    "operationId": "get_events_id",
    "security": [
     {
      "bearerAuth": [
       "events:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Event"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/exports": {
   "get": {
    "tags": [
     "Exports"
    ],
    "summary": "List exports",
    "description": "Returns a paginated list of exports.",
    "operationId": "get_exports",
    "security": [
     {
      "bearerAuth": [
       "export:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Export"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Exports"
    ],
    "summary": "Create an export",
    "description": "Creates an export.",
    "operationId": "post_exports",
    "security": [
     {
      "bearerAuth": [
       "export:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Export"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Export"
       }
      }
     }
    }
   }
  },
  "/exports/{id}": {
   "get": {
    "tags": [
     "Exports"
    ],
    "summary": "Retrieve an export",
    "description": "Retrieves an export by its identifier.",
    "operationId": "get_exports_id",
    "security": [
     {
      "bearerAuth": [
       "export:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Export"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/imports": {
   "get": {
    "tags": [
     "Imports"
    ],
    "summary": "List imports",
    "description": "Returns a paginated list of imports.",
    "operationId": "get_imports",
    "security": [
     {
      "bearerAuth": [
       "import:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Import"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Imports"
    ],
    "summary": "Create an import",
    "description": "Creates an import.",
    "operationId": "post_imports",
    "security": [
     {
      "bearerAuth": [
       "import:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Import"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Import"
       }
      }
     }
    }
   }
  },
  "/imports/{id}": {
   "get": {
    "tags": [
     "Imports"
    ],
    "summary": "Retrieve an import",
    "description": "Retrieves an import by its identifier.",
    "operationId": "get_imports_id",
    "security": [
     {
      "bearerAuth": [
       "import:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Import"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/audit-log": {
   "get": {
    "tags": [
     "Audit log"
    ],
    "summary": "List audit log",
    "description": "Returns a paginated list of audit log.",
    "operationId": "get_audit_log",
    "security": [
     {
      "bearerAuth": [
       "audit:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Auditlog"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/audit-log/{id}": {
   "get": {
    "tags": [
     "Audit log"
    ],
    "summary": "Retrieve an audit entry",
    "description": "Retrieves an audit entry by its identifier.",
    "operationId": "get_audit_log_id",
    "security": [
     {
      "bearerAuth": [
       "audit:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Auditlog"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/usage": {
   "get": {
    "tags": [
     "Usage"
    ],
    "summary": "Get usage",
    "description": "Returns counters and limits for the workspace.",
    "operationId": "get_usage",
    "security": [
     {
      "bearerAuth": [
       "usage:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Usage"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/templates": {
   "get": {
    "tags": [
     "Templates"
    ],
    "summary": "List templates",
    "description": "Returns a paginated list of templates.",
    "operationId": "get_templates",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Template"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Templates"
    ],
    "summary": "Create a template",
    "description": "Creates a template.",
    "operationId": "post_templates",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Template"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Template"
       }
      }
     }
    }
   }
  },
  "/templates/{id}": {
   "get": {
    "tags": [
     "Templates"
    ],
    "summary": "Retrieve a template",
    "description": "Retrieves a template by its identifier.",
    "operationId": "get_templates_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Template"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Templates"
    ],
    "summary": "Update a template",
    "description": "Updates fields of a template. Only supplied fields change.",
    "operationId": "patch_templates_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Template"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Template"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Templates"
    ],
    "summary": "Delete a template",
    "description": "Permanently deletes a template. This cannot be undone.",
    "operationId": "delete_templates_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Template"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/templates/{id}/apply": {
   "post": {
    "tags": [
     "Templates"
    ],
    "summary": "Create a note from a template",
    "description": "Renders the template and creates a note.",
    "operationId": "post_templates_id_apply",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Template"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Template"
       }
      }
     }
    }
   }
  },
  "/shares": {
   "get": {
    "tags": [
     "Shares"
    ],
    "summary": "List shares",
    "description": "Returns a paginated list of shares.",
    "operationId": "get_shares",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Share"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Shares"
    ],
    "summary": "Create a share",
    "description": "Creates a share.",
    "operationId": "post_shares",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Share"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Share"
       }
      }
     }
    }
   }
  },
  "/shares/{id}": {
   "get": {
    "tags": [
     "Shares"
    ],
    "summary": "Retrieve a share",
    "description": "Retrieves a share by its identifier.",
    "operationId": "get_shares_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Share"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Shares"
    ],
    "summary": "Update a share",
    "description": "Updates fields of a share. Only supplied fields change.",
    "operationId": "patch_shares_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Share"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Share"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Shares"
    ],
    "summary": "Delete a share",
    "description": "Permanently deletes a share. This cannot be undone.",
    "operationId": "delete_shares_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Share"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/notes/{note_id}/comments": {
   "get": {
    "tags": [
     "Comments"
    ],
    "summary": "List comments",
    "description": "Returns a paginated list of comments.",
    "operationId": "get_notes_note_id_comments",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Comment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "note_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Comments"
    ],
    "summary": "Create a comment",
    "description": "Creates a comment.",
    "operationId": "post_notes_note_id_comments",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Comment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "note_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Comment"
       }
      }
     }
    }
   }
  },
  "/notes/{note_id}/comments/{id}": {
   "get": {
    "tags": [
     "Comments"
    ],
    "summary": "Retrieve a comment",
    "description": "Retrieves a comment by its identifier.",
    "operationId": "get_notes_note_id_comments_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Comment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "note_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Comments"
    ],
    "summary": "Update a comment",
    "description": "Updates fields of a comment. Only supplied fields change.",
    "operationId": "patch_notes_note_id_comments_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Comment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "note_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Comment"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Comments"
    ],
    "summary": "Delete a comment",
    "description": "Permanently deletes a comment. This cannot be undone.",
    "operationId": "delete_notes_note_id_comments_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Comment"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "note_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  },
  "/reminders": {
   "get": {
    "tags": [
     "Reminders"
    ],
    "summary": "List reminders",
    "description": "Returns a paginated list of reminders.",
    "operationId": "get_reminders",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reminder"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 100,
       "default": 25
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "post": {
    "tags": [
     "Reminders"
    ],
    "summary": "Create a reminder",
    "description": "Creates a reminder.",
    "operationId": "post_reminders",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reminder"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Reminder"
       }
      }
     }
    }
   }
  },
  "/reminders/{id}": {
   "get": {
    "tags": [
     "Reminders"
    ],
    "summary": "Retrieve a reminder",
    "description": "Retrieves a reminder by its identifier.",
    "operationId": "get_reminders_id",
    "security": [
     {
      "bearerAuth": [
       "notes:read"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reminder"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   },
   "patch": {
    "tags": [
     "Reminders"
    ],
    "summary": "Update a reminder",
    "description": "Updates fields of a reminder. Only supplied fields change.",
    "operationId": "patch_reminders_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reminder"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Reminder"
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Reminders"
    ],
    "summary": "Delete a reminder",
    "description": "Permanently deletes a reminder. This cannot be undone.",
    "operationId": "delete_reminders_id",
    "security": [
     {
      "bearerAuth": [
       "notes:write"
      ]
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Reminder"
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "429": {
      "$ref": "#/components/responses/RateLimited"
     }
    },
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ]
   }
  }
 },
 "components": {
  "securitySchemes": {
   "bearerAuth": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "Note": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with nt_.",
      "example": "nt_8f3k2Q9xLm"
     },
     "notebook_id": {
      "type": "string",
      "description": "Notebook that contains the note.",
      "example": "nb_2Lq9TgWz4A"
     },
     "title": {
      "type": "string",
      "description": "Plain-text title, up to 200 characters.",
      "example": "Weekly planning"
     },
     "body": {
      "type": "string",
      "description": "Markdown content, up to 1 MB.",
      "example": "## Goals\n- Ship the sync beta"
     },
     "tags": {
      "type": "array",
      "description": "Tag names attached to the note.",
      "items": {
       "type": "string"
      },
      "example": [
       "planning",
       "weekly"
      ]
     },
     "pinned": {
      "type": "boolean",
      "description": "Pinned notes appear first in listings.",
      "example": false
     },
     "archived": {
      "type": "boolean",
      "description": "Archived notes are hidden from default listings.",
      "example": false
     },
     "version": {
      "type": "integer",
      "description": "Current version number; increments on every change.",
      "example": 14
     },
     "word_count": {
      "type": "integer",
      "description": "Words in body, computed by the server.",
      "example": 212
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     },
     "updated_at": {
      "type": "string",
      "description": "Last modification time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-10-02T17:40:55Z"
     }
    },
    "required": [
     "notebook_id",
     "title"
    ]
   },
   "Notebook": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with nb_.",
      "example": "nb_8f3k2Q9xLm"
     },
     "name": {
      "type": "string",
      "description": "Display name, up to 100 characters.",
      "example": "Projects"
     },
     "color": {
      "type": "string",
      "description": "Accent colour as a hex value.",
      "example": "#5b5bf0"
     },
     "icon": {
      "type": "string",
      "description": "Icon name from the built-in set.",
      "example": "folder"
     },
     "parent_id": {
      "type": "string",
      "description": "Parent notebook, or null for a top-level notebook.",
      "nullable": true,
      "example": null
     },
     "note_count": {
      "type": "integer",
      "description": "Number of notes directly inside.",
      "example": 38
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     },
     "updated_at": {
      "type": "string",
      "description": "Last modification time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-10-02T17:40:55Z"
     }
    },
    "required": [
     "name"
    ]
   },
   "Tag": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with tg_.",
      "example": "tg_8f3k2Q9xLm"
     },
     "name": {
      "type": "string",
      "description": "Tag name, up to 50 characters, no spaces.",
      "example": "planning"
     },
     "color": {
      "type": "string",
      "description": "Accent colour as a hex value.",
      "example": "#f59e0b"
     },
     "note_count": {
      "type": "integer",
      "description": "Notes carrying the tag.",
      "example": 12
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "name"
    ]
   },
   "Attachment": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with at_.",
      "example": "at_8f3k2Q9xLm"
     },
     "note_id": {
      "type": "string",
      "description": "Note the file belongs to.",
      "example": "nt_8f3k2Q9xLm"
     },
     "filename": {
      "type": "string",
      "description": "Original file name.",
      "example": "diagram.png"
     },
     "content_type": {
      "type": "string",
      "description": "MIME type.",
      "example": "image/png"
     },
     "size": {
      "type": "integer",
      "description": "Size in bytes.",
      "example": 184320
     },
     "sha256": {
      "type": "string",
      "description": "Hex SHA-256 of the content.",
      "example": "9b74c9897bac770ffc029102a200c5de"
     },
     "url": {
      "type": "string",
      "description": "Signed download URL, valid for 15 minutes.",
      "example": "https://files.axnode.net/d/at_7Hq2/diagram.png?sig=…"
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "note_id",
     "filename"
    ]
   },
   "Sync": {
    "type": "object",
    "properties": {
     "cursor": {
      "type": "string",
      "description": "Opaque position in the change stream.",
      "example": "c_0000019c8e12"
     },
     "changes": {
      "type": "array",
      "description": "Changed records since the cursor.",
      "items": {
       "type": "object"
      },
      "example": []
     },
     "has_more": {
      "type": "boolean",
      "description": "Whether another page of changes exists.",
      "example": false
     },
     "conflicts": {
      "type": "array",
      "description": "Pushed records rejected because of a newer server revision.",
      "items": {
       "type": "object"
      },
      "example": []
     }
    },
    "required": []
   },
   "Search": {
    "type": "object",
    "properties": {
     "query": {
      "type": "string",
      "description": "Search text.",
      "example": "sync beta"
     },
     "hits": {
      "type": "array",
      "description": "Matching notes with snippets.",
      "items": {
       "type": "object"
      },
      "example": []
     },
     "total": {
      "type": "integer",
      "description": "Total matches.",
      "example": 7
     },
     "took_ms": {
      "type": "integer",
      "description": "Server processing time.",
      "example": 11
     }
    },
    "required": []
   },
   "Currentuser": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with us_.",
      "example": "us_8f3k2Q9xLm"
     },
     "email": {
      "type": "string",
      "description": "Primary email address.",
      "example": "alex@example.com"
     },
     "name": {
      "type": "string",
      "description": "Display name.",
      "example": "Alex Morgan"
     },
     "locale": {
      "type": "string",
      "description": "BCP 47 language tag.",
      "example": "en-US"
     },
     "timezone": {
      "type": "string",
      "description": "IANA time zone.",
      "example": "Europe/Berlin"
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": []
   },
   "Workspace": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with ws_.",
      "example": "ws_8f3k2Q9xLm"
     },
     "name": {
      "type": "string",
      "description": "Display name.",
      "example": "Morgan Studio"
     },
     "slug": {
      "type": "string",
      "description": "URL-safe identifier, unique.",
      "example": "morgan-studio"
     },
     "plan": {
      "type": "string",
      "description": "free, plus or team.",
      "example": "plus"
     },
     "seats": {
      "type": "integer",
      "description": "Paid seats.",
      "example": 5
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "name"
    ]
   },
   "Member": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with mb_.",
      "example": "mb_8f3k2Q9xLm"
     },
     "user_id": {
      "type": "string",
      "description": "The user.",
      "example": "us_5Kd9PaT3"
     },
     "role": {
      "type": "string",
      "description": "owner, admin, editor or viewer.",
      "example": "editor"
     },
     "email": {
      "type": "string",
      "description": "Member email.",
      "example": "sam@example.com"
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "role"
    ]
   },
   "Invitation": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with iv_.",
      "example": "iv_8f3k2Q9xLm"
     },
     "email": {
      "type": "string",
      "description": "Invitee email.",
      "example": "sam@example.com"
     },
     "role": {
      "type": "string",
      "description": "Role granted on accept.",
      "example": "editor"
     },
     "expires_at": {
      "type": "string",
      "description": "Expiry time.",
      "format": "date-time",
      "example": "2026-10-22T10:00:00Z"
     },
     "status": {
      "type": "string",
      "description": "pending, accepted or expired.",
      "example": "pending"
     }
    },
    "required": [
     "email"
    ]
   },
   "APIkey": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with ak_.",
      "example": "ak_8f3k2Q9xLm"
     },
     "name": {
      "type": "string",
      "description": "Label for the key.",
      "example": "CI exporter"
     },
     "prefix": {
      "type": "string",
      "description": "First characters of the secret, for identification.",
      "example": "axs_live_7Hq2"
     },
     "scopes": {
      "type": "array",
      "description": "Granted scopes.",
      "items": {
       "type": "string"
      },
      "example": [
       "notes:read",
       "files:read"
      ]
     },
     "last_used_at": {
      "type": "string",
      "description": "Last successful request.",
      "format": "date-time",
      "nullable": true,
      "example": "2026-10-13T21:12:40Z"
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "name"
    ]
   },
   "Webhook": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with wh_.",
      "example": "wh_8f3k2Q9xLm"
     },
     "url": {
      "type": "string",
      "description": "HTTPS endpoint.",
      "example": "https://hooks.example.com/axsync"
     },
     "events": {
      "type": "array",
      "description": "Subscribed event types.",
      "items": {
       "type": "string"
      },
      "example": [
       "note.created",
       "note.updated"
      ]
     },
     "secret": {
      "type": "string",
      "description": "Signing secret (shown once).",
      "example": "whsec_9d2b…"
     },
     "active": {
      "type": "boolean",
      "description": "Whether deliveries are sent.",
      "example": true
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "url",
     "events"
    ]
   },
   "Event": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with ev_.",
      "example": "ev_8f3k2Q9xLm"
     },
     "type": {
      "type": "string",
      "description": "Event type such as note.updated.",
      "example": "note.updated"
     },
     "resource_id": {
      "type": "string",
      "description": "Affected object.",
      "example": "nt_8f3k2Q9xLm"
     },
     "actor_id": {
      "type": "string",
      "description": "User or key that caused it.",
      "nullable": true,
      "example": "us_5Kd9PaT3"
     },
     "occurred_at": {
      "type": "string",
      "description": "When it happened.",
      "format": "date-time",
      "example": "2026-10-14T09:12:01Z"
     }
    },
    "required": []
   },
   "Export": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with ex_.",
      "example": "ex_8f3k2Q9xLm"
     },
     "scope": {
      "type": "string",
      "description": "notebook or workspace.",
      "example": "workspace"
     },
     "format": {
      "type": "string",
      "description": "markdown or json.",
      "example": "markdown"
     },
     "status": {
      "type": "string",
      "description": "queued, running, ready or failed.",
      "example": "ready"
     },
     "download_url": {
      "type": "string",
      "description": "Signed URL once ready.",
      "nullable": true,
      "example": null
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "scope"
    ]
   },
   "Import": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with im_.",
      "example": "im_8f3k2Q9xLm"
     },
     "source": {
      "type": "string",
      "description": "markdown, enex or notion.",
      "example": "enex"
     },
     "status": {
      "type": "string",
      "description": "queued, running, done or failed.",
      "example": "running"
     },
     "imported": {
      "type": "integer",
      "description": "Notes created so far.",
      "example": 120
     },
     "errors": {
      "type": "array",
      "description": "Per-file problems.",
      "items": {
       "type": "object"
      },
      "example": []
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "source"
    ]
   },
   "Auditlog": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with al_.",
      "example": "al_8f3k2Q9xLm"
     },
     "action": {
      "type": "string",
      "description": "Action name, for example member.role_changed.",
      "example": "member.role_changed"
     },
     "actor_id": {
      "type": "string",
      "description": "Who did it.",
      "example": "us_5Kd9PaT3"
     },
     "ip": {
      "type": "string",
      "description": "Source IP address.",
      "example": "203.0.113.24"
     },
     "occurred_at": {
      "type": "string",
      "description": "Time of the action.",
      "format": "date-time",
      "example": "2026-10-12T15:02:44Z"
     }
    },
    "required": []
   },
   "Usage": {
    "type": "object",
    "properties": {
     "period_start": {
      "type": "string",
      "description": "Start of the billing period.",
      "format": "date-time",
      "example": "2026-10-01T00:00:00Z"
     },
     "notes": {
      "type": "integer",
      "description": "Notes stored.",
      "example": 1842
     },
     "storage_bytes": {
      "type": "integer",
      "description": "Bytes used by attachments.",
      "example": 482344960
     },
     "api_requests": {
      "type": "integer",
      "description": "Requests made this period.",
      "example": 93211
     }
    },
    "required": []
   },
   "Template": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with tp_.",
      "example": "tp_8f3k2Q9xLm"
     },
     "name": {
      "type": "string",
      "description": "Template name.",
      "example": "Meeting notes"
     },
     "body": {
      "type": "string",
      "description": "Markdown with variables.",
      "example": "# {{title}}\n_{{date}}_"
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     },
     "updated_at": {
      "type": "string",
      "description": "Last modification time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-10-02T17:40:55Z"
     }
    },
    "required": [
     "name"
    ]
   },
   "Share": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with sh_.",
      "example": "sh_8f3k2Q9xLm"
     },
     "note_id": {
      "type": "string",
      "description": "Shared note.",
      "example": "nt_8f3k2Q9xLm"
     },
     "url": {
      "type": "string",
      "description": "Public link.",
      "example": "https://share.axnode.net/s/8f3k2Q9x"
     },
     "password_protected": {
      "type": "boolean",
      "description": "Whether a password is required.",
      "example": false
     },
     "expires_at": {
      "type": "string",
      "description": "Optional expiry.",
      "format": "date-time",
      "nullable": true,
      "example": null
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "note_id"
    ]
   },
   "Comment": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with cm_.",
      "example": "cm_8f3k2Q9xLm"
     },
     "author_id": {
      "type": "string",
      "description": "Comment author.",
      "example": "us_5Kd9PaT3"
     },
     "body": {
      "type": "string",
      "description": "Markdown, up to 5000 characters.",
      "example": "Looks good, merging."
     },
     "resolved": {
      "type": "boolean",
      "description": "Thread resolved flag.",
      "example": false
     },
     "created_at": {
      "type": "string",
      "description": "Creation time, RFC 3339 in UTC.",
      "format": "date-time",
      "example": "2026-09-14T08:21:07Z"
     }
    },
    "required": [
     "body"
    ]
   },
   "Reminder": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique identifier, prefixed with rm_.",
      "example": "rm_8f3k2Q9xLm"
     },
     "note_id": {
      "type": "string",
      "description": "Related note.",
      "example": "nt_8f3k2Q9xLm"
     },
     "remind_at": {
      "type": "string",
      "description": "When to fire.",
      "format": "date-time",
      "example": "2026-10-20T08:00:00Z"
     },
     "channel": {
      "type": "string",
      "description": "push, email or webhook.",
      "example": "push"
     },
     "done": {
      "type": "boolean",
      "description": "Whether it already fired.",
      "example": false
     }
    },
    "required": [
     "note_id",
     "remind_at"
    ]
   }
  },
  "responses": {
   "Unauthorized": {
    "description": "Missing or invalid token"
   },
   "RateLimited": {
    "description": "Too many requests"
   }
  }
 }
}