{"openapi":"3.0.3","info":{"title":"Via Repo-Token","description":"Access library Via Repo-Token","version":"13.0"},"tags":[{"name":"Via Repo-Token","description":"Access library Via Repo-Token"}],"servers":[{"url":"https://{server}","variables":{"server":{"default":"cloud.seafile.com"}}}],"x-readme":{"explorer-enabled":true,"metrics-enabled":false,"proxy-enabled":false},"components":{"securitySchemes":{"AccountTokenAuth":{"type":"http","scheme":"bearer","description":"This is the [Account-Token](/reference/authentication).","bearerFormat":"Account-Token"},"RepoTokenAuth":{"type":"http","scheme":"bearer","description":"This is the [Repo-Token](/reference/authentication).","bearerFormat":"Repo-Token"}},"parameters":{"file_path":{"name":"path","in":"query","description":"Path to the file","required":true,"schema":{"type":"string"},"example":"/Folder/xx.md"},"file_p":{"name":"p","in":"query","description":"Path to the file","required":true,"schema":{"type":"string"},"example":"/Folder/xx.md"},"dir_path":{"name":"path","in":"query","description":"Path to the dir","required":true,"schema":{"type":"string","default":"/"},"example":"/folder"},"type":{"name":"type","in":"query","description":"Items' type which will be list, limit in 'f' and 'd', means file and directory","required":false,"schema":{"type":"string","default":""}},"recursive":{"name":"recursive","in":"query","description":"List items recursively","required":false,"schema":{"type":"string","default":"0"}},"with_thumbnail":{"name":"with_thumbnail","in":"query","description":"Whether some kinds of files are with thumbnail, video, image, etc.","required":false,"schema":{"type":"string","default":"false"}},"thumbnail_size":{"name":"thumbnail_size","in":"query","description":"Thumbnail's size","required":false,"schema":{"type":"integer","default":48}},"req_from":{"name":"from","in":"query","description":"The request comes from","required":false,"schema":{"type":"string","enum":["api","web"],"default":"api"}},"replace":{"name":"replace","in":"query","description":"Whether to overwrite files with the same name when uploading files","required":false,"schema":{"type":"string","enum":["t","true","1","f","false","0"],"default":"0"}},"repo_id":{"name":"repo_id","in":"path","description":"The unique identifier of a library","required":true,"schema":{"type":"string","pattern":"^[0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}$"},"example":"b8e06f24-edfe-44a3-b63b-ad9ecc59e1eb"},"app_name":{"name":"app_name","in":"path","description":"App name","required":true,"schema":{"type":"string"},"example":"test-app"},"view_id":{"name":"view_id","in":"query","required":true,"description":"The unique view identifier of the current metadata","schema":{"type":"integer"}},"start":{"name":"start","in":"query","required":false,"schema":{"type":"integer","default":0}},"limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":1000}},"file_name":{"name":"file_name","in":"query","required":true,"description":"filename","schema":{"type":"string"}},"parent_dir":{"name":"parent_dir","in":"query","description":"Path to the parent_dir","required":true,"schema":{"type":"string"}},"view_id_path":{"name":"view_id","in":"path","required":true,"description":"The unique view identifier of the current metadata","schema":{"type":"integer"}},"tag_id":{"name":"tag_id","in":"path","description":"The unique identifier of a Tag","example":"KvfhV8GpQPWEskVxBtwePA","required":true,"schema":{"type":"string"}}},"schemas":{"permission":{"type":"string","enum":["r","rw"]},"path":{"type":"string","example":"/Folder"},"operation_dir":{"type":"object","properties":{"operation":{"type":"string","enum":["mkdir","rename","revert"]},"newname":{"type":"string","example":"new_folder"},"commit_id":{"type":"string"}}},"file_operation_create":{"title":"Create file","type":"object","properties":{"operation":{"type":"string","enum":["create"]}}},"file_operation_move":{"title":"Move file","type":"object","properties":{"operation":{"type":"string","enum":["move"]},"dst_dir":{"title":"dst_dir","type":"string","example":"/folder"}}},"file_operation_revert":{"title":"Revert file","type":"object","properties":{"operation":{"type":"string","enum":["copy"]},"commit_id":{"title":"dst_dir","type":"string","example":"fb53724f838f92b56559dbe3d86c1c1d3d01f53b"}}},"file_operation_rename":{"title":"Rename file","type":"object","properties":{"operation":{"type":"string","enum":["rename"]},"newname":{"title":"newname","type":"string","example":"test.md"}}},"file_operation_copy":{"title":"Copy file","type":"object","properties":{"operation":{"type":"string","enum":["copy"]},"dst_dir":{"type":"string","example":"/"}}},"file_operation":{"oneOf":[{"$ref":"#/components/schemas/file_operation_create"},{"$ref":"#/components/schemas/file_operation_revert"},{"$ref":"#/components/schemas/file_operation_move"},{"$ref":"#/components/schemas/file_operation_rename"},{"$ref":"#/components/schemas/file_operation_copy"}]},"batch_copy_or_move":{"type":"object","properties":{"src_parent_dir":{"type":"string","example":"/src"},"dst_parent_dir":{"type":"string","example":"/dst"},"src_dirents":{"type":"array","items":{"type":"string","example":"1.txt"}}},"required":["src_parent_dir","dst_parent_dir","src_dirents"]},"batch_delete_item":{"type":"object","properties":{"parent_dir":{"type":"string","example":"/folder"},"dirents":{"type":"array","items":{"type":"string","example":"1.txt"}}},"required":["parent_dir","dirents"]},"share_link_permission":{"type":"object","description":"Operation permission","properties":{"can_edit":{"type":"boolean","enum":[false,true]},"can_download":{"type":"boolean","enum":[true,false]},"can_upload":{"type":"boolean","enum":[true,false]}}},"ResponseSuccess":{"type":"object","properties":{"success":{"type":"boolean"}}},"operation_file_response":{"title":"create rename move copy","type":"object","description":"File information","properties":{"mtime":{"type":"string"},"obj_id":{"type":"string"},"obj_name":{"type":"string"},"parent_dir":{"type":"string"},"repo_id":{"type":"string"},"size":{"type":"integer"},"type":{"type":"string"},"can_preview":{"type":"boolean"},"can_edit":{"type":"boolean"}}},"move":{"title":"move","type":"object","properties":{"repo_id":{"type":"string"},"parent_dir":{"type":"string"},"obj_name":{"type":"string"}}},"revert":{"title":"revert","type":"object","properties":{"success":{"type":"boolean"}}},"file_lock_operation":{"title":"operation","type":"string","enum":["lock","unlock"],"example":"lock"},"share_links":{"type":"object","properties":{"username":{"type":"string"},"repo_id":{"type":"string"},"repo_name":{"type":"string"},"path":{"type":"string"},"obj_name":{"type":"string"},"obj_id":{"type":"string"},"is_dir":{"type":"boolean"},"token":{"type":"string"},"link":{"type":"string"},"view_cnt":{"type":"number"},"ctime":{"type":"string"},"expire_date":{"type":"string"},"is_expired":{"type":"boolean"},"permissions":{"type":"object","properties":{"can_edit":{"type":"boolean"},"can_download":{"type":"boolean"},"can_upload":{"type":"boolean"}}},"password":{"type":"string"},"user_scope":{"type":"string"},"can_edit":{"type":"boolean"}}},"row":{"type":"object","title":"Row","description":"Pass the set of column names and their values. The column names must be present in your table. Different column types require different ways to input values. For eg:\n{\"Name\":\"Max\", \"Age\":\"21\", \"Birthday\":\"2023-02-18\", \"Checkbox\":\"true\"}\n","example":{"Name":"Max","Age":18,"Birthday":"2025-06-18","Checkbox":true}},"view_id":{"type":"string","description":"The unique view identifier of the current metadata","example":"nc5t"}}},"paths":{"/api/v2.1/repos/{repo_id}/repo-api-tokens/":{"get":{"summary":"List repo api tokens","tags":["API tokens"],"description":"List all repo tokens of a library","security":[{"AccountTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/repo_id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"All repo tokens of a library","properties":{"repo_api_tokens":{"type":"array","items":{"type":"object"}}},"example":{"repo_api_tokens":[{"repo_id":"b8e06f24-edfe-44a3-b63b-ad9ecc59e1eb","app_name":"test-app","generated_by":"test@seafile.com","permission":"r","api_token":"05cd0945e412a0d6e955c2fe29e84efc4825ede1"}]}}}}}}}},"/api/v2.1/repos/{repo_id}/repo-api-tokens/{app_name}/":{"put":{"summary":"Update repo api token","tags":["API tokens"],"description":"Update a repo api token","security":[{"AccountTokenAuth":[]}],"requestBody":{"description":"description des requestBody","content":{"application/json":{"schema":{"$ref":"#/components/schemas/permission"}}}},"parameters":[{"$ref":"#/components/parameters/repo_id"},{"$ref":"#/components/parameters/app_name"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Information of a repo token","properties":{"repo_id":{"type":"string"},"app_name":{"type":"string"},"generated_by":{"type":"string"},"permission":{"type":"string"},"api_token":{"type":"string"}},"example":{"repo_id":"b8e06f24-edfe-44a3-b63b-ad9ecc59e1eb","app_name":"test-app","generated_by":"test@seafile.com","permission":"rw","api_token":"05cd0945e412a0d6e955c2fe29e84efc4825ede1"}}}}}}},"delete":{"summary":"Delete repo api token","tags":["API tokens"],"description":"Delete a repo api token","security":[{"AccountTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/repo_id"},{"$ref":"#/components/parameters/app_name"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseSuccess"}}}}}}},"/api/v2.1/via-repo-token/dir/":{"get":{"summary":"List items in directory","tags":["Dir / Files"],"description":"List all files and folders in a directory","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/dir_path"},{"$ref":"#/components/parameters/type"},{"$ref":"#/components/parameters/recursive"},{"$ref":"#/components/parameters/with_thumbnail"},{"$ref":"#/components/parameters/thumbnail_size"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"List of items","properties":{"user_perm":{"type":"string"},"dir_id":{"type":"string"},"dirent_list":{"type":"array","items":{"type":"object"}}},"example":{"user_perm":"rw","dir_id":"dc561abe027728f36ea6d02b7b4439ba1aba1b3b","dirent_list":[{"type":"dir","id":"04f3fb2b992c7aa1eb897a4e2c46b3212def1028","name":"folder","mtime":1575514722,"permission":"rw","parent_dir":"/","starred":false},{"type":"file","id":"0000000000000000000000000000000000000000","name":"1.txt","mtime":1576548579,"permission":"rw","parent_dir":"/","size":0,"modifier_email":"test@seafile.com","modifier_name":"test_user","modifier_contact_email":"test@seafile.com","is_locked":false,"lock_time":0,"lock_owner":"","lock_owner_name":"","lock_owner_contact_email":"","locked_by_me":false,"starred":false}]}}}}}}},"post":{"summary":"Operation directory","tags":["Dir / Files"],"description":"Create or rename or revert a directory","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/operation_dir"}}}},"parameters":[{"$ref":"#/components/parameters/dir_path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"The folder information","properties":{"type":{"type":"string"},"repo_id":{"type":"string"},"parent_dir":{"type":"string"},"obj_name":{"type":"string"},"obj_id":{"type":"string"},"mtime":{"type":"string"}},"example":{"type":"dir","repo_id":"b8e06f24-edfe-44a3-b63b-ad9ecc59e1eb","parent_dir":"/","obj_name":"new_folder","obj_id":"0000000000000000000000000000000000000000","mtime":"2023-12-26T07:03:06+00:00"}}}}}}},"delete":{"summary":"Delete dir","tags":["Dir / Files"],"description":"Delete the current repo directory","security":[{"AccountTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/dir_path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Success info","properties":{"success":{"type":"boolean"},"commit_id":{"type":"string"}}},"example":{"success":true,"commit_id":"574eaa90fbf8c279735a1350253b43824e8904d1"}}}}}}},"/api/v2.1/via-repo-token/file/":{"get":{"summary":"Get file info","tags":["Dir / Files"],"description":"Get detailed information about the specified file","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/file_path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"The file information","properties":{"type":{"type":"string"},"repo_id":{"type":"string"},"parent_dir":{"type":"string"},"obj_name":{"type":"string"},"obj_id":{"type":"string"},"size":{"type":"integer"},"mtime":{"type":"string"},"can_preview":{"type":"boolean"},"can_edit":{"type":"boolean"}},"example":{"type":"file","repo_id":"fedd5bc8-3da3-4be3-91d4-00b90c7de77f","parent_dir":"/Folder","obj_name":"Seafile.md","obj_id":"0000000000000000000000000000000000000000","size":0,"mtime":"2024-03-20T11:32:02+08:00","can_preview":true,"can_edit":true}}}}}}},"post":{"summary":"Operation file","tags":["Dir / Files"],"description":"Rename or revert or create or move a file\n*Note: If you want to create a file, simply pass in the path*","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/file_path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/file_operation"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/operation_file_response"},{"$ref":"#/components/schemas/revert"}]},"examples":{"Create or Rename or Move or Copy file":{"value":{"type":"file","repo_id":"761f27e6-c198-4c93-8a06-05a3f6e1ac2f","parent_dir":"/folder","obj_name":"create","obj_id":"0000000000000000000000000000000000000000","size":0,"mtime":"2024-08-28T08:23:59+00:00","can_preview":false,"can_edit":false}},"Revert file":{"value":{"success":true}}}}}}}},"put":{"tags":["Dir / Files"],"summary":"Lock/Unlock file","description":"Lock or unlock the file, locked files cannot be modified","security":[{"AccountTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/file_path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"operation":{"$ref":"#/components/schemas/file_lock_operation"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Return file information","properties":{"type":{"type":"string"},"repo_id":{"type":"string"},"parent_dir":{"type":"string"},"obj_name":{"type":"string"},"obj_id":{"type":"string"},"size":{"type":"integer"},"mtime":{"type":"string"},"can_preview":{"type":"boolean"},"can_edit":{"type":"boolean"}},"example":{"type":"file","repo_id":"eaa2b714-7993-4abc-93ce-56286d45d3de","parent_dir":"/folder","obj_name":"b","obj_id":"0000000000000000000000000000000000000000","size":0,"mtime":"2024-03-04T15:44:56+08:00","can_preview":true,"can_edit":false}}}}}}},"delete":{"summary":"Delete file","tags":["Dir / Files"],"description":"Delete existing files","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/file_path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Success info","properties":{"success":{"type":"boolean"},"commit_id":{"type":"string"}},"example":{"success":true,"commit_id":"d6c213abcaf50ae1f5e775eaf1808b4c80c9ed61"}}}}}}}},"/api/v2.1/via-repo-token/move-dir/":{"post":{"tags":["Dir / Files"],"summary":"Move directory with items merged","description":"Move the directory in the current repo.","security":[{"AccountTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"src_parent_dir":{"type":"string","example":"/Folder"},"src_dirent_name":{"type":"string","example":"folder"},"dst_parent_dir":{"type":"string","example":"/Folder/folder2"}},"required":["src_parent_dir","src_dirent_name","dst_parent_dir"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}},"/api/v2.1/via-repo-token/upload-link/":{"get":{"summary":"Get upload link","tags":["Dir / Files"],"description":"Get the upload link of a directory","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/dir_path"},{"$ref":"#/components/parameters/req_from"},{"$ref":"#/components/parameters/replace"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","description":"The upload link of a directory","example":"https://cloud.seafile.com/seafhttp/upload-api/62fdd868-ee80-4acb-b1ce-362de3fc0a63"}}}}}}},"/api/v2.1/via-repo-token/download-link/":{"get":{"summary":"Get download link","tags":["Dir / Files"],"description":"Get the download link of a file","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/file_path"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","description":"The download link of a file","example":"https://cloud.seafile.com/seafhttp/files/28ed9480-f48e-4734-b972-2e0d27167dd5/1.txt"}}}}}}},"/api/v2.1/via-repo-token/repo-info/":{"get":{"summary":"Get repo info","tags":["Dir / Files"],"description":"Get repo info Via Repo-Token","security":[{"RepoTokenAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"The information of the library","properties":{"repo_id":{"type":"string"},"repo_name":{"type":"string"}},"example":{"repo_id":"b8e06f24-edfe-44a3-b63b-ad9ecc59e1eb","repo_name":"test-library"}}}}}}}},"/api/v2.1/via-repo-token/sync-batch-move-item/":{"post":{"summary":"Sync batch move item","tags":["Dir / Files"],"description":"Batch move files and directories, all the parameters are required","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/batch_copy_or_move"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseSuccess"}}}}}}},"/api/v2.1/via-repo-token/sync-batch-copy-item/":{"post":{"summary":"Sync batch copy item","tags":["Dir / Files"],"description":"Batch copy files and directories, all the parameters are required","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/batch_copy_or_move"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseSuccess"}}}}}}},"/api/v2.1/via-repo-token/batch-delete-item/":{"delete":{"summary":"Batch delete items","tags":["Dir / Files"],"description":"Batch delete files and directories","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/batch_delete_item"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseSuccess"}}}}}}},"/api/v2.1/via-repo-token/share-links/":{"post":{"summary":"Create share link","tags":["Share links"],"description":"Create a sharing link for the library/folder. (For a file exists)","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"$ref":"#/components/schemas/share_link_permission"},"path":{"$ref":"#/components/schemas/path"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/share_links"},"example":{"username":"Seafile@example.local","repo_id":"761f27e6-c198-4c93-8a06-05a3f6e1ac2f","repo_name":"repo","path":"/Folder","obj_name":"Folder","obj_id":"026f15f4643e8a74e5e2312c509908fedba48604","is_dir":true,"token":"35769cb342fc43a3adf5","link":"http://cloud.seafile.com/d/35769cb342fc43a3adf5/","view_cnt":0,"ctime":"2024-08-29T03:48:04+00:00","expire_date":"","is_expired":false,"permissions":{"can_edit":false,"can_download":false,"can_upload":false},"password":"","user_scope":"all_users","can_edit":false}}}}}}},"/api/v2.1/via-repo-token/metadata/records/":{"get":{"tags":["Metadata records"],"summary":"List metadata records","description":"List metadata records of a library.","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/view_id"},{"$ref":"#/components/parameters/start"},{"$ref":"#/components/parameters/limit"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"data":{"type":"string"}}}},"results":{"type":"array","items":{"type":"object","properties":{"_creator":{"type":"string"},"_ctime":{"type":"string"},"_file_creator":{"type":"string"},"_file_ctime":{"type":"string"},"_file_details":{"type":"string"},"_file_modifier":{"type":"string"},"_file_mtime":{"type":"string"},"_file_type":{"type":"string"},"_id":{"type":"string"},"_is_dir":{"type":"boolean"},"_last_modifier":{"type":"string"},"_location":{"type":"object","properties":{"lnt":{"type":"integer"},"lng":{"type":"integer"}}},"_mtime":{"type":"string"},"_name":{"type":"string"},"_obj_id":{"type":"string"},"_parent_dir":{"type":"string"},"_size":{"type":"integer"},"_suffix":{"type":"string"}}}}}},"example":{"metadata":[{"key":"_id","name":"_id","type":"text","data":null},{"key":"_creator","name":"_creator","type":"text","data":null},{"key":"_ctime","name":"_ctime","type":"date","data":null},{"key":"_last_modifier","name":"_last_modifier","type":"text","data":null},{"key":"_mtime","name":"_mtime","type":"date","data":null},{"key":"_file_creator","name":"_file_creator","type":"text","data":null},{"key":"_file_ctime","name":"_file_ctime","type":"date","data":null},{"key":"_file_modifier","name":"_file_modifier","type":"text","data":null},{"key":"_file_mtime","name":"_file_mtime","type":"date","data":null},{"key":"_parent_dir","name":"_parent_dir","type":"text","data":null},{"key":"_name","name":"_name","type":"text","data":null},{"key":"_is_dir","name":"_is_dir","type":"checkbox","data":null},{"key":"_file_type","name":"_file_type","type":"single-select","data":{"options":[{"id":"_picture","name":"_picture"},{"id":"_document","name":"_document"},{"id":"_code","name":"_code"},{"id":"_video","name":"_video"},{"id":"_audio","name":"_audio"},{"id":"_compressed","name":"_compressed"},{"id":"_diagram","name":"_diagram"}]}},{"key":"_location","name":"_location","type":"geolocation","data":{"geo_format":"lng_lat"}},{"key":"_obj_id","name":"_obj_id","type":"text","data":null},{"key":"_size","name":"_size","type":"number","data":null},{"key":"_suffix","name":"_suffix","type":"text","data":null},{"key":"_file_details","name":"_file_details","type":"long-text","data":null},{"key":"_description","name":"_description","type":"long-text","data":null}],"results":[{"_creator":"aa54297e93b44d50a2efb65437cf1cc4@auth.local","_ctime":"2025-02-08T10:49:48+08:00","_file_creator":"aa54297e93b44d50a2efb65437cf1cc4@auth.local","_file_ctime":"2025-02-08T10:49:47+08:00","_file_details":"\n\n```json\n{\"Dimensions\": \"6528x4896\", \"Device make\": \"HUAWEI\", \"Device model\": \"BMH-AN20\", \"Color space\": \"\", \"Capture time\": \"2024-09-16T07:07:16+08:00\", \"Focal length\": \"3.85mm\", \"F number\": \"f/2\", \"Exposure time\": 0.01}\n```\n\n\n","_file_modifier":"aa54297e93b44d50a2efb65437cf1cc4@auth.local","_file_mtime":"2025-02-08T10:49:47+08:00","_file_type":"_picture","_id":"gSlIZWzlRJ-V16V_F7nsHA","_is_dir":false,"_last_modifier":"seafevents","_location":{"lat":39.0805091855556,"lng":115.207695007222},"_mtime":"2025-02-08T10:49:48+08:00","_name":"IMG_20240916_070716.jpg","_obj_id":"9a3a835434573c0ac7f1ca1da59527dd2e2414ce","_parent_dir":"/","_size":3952270,"_suffix":"jpg"},{"_creator":"aa54297e93b44d50a2efb65437cf1cc4@auth.local","_ctime":"2025-02-08T10:47:46+08:00","_file_creator":"aa54297e93b44d50a2efb65437cf1cc4@auth.local","_file_ctime":"2025-02-08T10:47:46+08:00","_file_details":"\n\n```json\n{\"Dimensions\": \"3648x2736\", \"Device make\": \"HUAWEI\", \"Device model\": \"BMH-AN20\", \"Color space\": \"\", \"Capture time\": \"2025-01-01T12:03:39+08:00\", \"Focal length\": \"5.58mm\", \"F number\": \"f/1.8\", \"Exposure time\": 0.03}\n```\n\n\n","_file_modifier":"aa54297e93b44d50a2efb65437cf1cc4@auth.local","_file_mtime":"2025-02-08T10:47:46+08:00","_file_type":"_picture","_id":"imKnK8BJS4S1eAJ1TL9q1Q","_is_dir":false,"_last_modifier":"seafevents","_location":{"lat":40.0894966125,"lng":116.223930358611},"_mtime":"2025-02-08T10:47:46+08:00","_name":"IMG_20250101_120339.jpg","_obj_id":"5b8f6f5c4d147792632f406b6d45884e95e6296e","_parent_dir":"/","_size":4031090,"_suffix":"jpg"}]}}}}}},"put":{"tags":["Metadata records"],"summary":"Update metadata records","description":"Update existing metadata records.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"records_data":{"type":"array","items":{"type":"object","properties":{"record_id":{"type":"string","example":"beT8DpTvQn6zmMScvH--gw","description":"Unique identifier of the record"},"_obj_id":{"type":"string","example":"940762f77e6f2159f5493a20f9db156b8a3327cf","description":"Unique identifier of file object"},"record":{"$ref":"#/components/schemas/row"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}},"/api/v2.1/via-repo-token/metadata/views/":{"get":{"tags":["Metadata views"],"summary":"List views","description":"List all view information for the current metadata.","security":[{"RepoTokenAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"views":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"table_id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array"},"sorts":{"type":"array"},"groupbys":{"type":"array"},"filter_conjunction":{"type":"string"},"hidden_columns":{"type":"array"}}}},"navigation":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string","description":"Id of view"},"type":{"type":"string","description":"View type"}}}}},"example":{"views":[{"_id":"uh51","table_id":"0001","name":"All files","filters":[],"sorts":[{"column_key":"_file_mtime","sort_type":"down"}],"groupbys":[],"filter_conjunction":"And","hidden_columns":[],"type":"table","basic_filters":[{"column_key":"_is_dir","filter_predicate":"is","filter_term":"file"}]}],"navigation":[{"_id":"uh51","type":"view"}]}}}}}}},"post":{"tags":["Metadata views"],"summary":"Add view","description":"Add a view to the current database, provided that metadata is enabled.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Name of view"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"_id":{"type":"string"},"table_id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array"},"sorts":{"type":"array"},"groupbys":{"type":"array"},"filter_conjunction":{"type":"string"},"hidden_columns":{"type":"array"},"type":{"type":"string"}}}}},"example":{"view":{"_id":"80u7","table_id":"0001","name":"v1","filters":[],"sorts":[],"groupbys":[],"filter_conjunction":"And","hidden_columns":[],"type":"table"}}}}}}},"put":{"tags":["Metadata views"],"summary":"Update view","description":"Rename view or filter view.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"view_id":{"type":"string","example":"80u7"},"view_data":{"type":"object","oneOf":[{"properties":{"name":{"type":"string","description":"New name"}}},{"properties":{"filters":{"type":"array","description":"Filter Criteria","items":{"type":"object","properties":{"column_key":{"type":"string"},"filter_predicate":{"type":"string"},"filter_term":{"type":"string"}}}},"filter_conjunction":{"type":"string"}}}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}},"delete":{"tags":["Metadata views"],"summary":"Delete view","description":"Delete existing views.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"view_id":{"$ref":"#/components/schemas/view_id"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}},"/api/v2.1/via-repo-token/metadata/views/{view_id}/":{"get":{"tags":["Metadata views"],"summary":"Get a view","description":"Get detailed information of existing views.","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/view_id_path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"view_id":{"$ref":"#/components/schemas/view_id"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"_id":{"type":"string"},"table_id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object"}},"sorts":{"type":"array","items":{"type":"object"}},"groupbys":{"type":"array","items":{"type":"object"}},"filter_conjunction":{"type":"string"},"hidden_columns":{"type":"array","items":{"type":"object"}},"type":{"type":"string"},"basic_filters":{"type":"array","items":{"type":"object"}}}}},"example":{"view":{"_id":"erzk","table_id":"0001","name":"All files","filters":[],"sorts":[],"groupbys":[],"filter_conjunction":"And","hidden_columns":[],"type":"table","basic_filters":[{"column_key":"_is_dir","filter_predicate":"is","filter_term":"file"}]}}}}}}}}},"/api/v2.1/via-repo-token/metadata/move-views/":{"post":{"tags":["Metadata views"],"summary":"Move view","description":"Move source_view_id ahead of target_view_id, if the original order is ['a', 'b', 'c', 'd'], source_view_id is d, target_view_id is b, the order will change to [\"a\", 'd', 'b', 'c'] after moving.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"source_view_id":{"type":"string","example":"erzk","description":"The unique view identifier of the current metadata"},"target_view_id":{"type":"string","example":"l877","description":"The unique view identifier of the current metadata"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"navigation":{"type":"array","items":{"type":"object","properties":{"_id":{"type":"string"},"type":{"type":"string"}}}}}},"example":{"navigation":[{"_id":"erzk","type":"view"},{"_id":"l877","type":"view"},{"_id":"wtdb","type":"view"}]}}}}}}},"/api/v2.1/via-repo-token/metadata/duplicate-view/":{"post":{"tags":["Metadata views"],"summary":"Duplicate view","description":"Copy an existing view.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"view_id":{"$ref":"#/components/schemas/view_id"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"view":{"type":"object","properties":{"_id":{"type":"string"},"table_id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object"}},"sorts":{"type":"array","items":{"type":"object"}},"groupbys":{"type":"array","items":{"type":"object"}},"filter_conjunction":{"type":"string"},"hidden_columns":{"type":"array","items":{"type":"object"}},"type":{"type":"string"},"basic_filters":{"type":"array","items":{"type":"object"}}}}},"example":{"view":{"_id":"erzk","table_id":"0001","name":"All files","filters":[],"sorts":[],"groupbys":[],"filter_conjunction":"And","hidden_columns":[],"type":"table","basic_filters":[{"column_key":"_is_dir","filter_predicate":"is","filter_term":"file"}]}}}}}}}}},"/api/v2.1/via-repo-token/metadata/tags-status/":{"put":{"tags":["Tags"],"summary":"Turn on tags feature","description":"Enable tags to add tags to files and search files by tags.","security":[{"RepoTokenAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}},"delete":{"tags":["Tags"],"summary":"Turn off tags feature","description":"Turn off tags feature.","security":[{"RepoTokenAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}},"/api/v2.1/via-repo-token/metadata/tags/":{"get":{"tags":["Tags"],"summary":"List tags","description":"List all existing tags.","security":[{"RepoTokenAuth":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"array","description":"Metadata of tags","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"data":{"type":"object"}}}},"results":{"type":"array","description":"Tags info","items":{"type":"object","properties":{"_creator":{"type":"string"},"_ctime":{"type":"string"},"_id":{"type":"string"},"_last_modifier":{"type":"string"},"_mtime":{"type":"string"},"_tag_color":{"type":"string"},"_tag_name":{"type":"string"}}}}}},"example":{"metadata":[{"key":"_id","name":"_id","type":"text","data":null},{"key":"_creator","name":"_creator","type":"text","data":null},{"key":"_ctime","name":"_ctime","type":"date","data":null},{"key":"_last_modifier","name":"_last_modifier","type":"text","data":null},{"key":"_mtime","name":"_mtime","type":"date","data":null},{"key":"_tag_name","name":"_tag_name","type":"text","data":null},{"key":"_tag_color","name":"_tag_color","type":"text","data":null},{"key":"_tag_file_links","name":"_tag_file_links","type":"link","data":{"display_column_key":"_id","link_id":"0002","other_table_id":"z88R","table_id":"0001"}},{"key":"_tag_parent_links","name":"_tag_parent_links","type":"link","data":{"display_column_key":"_id","is_linked_back":false,"link_id":"0003","other_table_id":"z88R","table_id":"z88R"}},{"key":"_tag_sub_links","name":"_tag_sub_links","type":"link","data":{"display_column_key":"_id","is_linked_back":true,"link_id":"0003","other_table_id":"z88R","table_id":"z88R"}}],"results":[{"_creator":"e40151bbbe184577b11ed818a49f97f3@auth.local","_ctime":"2025-02-13T18:27:20+08:00","_id":"OP6ak-N7Q7i96oX6I3lkFw","_last_modifier":"e40151bbbe184577b11ed818a49f97f3@auth.local","_mtime":"2025-02-13T18:27:20+08:00","_tag_color":"#FFFCB5","_tag_name":"标签"}]}}}}}},"post":{"tags":["Tags"],"summary":"Add tags","description":"Add custom tags.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags_data":{"type":"array","items":{"type":"object","properties":{"_tag_name":{"type":"string","example":"Tag1"},"_tag_color":{"type":"string","example":"#F4667C"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"object","properties":{"_creator":{"type":"string"},"_ctime":{"type":"string"},"_id":{"type":"string"},"_last_modifier":{"type":"string"},"_mtime":{"type":"string"},"_tag_color":{"type":"string"},"_tag_name":{"type":"string"}}}}}},"example":{"tags":[{"_creator":"e40151bbbe184577b11ed818a49f97f3@auth.local","_ctime":"2025-02-14T10:40:52+08:00","_id":"dOSid9ECR26rHtgLokPXBw","_last_modifier":"e40151bbbe184577b11ed818a49f97f3@auth.local","_mtime":"2025-02-14T10:40:52+08:00","_tag_color":"#F4667C","_tag_name":"Tag1"}]}}}}}},"put":{"tags":["Tags"],"summary":"Update tags","description":"Update existing tags.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags_data":{"type":"array","items":{"type":"object","properties":{"tag_id":{"type":"string","example":"dOSid9ECR26rHtgLokPXBw"},"tag":{"type":"object","properties":{"_tag_color":{"type":"string","example":"#9860E5"},"_tag_name":{"type":"string","example":"new tag"}}}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}},"delete":{"tags":["Tags"],"summary":"Delete tags","description":"Delete the tags with the specified tag id.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tag_ids":{"type":"array","items":{"type":"string","description":"Unique identification of existing tags","example":"dOSid9ECR26rHtgLokPXBw"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}},"/api/v2.1/via-repo-token/metadata/file-tags":{"put":{"tags":["Tags"],"summary":"Update file tags","description":"Add or modify existing tags to the specified records of metadata.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"file_tags_data":{"type":"array","items":{"type":"object","properties":{"record_id":{"type":"string","description":"Unique identifier of the record"},"tags":{"type":"array","items":{"type":"string","description":"Unique identification of existing tags"}}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"fail":{"type":"array","items":{"type":"string","description":"Add failed record id"}},"success":{"type":"array","items":{"type":"string","description":"Add success record id"}}}},"example":{"success":["al8SjKN0QxGrE6vr0SHDOw"],"fail":[]}}}}}}},"/api/v2.1/via-repo-token/metadata/tag-files/{tag_id}/":{"get":{"tags":["Tags"],"summary":"List tag files","description":"List all files marked by the current tag.","security":[{"RepoTokenAuth":[]}],"parameters":[{"$ref":"#/components/parameters/tag_id"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"array","items":{"type":"object","description":"The metadata type of the file.","properties":{"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"data":{"type":"object"}}}},"results":{"type":"array","items":{"type":"object","description":"File info","properties":{"_file_mtime":{"type":"string"},"_id":{"type":"string"},"_name":{"type":"string"},"_parent_dir":{"type":"string"},"_size":{"type":"integer"},"_tags":{"type":"array","items":{"type":"object","properties":{"row_id":{"type":"string"},"display_value":{"type":"string"}}}}}}}},"example":{"metadata":[{"key":"_id","name":"_id","type":"text","data":null},{"key":"_name","name":"_name","type":"text","data":null},{"key":"_parent_dir","name":"_parent_dir","type":"text","data":null},{"key":"_size","name":"_size","type":"number","data":null},{"key":"_file_mtime","name":"_file_mtime","type":"date","data":null},{"key":"_tags","name":"_tags","type":"link","data":{"display_column_key":"_tag_name","link_id":"0002","other_table_id":"wC6x","table_id":"0001"}}],"results":[{"_file_mtime":"2025-02-14T11:21:33+08:00","_id":"al8SjKN0QxGrE6vr0SHDOw","_name":"file","_parent_dir":"/","_size":3952270,"_tags":[{"row_id":"KvfhV8GpQPWEskVxBtwePA","display_value":"tag"}]}]}}}}}}}},"/api/v2.1/via-repo-token/metadata/tags-files/":{"post":{"tags":["Tags"],"summary":"List tags files","description":"List files marked by tags.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags_ids":{"type":"array","items":{"type":"string","example":"iVVorGfDTuaFdJOwGhR4og"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"metadata":{"type":"array","items":{"type":"object","description":"The metadata type of the file.","properties":{"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"data":{"type":"object"}}}},"results":{"type":"array","items":{"type":"object","description":"File info","properties":{"_file_mtime":{"type":"string"},"_id":{"type":"string"},"_name":{"type":"string"},"_parent_dir":{"type":"string"},"_size":{"type":"integer"},"_tags":{"type":"array","items":{"type":"object","properties":{"row_id":{"type":"string"},"display_value":{"type":"string"}}}}}}}},"example":{"metadata":[{"key":"_id","name":"_id","type":"text","data":null},{"key":"_name","name":"_name","type":"text","data":null},{"key":"_parent_dir","name":"_parent_dir","type":"text","data":null},{"key":"_size","name":"_size","type":"number","data":null},{"key":"_file_mtime","name":"_file_mtime","type":"date","data":null},{"key":"_tags","name":"_tags","type":"link","data":{"display_column_key":"_tag_name","link_id":"0002","other_table_id":"wC6x","table_id":"0001"}}],"results":[{"_file_mtime":"2025-02-14T11:21:33+08:00","_id":"al8SjKN0QxGrE6vr0SHDOw","_name":"file","_parent_dir":"/","_size":3952270,"_tags":[{"row_id":"KvfhV8GpQPWEskVxBtwePA","display_value":"tag"}]}]}}}}}}}},"/api/v2.1/via-repo-token/metadata/tags-links/":{"post":{"tags":["Tags"],"summary":"Add tags links","description":"Linking a tag to a sub layer of another tag.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"link_column_key":{"type":"string","description":"_tag_sub_links or _tag_parent_links","example":"_tag_parent_links"},"row_id_map":{"type":"object","description":"The key is the parent tag ID, and the value is the child tag ID that needs to be linked","properties":{"3Jwd1nwnSrO1vuDdpfmKUA":{"type":"array","items":{"type":"string","example":"TMRFgo8OTJi2Mk4l4ABOy"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}},"put":{"tags":["Tags"],"summary":"Update tags links","description":"Update links between existing tags.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"link_column_key":{"type":"string","description":"_tag_sub_links or _tag_parent_links","example":"_tag_parent_links"},"row_id_map":{"type":"object","description":"The key is the parent tag ID, and the value is the child tag ID that needs to be linked","properties":{"3Jwd1nwnSrO1vuDdpfmKUA":{"type":"array","items":{"type":"string","example":"TMRFgo8OTJi2Mk4l4ABOy"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}},"delete":{"tags":["Tags"],"summary":"Delete tags links","description":"Delete links between existing tags.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"link_column_key":{"type":"string","description":"_tag_sub_links or _tag_parent_links","example":"_tag_parent_links"},"row_id_map":{"type":"object","description":"The key is the parent tag ID, and the value is the child tag ID that needs to be linked","properties":{"3Jwd1nwnSrO1vuDdpfmKUA":{"type":"array","items":{"type":"string","example":"TMRFgo8OTJi2Mk4l4ABOy"}}}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}},"/api/v2.1/via-repo-token/metadata/merge-tags/":{"post":{"tags":["Tags"],"summary":"Merge tags","description":"Merge other tags into the specified existing tag.","security":[{"RepoTokenAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"target_tag_id":{"type":"string","example":"EQhOJke4S4ykb53tEkrjBA"},"merged_tags_ids":{"type":"array","items":{"type":"string","example":"TMRFgo8OTJi2Mk4l4ABOy"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Success state"}}}}}}}}}}}