{
  "openapi": "3.1.0",
  "info": {
    "title": "Culacc API",
    "version": "1.4.0",
    "summary": "Store, send, share, publish and edit files from your app, on EU storage.",
    "description": "Upload files up to 5 TB, share files and folders by link or email (recipients need no account), delete them when done or let shares delete them when they end, publish images and video with resizing, and add an Edit button for photos, videos, documents, spreadsheets, slides, PDFs, CAD and audio. Guides: https://culacc.com/developers. npm package: @culacc/sdk. Everything in one file for AI assistants: https://culacc.com/llms-full.txt",
    "contact": {
      "name": "Culacc",
      "email": "andrej@culacc.com",
      "url": "https://culacc.com/developers"
    },
    "termsOfService": "https://culacc.com/terms"
  },
  "externalDocs": {
    "description": "Guides and reference",
    "url": "https://culacc.com/developers"
  },
  "servers": [
    {
      "url": "https://culacc.com/api/v1"
    }
  ],
  "security": [
    {
      "bearerKey": []
    },
    {
      "apiKeyHeader": []
    }
  ],
  "tags": [
    {
      "name": "Files",
      "description": "List, folders, delete"
    },
    {
      "name": "Uploads",
      "description": "Straight to storage, any size"
    },
    {
      "name": "Shares",
      "description": "Send files and folders by link or email"
    },
    {
      "name": "Publishing",
      "description": "Public addresses and image resizing"
    },
    {
      "name": "Edit with Culacc",
      "description": "An Edit button for your site"
    },
    {
      "name": "Webhooks",
      "description": "Signed calls to your server when something happens"
    },
    {
      "name": "Account",
      "description": "Storage and traffic"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "summary": "Who the key belongs to, with storage and traffic",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "getMe"
      }
    },
    "/usage": {
      "get": {
        "summary": "This month's traffic and what it costs",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "getUsage"
      }
    },
    "/files": {
      "get": {
        "summary": "List, browse or search files",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Browse a folder, e.g. /Photos"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Search names"
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "image, svg, video, audio, pdf; comma separated"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "files": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/File"
                      }
                    },
                    "folders": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "nextOffset": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "listFiles"
      }
    },
    "/files/{id}": {
      "get": {
        "summary": "One file, with its public link and HTML",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "file": {
                      "$ref": "#/components/schemas/File"
                    },
                    "link": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/MediaLink"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "html": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "getFile"
      },
      "delete": {
        "summary": "Delete a file or folder",
        "description": "To the trash by default (restorable in Culacc, still counts toward storage). permanent=true deletes every version for good and frees the space at once; it also works on items already in the trash.\n\nNeeds a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Files"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          },
          {
            "name": "permanent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Delete for good"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "$ref": "#/components/schemas/DeleteResult"
                    },
                    "bytesFreed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "deleteFile"
      }
    },
    "/files/delete": {
      "post": {
        "summary": "Delete several files and folders, by id or path",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ItemRef"
                    },
                    "description": "Up to 500"
                  },
                  "permanent": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DeleteResult"
                      }
                    },
                    "bytesFreed": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "deleteFiles"
      }
    },
    "/folders": {
      "post": {
        "summary": "Make a folder (and any above it that are missing)",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Files"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "path": {
                    "type": "string",
                    "description": "Like /Clients/Acme"
                  }
                },
                "required": [
                  "path"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Already there",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "$ref": "#/components/schemas/Item"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Made",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "folder": {
                      "$ref": "#/components/schemas/Item"
                    },
                    "created": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          }
        },
        "operationId": "createFolder"
      }
    },
    "/files/{id}/publish": {
      "post": {
        "summary": "Publish a file to a public address",
        "description": "Needs a key with `links:write`.",
        "x-permission": "links:write",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "allowedHosts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "alt": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "$ref": "#/components/schemas/MediaLink"
                    },
                    "html": {
                      "type": "string",
                      "description": "Responsive HTML: <picture> with srcset, or <video>"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "publishFile"
      },
      "patch": {
        "summary": "Switch a link off or on, or change its allowed sites",
        "description": "Needs a key with `links:write`.",
        "x-permission": "links:write",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "off"
                    ]
                  },
                  "allowedHosts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "alt": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "$ref": "#/components/schemas/MediaLink"
                    },
                    "html": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "updateLink"
      },
      "delete": {
        "summary": "Remove a public link for good",
        "description": "Needs a key with `links:write`.",
        "x-permission": "links:write",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "unpublishFile"
      }
    },
    "/links": {
      "get": {
        "summary": "Everything published",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Publishing"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "links": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MediaLink"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "nextOffset": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "listLinks"
      }
    },
    "/uploads": {
      "post": {
        "summary": "Start an upload: an address to PUT to, or a plan in parts for big files",
        "description": "Up to 500 MB: one PUT to uploadUrl. Above that (or with multipart: true over 5 MB): PUT each partSize slice to its own address, then call done. Files up to 5 TB.\n\nNeeds a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Uploads"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "size": {
                    "type": "integer",
                    "description": "Bytes"
                  },
                  "mime": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string",
                    "description": "The folder; missing folders are made"
                  },
                  "onConflict": {
                    "type": "string",
                    "enum": [
                      "rename",
                      "replace",
                      "version",
                      "fail"
                    ],
                    "default": "rename"
                  },
                  "multipart": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "size"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartedUpload"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "501": {
            "$ref": "#/components/responses/E501"
          }
        },
        "operationId": "startUpload"
      }
    },
    "/uploads/{uploadId}": {
      "get": {
        "summary": "Where an upload stands; the parts that arrived, to resume",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uploadId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "completing",
                        "done",
                        "failed",
                        "aborted",
                        "expired"
                      ]
                    },
                    "path": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "file": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/UploadedFile"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "multipart": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "partSize": {
                              "type": "integer"
                            },
                            "parts": {
                              "type": "integer"
                            },
                            "uploaded": {
                              "oneOf": [
                                {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "partNumber": {
                                        "type": "integer"
                                      },
                                      "size": {
                                        "type": "integer"
                                      }
                                    }
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "getUpload"
      },
      "delete": {
        "summary": "Cancel an upload; its bytes or parts are removed",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "already": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          }
        },
        "operationId": "abortUpload"
      }
    },
    "/uploads/{uploadId}/parts": {
      "post": {
        "summary": "More signed part addresses for a big upload",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "integer"
                    }
                  },
                  "from": {
                    "type": "integer"
                  },
                  "count": {
                    "type": "integer",
                    "maximum": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uploadId": {
                      "type": "string"
                    },
                    "partSize": {
                      "type": "integer"
                    },
                    "parts": {
                      "type": "integer"
                    },
                    "urls": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PartUrl"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "410": {
            "$ref": "#/components/responses/E410"
          }
        },
        "operationId": "uploadPartUrls"
      }
    },
    "/uploads/{uploadId}/done": {
      "post": {
        "summary": "Finish an upload: the file is yours",
        "description": "Storage is asked what arrived; more than announced is refused. Calling it twice returns the same file. Missing parts are named in missingParts.\n\nNeeds a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Uploads"
        ],
        "parameters": [
          {
            "name": "uploadId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "parts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "partNumber": {
                          "type": "integer"
                        },
                        "etag": {
                          "type": "string"
                        }
                      }
                    },
                    "description": "Optional: the server asks storage when left out"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "file": {
                      "$ref": "#/components/schemas/UploadedFile"
                    },
                    "already": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "410": {
            "$ref": "#/components/responses/E410"
          },
          "413": {
            "$ref": "#/components/responses/E413"
          }
        },
        "operationId": "finishUpload"
      }
    },
    "/shares": {
      "get": {
        "summary": "List shares, newest first",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "expired",
                "revoked",
                "all"
              ]
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "api",
                "dashboard",
                "all"
              ]
            }
          },
          {
            "name": "externalRef",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fileId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "shares": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Share"
                      }
                    },
                    "nextOffset": {
                      "oneOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "listShares"
      },
      "post": {
        "summary": "Share files and folders as a link, optionally emailed",
        "description": "The recipient needs no account. Emails are one per address, from \"<senderName> via Culacc\"; 200 a day per account with a paid plan, 20 on the free plan, 3 a day to the same address (LIMIT_REACHED before anything is made); no links in free-plan messages. Downloads through the link are traffic on your meter.\n\nNeeds a key with `shares:write`.",
        "x-permission": "shares:write",
        "tags": [
          "Shares"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShare"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    },
                    "emails": {
                      "oneOf": [
                        {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/EmailResult"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "501": {
            "$ref": "#/components/responses/E501"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "createShare"
      }
    },
    "/shares/traffic": {
      "get": {
        "summary": "This month's downloads through your share links",
        "description": "billed: shares made through the API and files uploaded through it, on your traffic meter with published files. free: other shares, free up to 3x your storage plan a month (at least 50 GB).\n\nNeeds a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Shares"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "month": {
                      "type": "string",
                      "format": "date"
                    },
                    "billed": {
                      "type": "object",
                      "properties": {
                        "bytes": {
                          "type": "integer"
                        },
                        "meter": {
                          "type": "object",
                          "properties": {
                            "used": {
                              "type": "integer"
                            },
                            "free": {
                              "type": "integer"
                            },
                            "cost": {
                              "type": "object",
                              "properties": {
                                "amount": {
                                  "type": "number"
                                },
                                "currency": {
                                  "type": "string"
                                }
                              }
                            },
                            "stopped": {
                              "type": "boolean"
                            }
                          }
                        }
                      }
                    },
                    "free": {
                      "type": "object",
                      "properties": {
                        "bytes": {
                          "type": "integer"
                        },
                        "allowance": {
                          "type": "integer"
                        },
                        "stopped": {
                          "type": "boolean"
                        }
                      }
                    },
                    "resetsAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "getShareTraffic"
      }
    },
    "/shares/{id}": {
      "get": {
        "summary": "One share, with its items and recipients",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "getShare"
      },
      "patch": {
        "summary": "Change a share",
        "description": "Needs a key with `shares:write`.",
        "x-permission": "shares:write",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateShare"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          }
        },
        "operationId": "updateShare"
      },
      "delete": {
        "summary": "Stop a share; optionally delete its files for good",
        "description": "deleteFiles=true (needs files:write) deletes its files and folders for good; an autoDelete share does so unless keepFiles=true. Anything another active share holds or that is published is kept.\n\nNeeds a key with `shares:write`.",
        "x-permission": "shares:write",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          },
          {
            "name": "deleteFiles",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "keepFiles",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    },
                    "files": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "deleted": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/DeleteResult"
                              }
                            },
                            "kept": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/KeptItem"
                              }
                            },
                            "bytesFreed": {
                              "type": "integer"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "revokeShare"
      }
    },
    "/shares/{id}/send": {
      "post": {
        "summary": "Email a share to more people",
        "description": "Needs a key with `shares:write`.",
        "x-permission": "shares:write",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ShareEmail"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "emails": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/EmailResult"
                      }
                    },
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          },
          "501": {
            "$ref": "#/components/responses/E501"
          },
          "503": {
            "$ref": "#/components/responses/E503"
          }
        },
        "operationId": "sendShare"
      }
    },
    "/shares/{id}/items": {
      "post": {
        "summary": "Add files and folders to a share",
        "description": "Needs a key with `shares:write`.",
        "x-permission": "shares:write",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/ItemRef"
                    }
                  }
                },
                "required": [
                  "items"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "added": {
                      "type": "integer"
                    },
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          }
        },
        "operationId": "addShareItems"
      }
    },
    "/shares/{id}/items/{fileId}": {
      "delete": {
        "summary": "Take one of a share's items out",
        "description": "Needs a key with `shares:write`.",
        "x-permission": "shares:write",
        "tags": [
          "Shares"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          },
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The file or folder id"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "removed": {
                      "type": "integer"
                    },
                    "share": {
                      "$ref": "#/components/schemas/Share"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "removeShareItem"
      }
    },
    "/webhooks": {
      "get": {
        "summary": "Your webhooks, and the events there are",
        "description": "Needs a key with `webhooks:write`.",
        "x-permission": "webhooks:write",
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "listWebhooks"
      },
      "post": {
        "summary": "Add a webhook (its secret is in this answer only)",
        "description": "Needs a key with `webhooks:write`.",
        "x-permission": "webhooks:write",
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "createWebhook"
      }
    },
    "/webhooks/{id}": {
      "patch": {
        "summary": "Change a webhook",
        "description": "Needs a key with `webhooks:write`.",
        "x-permission": "webhooks:write",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "description": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "webhook": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "updateWebhook"
      },
      "delete": {
        "summary": "Remove a webhook",
        "description": "Needs a key with `webhooks:write`.",
        "x-permission": "webhooks:write",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "deleteWebhook"
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "summary": "Send a test delivery",
        "description": "Needs a key with `webhooks:write`.",
        "x-permission": "webhooks:write",
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "integer"
                    },
                    "attempts": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "testWebhook"
      }
    },
    "/edit/sessions": {
      "post": {
        "summary": "Start an editor session for your site",
        "description": "Hand only editorUrl to the browser; open it with https://culacc.com/api/edit/sdk.js.\n\nNeeds a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Edit with Culacc"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EditSessionOptions"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "$ref": "#/components/schemas/EditSession"
                    },
                    "token": {
                      "type": "string"
                    },
                    "editorUrl": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "415": {
            "$ref": "#/components/responses/E415"
          },
          "429": {
            "$ref": "#/components/responses/E429"
          }
        },
        "operationId": "createEditSession"
      }
    },
    "/edit/sessions/{id}": {
      "get": {
        "summary": "An editor session and its result",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Edit with Culacc"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "$ref": "#/components/schemas/EditSession"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "getEditSession"
      }
    },
    "/edit/sessions/{id}/cancel": {
      "post": {
        "summary": "Cancel an editor session",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Edit with Culacc"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "session": {
                      "$ref": "#/components/schemas/EditSession"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          },
          "409": {
            "$ref": "#/components/responses/E409"
          }
        },
        "operationId": "cancelEditSession"
      }
    },
    "/edit/files/{id}/versions": {
      "get": {
        "summary": "A file's versions",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Edit with Culacc"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "versions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FileVersion"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "listVersions"
      }
    },
    "/edit/files/{id}/revert": {
      "post": {
        "summary": "Make an earlier version current again",
        "description": "Needs a key with `files:write`.",
        "x-permission": "files:write",
        "tags": [
          "Edit with Culacc"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "description": "The id."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "version": {
                    "type": "integer"
                  }
                },
                "required": [
                  "version"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "fileId": {
                      "type": "integer"
                    },
                    "version": {
                      "type": "integer"
                    },
                    "size": {
                      "type": "integer"
                    },
                    "mime": {
                      "type": "string"
                    },
                    "url": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          },
          "404": {
            "$ref": "#/components/responses/E404"
          }
        },
        "operationId": "revertFile"
      }
    },
    "/edit/usage": {
      "get": {
        "summary": "This month's editing time, traffic and cost",
        "description": "Needs a key with `files:read`.",
        "x-permission": "files:read",
        "tags": [
          "Edit with Culacc"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/E400"
          },
          "401": {
            "$ref": "#/components/responses/E401"
          },
          "403": {
            "$ref": "#/components/responses/E403"
          }
        },
        "operationId": "getEditUsage"
      }
    }
  },
  "webhooks": {
    "file.uploaded": {
      "post": {
        "operationId": "file_uploaded",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "fileId": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string"
                      },
                      "size": {
                        "type": "integer"
                      },
                      "replaced": {
                        "type": "boolean"
                      },
                      "version": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "file.deleted": {
      "post": {
        "operationId": "file_deleted",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "fileId": {
                        "type": "integer"
                      },
                      "path": {
                        "type": "string"
                      },
                      "isFolder": {
                        "type": "boolean"
                      },
                      "permanent": {
                        "type": "boolean"
                      },
                      "bytesFreed": {
                        "type": "integer"
                      },
                      "shareId": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "file.published": {
      "post": {
        "operationId": "file_published",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "fileId": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "file.unpublished": {
      "post": {
        "operationId": "file_unpublished",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "fileId": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "file.edited": {
      "post": {
        "operationId": "file_edited",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "sessionId": {
                        "type": "string"
                      },
                      "externalRef": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "origin": {
                        "type": "string"
                      },
                      "fileId": {
                        "type": "integer"
                      },
                      "url": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "revision": {
                        "type": "string"
                      },
                      "reverted": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "share.created": {
      "post": {
        "operationId": "share_created",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "shareId": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      },
                      "title": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "externalRef": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fileCount": {
                        "type": "integer"
                      },
                      "folderCount": {
                        "type": "integer"
                      },
                      "totalSize": {
                        "type": "integer"
                      },
                      "filesDeleted": {
                        "type": "integer"
                      },
                      "bytesFreed": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "share.expired": {
      "post": {
        "operationId": "share_expired",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "shareId": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      },
                      "title": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "externalRef": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fileCount": {
                        "type": "integer"
                      },
                      "folderCount": {
                        "type": "integer"
                      },
                      "totalSize": {
                        "type": "integer"
                      },
                      "filesDeleted": {
                        "type": "integer"
                      },
                      "bytesFreed": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "share.revoked": {
      "post": {
        "operationId": "share_revoked",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "shareId": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      },
                      "title": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "externalRef": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "fileCount": {
                        "type": "integer"
                      },
                      "folderCount": {
                        "type": "integer"
                      },
                      "totalSize": {
                        "type": "integer"
                      },
                      "filesDeleted": {
                        "type": "integer"
                      },
                      "bytesFreed": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    },
    "traffic.limit_reached": {
      "post": {
        "operationId": "traffic_limit_reached",
        "summary": "Signed with Culacc-Signature: t=<timestamp>,v1=<HMAC-SHA256 of \"timestamp.body\">",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "event": {
                    "type": "string"
                  },
                  "created": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Answer 2xx quickly; a 4xx stops retries"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer clc_live_… (Settings → Developers → New key)"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "What went wrong, for people"
          },
          "code": {
            "type": "string",
            "description": "For code: BAD_INPUT, FORBIDDEN, NOT_FOUND, CONFLICT, GONE, TOO_LARGE, QUOTA, LIMIT_REACHED, NOT_AVAILABLE…"
          }
        },
        "required": [
          "error"
        ]
      },
      "ItemRef": {
        "oneOf": [
          {
            "type": "integer",
            "description": "A file or folder id"
          },
          {
            "type": "string",
            "description": "A path, like \"/Clients/Acme\" or \"/Reports/q3.pdf\""
          }
        ]
      },
      "File": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "svg",
              "video",
              "audio",
              "pdf",
              "document",
              "other"
            ]
          },
          "mime": {
            "type": "string"
          },
          "size": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "published": {
            "type": "boolean"
          },
          "url": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Item": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "isFolder": {
            "type": "boolean"
          },
          "mime": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "type": "integer",
            "description": "Bytes; for a folder, everything inside it"
          },
          "fileCount": {
            "type": "integer",
            "description": "Folders: files inside, at any depth"
          },
          "folderCount": {
            "type": "integer",
            "description": "Folders: folders inside"
          },
          "createdAt": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeleteResult": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Item"
          },
          {
            "type": "object",
            "properties": {
              "permanent": {
                "type": "boolean"
              },
              "bytesFreed": {
                "type": "integer"
              },
              "objectsDeleted": {
                "type": "integer"
              }
            }
          }
        ]
      },
      "MediaLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "off",
              "missing"
            ]
          },
          "width": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "allowedHosts": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Usage": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string"
          },
          "requests": {
            "type": "integer"
          },
          "bytes": {
            "type": "integer"
          },
          "free": {
            "type": "integer"
          },
          "billable": {
            "type": "integer"
          },
          "cost": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "limit": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "number"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "stopped": {
            "type": "boolean"
          },
          "estimated": {
            "type": "boolean"
          }
        }
      },
      "StartedUpload": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string"
          },
          "uploadUrl": {
            "oneOf": [
              {
                "type": "string",
                "description": "PUT the bytes here; null when the file goes in parts",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "expiresIn": {
            "type": "integer",
            "description": "Seconds"
          },
          "path": {
            "type": "string"
          },
          "onConflict": {
            "type": "string"
          },
          "multipart": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "partSize": {
                    "type": "integer"
                  },
                  "parts": {
                    "type": "integer"
                  },
                  "urls": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/PartUrl"
                    },
                    "description": "The first addresses (up to 100)"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PartUrl": {
        "type": "object",
        "properties": {
          "partNumber": {
            "type": "integer"
          },
          "size": {
            "type": "integer",
            "description": "The exact bytes this address takes (storage refuses another size)"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "UploadedFile": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "mime": {
            "type": "string"
          },
          "renamed": {
            "type": "boolean",
            "description": "The name was taken, so it got \" (1)\""
          },
          "replaced": {
            "type": "boolean",
            "description": "It became new contents of the file already there"
          },
          "version": {
            "type": "integer"
          },
          "previousVersion": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "Share": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "url": {
            "type": "string",
            "description": "The page to send people to",
            "format": "uri"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "title": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "canEdit": {
            "type": "boolean"
          },
          "hasPassword": {
            "type": "boolean"
          },
          "expiresAt": {
            "oneOf": [
              {
                "type": "string",
                "description": "null: never",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdVia": {
            "type": "string",
            "enum": [
              "api",
              "dashboard"
            ]
          },
          "externalRef": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "autoDelete": {
            "type": "boolean"
          },
          "filesDeleted": {
            "type": "boolean"
          },
          "fileCount": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "folderCount": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "totalSize": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "views": {
            "type": "integer"
          },
          "downloads": {
            "type": "integer"
          },
          "traffic": {
            "type": "object",
            "properties": {
              "bytesThisMonth": {
                "type": "integer",
                "description": "Bytes downloaded through the link this month"
              },
              "bytesTotal": {
                "type": "integer"
              }
            }
          },
          "billed": {
            "type": "boolean",
            "description": "Made through the API: its downloads are on your traffic meter (in a dashboard share, only files uploaded through the API are)"
          },
          "zipUrl": {
            "oneOf": [
              {
                "type": "string",
                "description": "Everything as one ZIP; null with a password or when not active",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "items": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/Item"
                },
                {
                  "type": "object",
                  "properties": {
                    "addedBy": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "downloadUrl": {
                      "oneOf": [
                        {
                          "type": "string",
                          "format": "uri"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              ]
            },
            "description": "Single shares and changes only"
          },
          "recipients": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "email": {
                  "type": "string",
                  "format": "email"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "sent",
                    "failed"
                  ]
                },
                "sentAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "error": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "EmailResult": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "failed"
            ]
          },
          "error": {
            "type": "string"
          }
        }
      },
      "ShareEmail": {
        "type": "object",
        "properties": {
          "to": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "An address, \"a@x.com, b@y.com\", or a list (up to 20)"
          },
          "message": {
            "type": "string"
          },
          "senderName": {
            "type": "string",
            "description": "Shown as \"<name> via Culacc\"; a name, not an address or link"
          },
          "replyTo": {
            "type": "string",
            "format": "email"
          }
        },
        "required": [
          "to"
        ]
      },
      "CreateShare": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ItemRef"
            },
            "description": "Files and folders, up to 200. A shared folder is live."
          },
          "to": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "Email it now (shortcut for email.to)"
          },
          "email": {
            "$ref": "#/components/schemas/ShareEmail"
          },
          "senderName": {
            "type": "string"
          },
          "replyTo": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "expiresInDays": {
            "type": "integer",
            "description": "30 by default; 0 for never",
            "minimum": 0,
            "maximum": 3650
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "never": {
            "type": "boolean"
          },
          "password": {
            "type": "string",
            "minLength": 4,
            "maxLength": 200
          },
          "canEdit": {
            "type": "boolean"
          },
          "externalRef": {
            "type": "string",
            "maxLength": 200
          },
          "autoDelete": {
            "type": "boolean",
            "description": "Delete its files and folders for good when it expires or is stopped (needs files:write too)"
          }
        },
        "required": [
          "items"
        ]
      },
      "UpdateShare": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "message": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "password": {
            "oneOf": [
              {
                "type": "string",
                "description": "null removes it"
              },
              {
                "type": "null"
              }
            ]
          },
          "canEdit": {
            "type": "boolean"
          },
          "expiresInDays": {
            "type": "integer"
          },
          "expiresAt": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "never": {
            "type": "boolean"
          },
          "externalRef": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "autoDelete": {
            "type": "boolean"
          }
        }
      },
      "KeptItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "enum": [
              "shared",
              "published"
            ]
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "failures": {
            "type": "integer"
          },
          "lastStatus": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastError": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastSentAt": {
            "oneOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": "string",
            "description": "Returned only when the webhook is made"
          }
        }
      },
      "EditSessionOptions": {
        "type": "object",
        "properties": {
          "origin": {
            "type": "string",
            "description": "The site that opens the editor; must be in your allowed sites"
          },
          "fileId": {
            "type": "integer"
          },
          "mode": {
            "type": "string",
            "enum": [
              "edit",
              "open"
            ]
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image-editor",
                "photocraft",
                "lightcraft",
                "vectorcraft",
                "pdfcraft",
                "wordcraft",
                "gridcraft",
                "deckcraft",
                "cadcraft",
                "designcraft",
                "soundcraft",
                "video-editor",
                "google",
                "viewer"
              ]
            }
          },
          "accept": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "image",
                "video",
                "document",
                "audio",
                "pdf"
              ]
            }
          },
          "versioning": {
            "type": "string",
            "enum": [
              "off",
              "keep-original",
              "keep-all"
            ]
          },
          "publish": {
            "type": "boolean"
          },
          "folder": {
            "type": "string"
          },
          "externalRef": {
            "type": "string"
          },
          "returnUrl": {
            "type": "string",
            "format": "uri"
          },
          "ttlMinutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 120
          }
        },
        "required": [
          "origin"
        ]
      },
      "EditResult": {
        "type": "object",
        "properties": {
          "fileId": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "mime": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "width": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "duration": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "edited": {
            "type": "boolean"
          },
          "added": {
            "type": "boolean"
          },
          "version": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "previousVersion": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "versioning": {
            "type": "string"
          },
          "app": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "url": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "revision": {
            "type": "string"
          }
        }
      },
      "EditSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "processing",
              "saved",
              "cancelled",
              "failed",
              "expired"
            ]
          },
          "mode": {
            "type": "string"
          },
          "fileId": {
            "oneOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "apps": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accept": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "origin": {
            "type": "string"
          },
          "versioning": {
            "type": "string"
          },
          "externalRef": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "appUsed": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EditResult"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string"
          },
          "savedAt": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "FileVersion": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer"
          },
          "size": {
            "type": "integer"
          },
          "mime": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "current": {
            "type": "boolean"
          },
          "source": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "comment": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      }
    },
    "responses": {
      "E400": {
        "description": "Something in the request is wrong",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E401": {
        "description": "Missing, revoked or unknown key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E403": {
        "description": "The key lacks a permission, or the address or site is not allowed",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E404": {
        "description": "No such file, share, upload, session or endpoint; missing lists ids and paths not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E409": {
        "description": "A name is taken, a share was stopped, or a session was already saved",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E410": {
        "description": "The upload or session expired or was cancelled",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E413": {
        "description": "Too large, more arrived than announced, or storage full (QUOTA)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E415": {
        "description": "No switched-on app opens that kind of file",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E429": {
        "description": "Rate limit, spending limit, too many uploads on their way, or share emails used up for today (LIMIT_REACHED)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E501": {
        "description": "Not set up on this server (e.g. email)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "E503": {
        "description": "Share emails are paused for a while (retryAfter)",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  }
}
