• Web API (For Seafile server v5.1.0+)
  • Seafile Web API" level="1">Seafile Web API
    • API Basics" level="2">API Basics
    • Status Code" level="2">Status Code
    • Quick Start" level="2">Quick Start
    • Account" level="2">Account
      • Check Account Info" level="3">Check Account Info
      • Get Client Login URL" level="3">Get Client Login URL
      • Get Server Information" level="3">Get Server Information
    • Starred Files" level="2">Starred Files
      • List starred files" level="3">List starred files
      • Star A File" level="3">Star A File
      • Unstar A File" level="3">Unstar A File
    • Group" level="2">Group
      • List Groups" level="3">List Groups
      • Add a Group" level="3">Add a Group
      • Get Info of a Group" level="3">Get Info of a Group
      • Rename a Group" level="3">Rename a Group
      • Transfer a Group" level="3"> Transfer a Group
      • Delete a Group" level="3"> Delete a Group
      • Quit Group" level="3"> Quit Group
      • Group Member" level="3">Group Member
        • List All Group Members" level="4">List All Group Members
        • Add a Group Member" level="4">Add a Group Member
        • Bulk Add Group Members" level="4">Bulk Add Group Members
        • Get Info of a Group Member" level="4">Get Info of a Group Member
        • Set a Group Member Admin" level="4">Set a Group Member Admin
        • Unset a Group Member Admin" level="4">Unset a Group Member Admin
        • Delete a Group Member" level="4"> Delete a Group Member
      • Group Message" level="3">Group Message
        • Get Group Messages" level="4">Get Group Messages
        • Send A Group Message" level="4">Send A Group Message
        • Delete A Group Message" level="4">Delete A Group Message
      • Group Owned Libraries" level="3">Group Owned Libraries
        • Add Group Owned Library" level="4">Add Group Owned Library
        • Delete Group Owned Library" level="4">Delete Group Owned Library
        • Get Group Owned Library User Share Info" level="4">Get Group Owned Library User Share Info
        • Share Group Owned Library to User" level="4">Share Group Owned Library to User
        • Modify Group Owned Library User Share Permission" level="4">Modify Group Owned Library User Share Permission
        • Delete Group Owned Library User Share" level="4">Delete Group Owned Library User Share
        • Get Group Owned Library Group Share Info" level="4">Get Group Owned Library Group Share Info
        • Share Group Owned Library to Group" level="4">Share Group Owned Library to Group
        • Modify Group Owned Library Group Share Permission" level="4">Modify Group Owned Library Group Share Permission
        • Delete Group Owned Library Group Share" level="4">Delete Group Owned Library Group Share
        • Modify Group Owned Library Sub-Folder Permission" level="4">Modify Group Owned Library Sub-Folder Permission
    • Share" level="2">Share
      • File Share Link" level="3">File Share Link
        • List all Share Links" level="4">List all Share Links
        • List Share Links of a Library" level="4">List Share Links of a Library
        • List Share Link of a Folder(File)" level="4">List Share Link of a Folder(File)
        • Create Share Link" level="4">Create Share Link
        • Delete Share Link" level="4">Delete Share Link
        • Send Share Link Email" level="4">Send Share Link Email
        • List Direntry in Dir Download Link" level="4">List Direntry in Dir Download Link
      • Upload Link" level="3">Upload Link
        • List Upload Links" level="4">List Upload Links
        • Create Upload Link" level="4">Create Upload Link
        • Delete Upload Link" level="4">Delete Upload Link
        • Send Upload Link Email" level="4">Send Upload Link Email
      • Shared Libraries" level="3">Shared Libraries
        • List User Shared Libraries" level="4">List User Shared Libraries
        • List Group Shared Libraries" level="4">List Group Shared Libraries
        • List Be Shared Libraries" level="4">List Be Shared Libraries
        • Delete Be Shared Library" level="4">Delete Be Shared Library
        • Share a Library to User" level="4">Share a Library to User
        • Unshare a Library from User" level="4">Unshare a Library from User
        • Update Permission of User Shared Library" level="4">Update Permission of User Shared Library
        • Share a Library to Group" level="4">Share a Library to Group
        • Unshare a Library from Group" level="4">Unshare a Library from Group
        • Update Permission of Group Shared Library" level="4">Update Permission of Group Shared Library
        • Batch Share Libraries to User" level="4">Batch Share Libraries to User
        • Batch Share Libraries to Group" level="4">Batch Share Libraries to Group
      • Shared Folders" level="3">Shared Folders
        • Share A Folder" level="4">Share A Folder
        • List Shared Folders" level="4">List Shared Folders
        • Update Shared Folder Permission" level="4">Update Shared Folder Permission
        • Unshare A Folder" level="4">Unshare A Folder
    • Folder Permission" level="2">Folder Permission
      • User Folder Permission" level="3">User Folder Permission
        • Get User Folder Permission" level="4">Get User Folder Permission
        • Set User Folder Permission" level="4">Set User Folder Permission
        • Modify User Folder Permission" level="4">Modify User Folder Permission
        • Delete User Folder Permission" level="4">Delete User Folder Permission
      • Group Folder Permission" level="3">Group Folder Permission
        • Get Group Folder Permission" level="4">Get Group Folder Permission
        • Set Group Folder Permission" level="4">Set Group Folder Permission
        • Modify Group Folder Permission" level="4">Modify Group Folder Permission
        • Delete Group Folder Permission" level="4">Delete Group Folder Permission
    • Library" level="2">Library
      • Get Default Library" level="3">Get Default Library
      • Create Default Library" level="3">Create Default Library
      • List Libraries" level="3">List Libraries
      • Get Library Info" level="3">Get Library Info
      • Get Library Owner" level="3">Get Library Owner
      • Get Library History" level="3">Get Library History
      • Get Library Trash" level="3">Get Library Trash
      • Get Library History Limit Days" level="3">Get Library History Limit Days
      • Set Library History Limit Days" level="3">Set Library History Limit Days
      • Create Library" level="3">Create Library
      • Check/Create Sub Library" level="3">Check/Create Sub Library
      • Delete Library" level="3">Delete Library
      • Rename Library" level="3">Rename Library
      • Transfer Library" level="3">Transfer Library
      • Decrypt Library" level="3">Decrypt Library
      • Create Public Library" level="3">Create Public Library
      • Set Exist Lib as Public Library" level="3">Set Exist Lib as Public Library
      • Remove Public Library" level="3">Remove Public Library
      • Fetch library download info" level="3">Fetch library download info
      • Search Files in Libraries" level="3">Search Files in Libraries
      • Get Library Download Links" level="3">Get Library Download Links
        • Get Library Upload Links" level="4">Get Library Upload Links
        • Delete Library Download Link" level="4">Delete Library Download Link
        • Delete Library Upload Link" level="4">Delete Library Upload Link
        • Search Library By Name" level="4">Search Library By Name
    • File" level="2">File
      • View File Through Owa" level="3">View File Through Owa
      • Download File" level="3">Download File
      • Get File Detail" level="3">Get File Detail
      • Get File History" level="3">Get File History
      • Restore File From History" level="3">Restore File From History
      • Download File From a Revision" level="3">Download File From a Revision
      • Create File" level="3">Create File
      • Rename File" level="3">Rename File
      • Lock File" level="3">Lock File
      • Unlock File" level="3">Unlock File
      • Move File" level="3">Move File
      • Copy File" level="3">Copy File
      • Revert File" level="3">Revert File
      • Delete File" level="3">Delete File
      • Upload File" level="3">Upload File
        • Get Upload Link" level="4">Get Upload Link
        • Upload File" level="4">Upload File
      • Resumable Upload File" level="3">Resumable Upload File
        • Check If Enable Resumable Upload" level="4">Check If Enable Resumable Upload
        • Get Upload Link" level="4">Get Upload Link
        • Get Bytes Already Uploaded" level="4">Get Bytes Already Uploaded
        • Upload File" level="4">Upload File
      • Update file" level="3">Update file
        • Get Update Link" level="4">Get Update Link
        • Update File" level="4">Update File
      • Uploading Large File in Blocks" level="3">Uploading Large File in Blocks
      • Step 3, let the server to commit the file
      • Get Update Blocks Link" level="3">Get Update Blocks Link
      • File Comments" level="3">File Comments
        • Get Comment" level="4">Get Comment
        • Delete Comment" level="4">Delete Comment
        • List Comments" level="4">List Comments
        • Post Comments" level="4">Post Comments
        • Get Number of Comments" level="4">Get Number of Comments
      • Get Smart Link for a File" level="3">Get Smart Link for a File
    • Directory" level="2">Directory
      • List Directory Entries" level="3">List Directory Entries
      • Get Directory Detail" level="3">Get Directory Detail
      • Create New Directory" level="3">Create New Directory
      • Rename Directory" level="3">Rename Directory
      • Delete Directory" level="3">Delete Directory
      • Download Directory" level="3">Download Directory
        • Get Task Token" level="5">Get Task Token
    • Revert Directory" level="3">Revert Directory
      • Query Task Progress" level="5">Query Task Progress
  • Asynchronously Copy/Move File/Directory" level="2">Asynchronously Copy/Move File/Directory
    • Get Task Id" level="3">Get Task Id
    • Cancel Task" level="3">Cancel Task
    • Query Progress" level="3">Query Progress
  • Multiple Files / Directories" level="2">Multiple Files / Directories
    • Copy" level="3">Copy
    • Move" level="3">Move
    • Delete" level="3">Delete
    • Download" level="3">Download
      • Get Task Token" level="5">Get Task Token
      • Query Task Progress" level="5">Query Task Progress
  • Avatar" level="2">Avatar
    • Update User Avatar" level="3">Update User Avatar
    • Get User Avatar" level="3">Get User Avatar
    • Get Group Avatar" level="3">Get Group Avatar
  • Devices" level="2">Devices
    • Get User Devices" level="3">Get User Devices
    • Unlink User Device" level="3">Unlink User Device
  • Snapshot Label" level="2">Snapshot Label
    • Get Snapshot Label" level="3">Get Snapshot Label
    • Create New Snapshot Label" level="3">Create New Snapshot Label
    • Update Snapshot Label" level="3">Update Snapshot Label
    • Delete Snapshot Label" level="3">Delete Snapshot Label
  • Get File Activities" level="2">Get File Activities
  • Get Thumbnail Image" level="2">Get Thumbnail Image
    • Search User" level="3">Search User
  • Admin Only" level="1">Admin Only
    • Account" level="2">Account
      • List Accounts" level="3">List Accounts
      • Get Account Info" level="3">Get Account Info
      • Create Account" level="3">Create Account
      • Update Account" level="3">Update Account
      • Migrate Account" level="3">Migrate Account
      • Delete Account" level="3">Delete Account
    • Devices" level="2">Devices
      • Get Desktop Devices" level="3">Get Desktop Devices
      • Get Mobile Devices" level="3">Get Mobile Devices
      • Unlink User Device" level="3">Unlink User Device
      • Get Device Errors" level="3">Get Device Errors
      • Clean Device Errors" level="3">Clean Device Errors
    • Get Snapshots by Label" level="2">Get Snapshots by Label
    • Default Library" level="2">Default Library
      • Get User Default Library" level="3">Get User Default Library
      • Create User Default Library" level="3">Create User Default Library
    • Libraries" level="2">Libraries
      • Get all Libraries" level="3">Get all Libraries
      • Search Library by Name" level="3">Search Library by Name
      • Search Library by Owner" level="3">Search Library by Owner
      • Delete a Library" level="3">Delete a Library
      • Transfer a Library" level="3">Transfer a Library
      • Get Library Dirents" level="3">Get Library Dirents
      • Get All Deleted Libraries" level="3">Get All Deleted Libraries
      • Get Deleted Libraries by Owner" level="3">Get Deleted Libraries by Owner
      • Clean Deleted Library" level="3">Clean Deleted Library
      • Restore Deleted Library" level="3">Restore Deleted Library
      • Clean ALl Deleted Libraries" level="3">Clean ALl Deleted Libraries
    • Shares" level="2">Shares
      • Get Repo User Shares" level="3">Get Repo User Shares
      • Get Repo Group Shares" level="3">Get Repo Group Shares
      • Share Repo to User" level="3">Share Repo to User
      • Share Repo to Group" level="3">Share Repo to Group
      • Modify Repo User Share Permission" level="3">Modify Repo User Share Permission
      • Modify Repo Group Share Permission" level="3">Modify Repo Group Share Permission
      • Delete Repo User Share" level="3">Delete Repo User Share
      • Delete Repo Group Share" level="3">Delete Repo Group Share
    • Groups" level="2">Groups
      • Get all groups" level="3">Get all groups
      • Delete a Group" level="3">Delete a Group
      • Transfer a Group" level="3">Transfer a Group
      • Set Group Quota" level="3">Set Group Quota
      • Get Group Libraries" level="3">Get Group Libraries
      • Delete Group Library" level="3">Delete Group Library
      • Get Group Members" level="3">Get Group Members
      • Delete Group Member" level="3">Delete Group Member
      • Add Group Member" level="3">Add Group Member
      • Update Group Member Role" level="3">Update Group Member Role
    • Add Group Owned Library" level="3">Add Group Owned Library
    • Delete Group Owned Library" level="3">Delete Group Owned Library
  • Shared Links" level="2">Shared Links
    • Download Links" level="3">Download Links
      • Get Shared File/Dir Info" level="4">Get Shared File/Dir Info
      • Get Sub File/Dir List in Shared Dir" level="4">Get Sub File/Dir List in Shared Dir
      • Download File/Dir" level="4">Download File/Dir
      • Check Password" level="4">Check Password
    • Upload Links" level="3">Upload Links
      • Get Shared Dir Info" level="4">Get Shared Dir Info
      • Upload" level="4">Upload
      • Check Password" level="4">Check Password
  • Admin Log" level="2">Admin Log
    • Get Login Log" level="3">Get Login Log
    • Get File Audit Log" level="3">Get File Audit Log
    • Get File Update Log" level="3">Get File Update Log
    • Get Permission Audit Log" level="3">Get Permission Audit Log
  • Organization" level="2">Organization
    • Add Organization" level="3">Add Organization
    • Add Organization User" level="3">Add Organization User
    • Get Organization User Info" level="3">Get Organization User Info
    • Updage Organization User Info" level="3">Updage Organization User Info
    • Delete Organization User" level="3">Delete Organization User
  • Department" level="2">Department
    • List departments" level="3"> List departments
    • List groups and members in a department" level="3"> List groups and members in a department
    • Create department" level="3"> Create department
    • Dismiss department" level="3"> Dismiss department

    Web API (For Seafile server v5.1.0+)





    Seafile Web API" class="reference-link">Seafile Web API

    API Basics" class="reference-link">API Basics

    All API calls must be authenticated with a valid Seafile API key.

    1. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' https://cloud.seafile.com/api2/auth/ping/

    The api key can be retrieved by the obtain auth api. See the Quick Start for details.

    For each API, we provide curl examples to illustrate the usage. We also provide python and javascript examples, please refer to https://github.com/haiwen/webapi-examples for details.

    Status Code" class="reference-link">Status Code

    • 200: OK
    • 201: CREATED
    • 202: ACCEPTED
    • 301: MOVED_PERMANENTLY
    • 400: BAD_REQUEST
    • 403: FORBIDDEN
    • 404: NOT_FOUND
    • 409: CONFLICT
    • 429: TOO_MANY_REQUESTS
    • 440: REPO_PASSWD_REQUIRED
    • 441: REPO_PASSWD_MAGIC_REQUIRED
    • 500: INTERNAL_SERVER_ERROR
    • 520: OPERATION_FAILED

    Quick Start" class="reference-link">Quick Start

    ping

    1. curl https://cloud.seafile.com/api2/ping/
    2. "pong"

    obtain auth token

    1. curl -d "username=username@example.com&password=123456" https://cloud.seafile.com/api2/auth-token/
    2. {"token": "24fd3c026886e3121b2ca630805ed425c272cb96"}

    you should use --data-urlencode if you want to process some special characters properly.

    1. curl --data-urlencode username=user+name@example.com -d password=123456 https://cloud.seafile.com/api2/auth-token/
    2. {"token":"265757b0a5aaf5d6b2e266d0c21791121ce6cdec"}

    auth ping

    1. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' https://cloud.seafile.com/api2/auth/ping/
    2. "pong"

    Account" class="reference-link">Account

    Check Account Info" class="reference-link">Check Account Info

    GET https://cloud.seafile.com/api2/account/info/

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/account/info/

    Sample response

    1. {
    2. "usage": 26038531,
    3. "total": 104857600,
    4. "email": "user@example.com"
    5. }

    Errors

    • 403 Invalid token

    Get Client Login URL" class="reference-link">Get Client Login URL

    GET https://cloud.seafile.com/api2/client-login/

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" https://cloud.seafile.com/api2/client-login/

    Sample response

    Note:

    • If the user has two way authentication enabled, the server will respond with an empty JSON object ({}).
    1. "https://cloud.seafile.com/client-login/?token=000f1f83d612836c65fed087fb9c4ca40852d0f9"

    Errors

    • 403 Invalid token

    Get Server Information" class="reference-link">Get Server Information

    GET https://cloud.seafile.com/api2/server-info

    Note:

    • No authentication required.
    • Added in seafile community edition server 4.0.5 or pro edition server 4.0.3

    Sample request

    1. curl https://cloud.seafile.com/api2/server-info/

    Sample response

    Sample response from a seafile community edition server:

    1. {
    2. "version": "4.0.6",
    3. "features": [
    4. "seafile-basic",
    5. ]
    6. }

    Sample response from a seafile pro edition server:

    1. {
    2. "version": "4.0.6",
    3. "features": [
    4. "seafile-basic",
    5. "seafile-pro",
    6. "office-preview",
    7. "file-search"
    8. ]
    9. }

    Starred Files" class="reference-link">Starred Files

    List starred files" class="reference-link">List starred files

    GET https://cloud.seafile.com/api2/starredfiles/

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e6199b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/starredfiles/

    Sample response

    1. [
    2. {
    3. "repo": "99b758e6-91ab-4265-b705-925367374cf0",
    4. "mtime": 1355198150,
    5. "org": -1,
    6. "path": "/foo/bar.doc",
    7. "dir": false,
    8. "size": 0
    9. },
    10. {
    11. "repo": "99b758e6-91ab-4265-b705-925367374cf0",
    12. "mtime": 1353751237,
    13. "org": -1,
    14. "path": "/add_folder-blue.png",
    15. "dir": false,
    16. "size": 3170
    17. }
    18. ]

    Star A File" class="reference-link">Star A File

    POST https://cloud.seafile.com/api2/starredfiles/

    Request parameters

    • repo_id (post)
    • p (post)

    Sample request

    1. curl -v -d "repo_id=dae8cecc-2359-4d33-aa42-01b7846c4b32&p=/foo.md" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/starredfiles/

    Sample response

    1. ...
    2. < HTTP/1.0 201 CREATED
    3. < Location: https://cloud.seafile.com/api2/starredfiles/
    4. ...
    5. "success"

    Success

    Response code is 201(Created) and Location header provides url of starred file list.

    Errors

    • 400 repo_id or p is missing, or p is not valid file path(e.g. /foo/bar/).

    Unstar A File" class="reference-link">Unstar A File

    DELETE https://cloud.seafile.com/api2/starredfiles/

    Request parameters

    • repo_id
    • p

    Sample request

    1. curl -X DELETE -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' 'https://cloud.seafile.com/api2/starredfiles/?repo_id=dae8cecc-2359-4d33-aa42-01b7846c4b32&p=/foo.md'

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Success

    Response code is 200(OK), and a string named “success” is returned.

    Errors

    • 400 repo_id or p is missing, or p is not valid file path(e.g. /foo/bar/).

    Group" class="reference-link">Group

    List Groups" class="reference-link">List Groups

    GET https://cloud.seafile.com/api2/groups/

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/"

    Sample response

    1. {
    2. "replynum": 0,
    3. "groups": [
    4. {
    5. "ctime": 1398134171327948,
    6. "creator": "user@example.com",
    7. "msgnum": 0,
    8. "mtime": 1398231100,
    9. "id": 1,
    10. "name": "lian"
    11. },
    12. {
    13. "ctime": 1398236081042441,
    14. "creator": "user@example.com",
    15. "msgnum": 0,
    16. "mtime": 0,
    17. "id": 2,
    18. "name": "123"
    19. }
    20. ]
    21. }

    Add a Group" class="reference-link">Add a Group

    POST https://cloud.seafile.com/api/v2.1/groups/

    Request parameters

    • name (name of new group)

    Sample request

    1. curl -d "name=new_group_name" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/

    Sample response

    1. {
    2. "name": "new_group_name",
    3. "owner": "lian@lian.com",
    4. "created_at": "2015-12-17T10:29:57+0800",
    5. "admins": ["lian@lian.com"],
    6. "avatar_url": "https://cloud.seafile.com/media/avatars/groups/default.png",
    7. "id": 773
    8. }

    Get Info of a Group" class="reference-link">Get Info of a Group

    GET https://cloud.seafile.com/api/v2.1/groups/772/

    Request parameters

    • avatar_size
    • with_repos (0 or 1, if return library info of group. default 0 not return)

    Sample request

    1. curl -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/772/

    Sample response

    1. {
    2. "name": "rename_group_name",
    3. "owner": "lian@lian.com",
    4. "created_at": "2015-12-17T10:29:57+0800",
    5. "admins": ["lian@lian.com"],
    6. "avatar_url": "https://cloud.seafile.com/media/avatars/groups/default.png",
    7. "id": 772
    8. }

    Rename a Group" class="reference-link">Rename a Group

    PUT https://cloud.seafile.com/api/v2.1/groups/772/

    Request parameters

    • name (name of new group)

    Sample request

    1. curl -X PUT -d "name=rename_group_name" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/772/

    Sample response

    1. {
    2. "name": "rename_group_name",
    3. "owner": "lian@lian.com",
    4. "created_at": "2015-12-17T10:29:57+0800",
    5. "admins": ["lian@lian.com"],
    6. "avatar_url": "https://cloud.seafile.com/media/avatars/groups/default.png",
    7. "id": 772
    8. }

    Transfer a Group" class="reference-link"> Transfer a Group

    PUT https://cloud.seafile.com/api/v2.1/groups/772/

    Request parameters

    • owner (new owner of this group, should be an email.)

    Sample request

    1. curl -X PUT -d "owner=new_owner@new_owner.com" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/772/

    Sample response

    1. {
    2. "name": "rename_group_name",
    3. "owner": "new_owner@new_owner.com",
    4. "created_at": "2015-12-17T10:29:57+0800",
    5. "admins": ["lian@lian.com", "new_owner@new_owner.com"],
    6. "avatar_url": "https://cloud.seafile.com/media/avatars/groups/default.png",
    7. "id": 772
    8. }

    Delete a Group" class="reference-link"> Delete a Group

    DELETE https://cloud.seafile.com/api/v2.1/groups/772/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/772/

    Sample response

    1. {"success":true}

    Quit Group" class="reference-link"> Quit Group

    DELETE myself@email.com/"">https://cloud.seafile.com/api/v2.1/groups/770/members/myself@email.com/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/myself@email.com/

    Sample response

    1. {"success":true}

    Group Member" class="reference-link">Group Member

    List All Group Members" class="reference-link">List All Group Members

    GET https://cloud.seafile.com/api/v2.1/groups/770/members/

    Request parameters

    • avatar_size
    • is_admin (true or false, if ONLY return admin members of group. default false return all members)

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api/v2.1/groups/770/members/"

    Sample response

    1. [
    2. {
    3. "login_id": "",
    4. "name": "nickname-of-lian",
    5. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    6. "is_admin": true,
    7. "contact_email": "lian_contact@email.com",
    8. "email": "lian@lian.com"
    9. },
    10. {
    11. "login_id": "",
    12. "name": "1",
    13. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    14. "is_admin": false,
    15. "contact_email": "1@1.com",
    16. "email": "1@1.com"
    17. }
    18. ]

    Add a Group Member" class="reference-link">Add a Group Member

    POST https://cloud.seafile.com/api/v2.1/groups/770/members/

    Request parameters

    • email

    Sample request

    1. curl -d "email=new-member@email.com" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/

    Sample response

    1. {
    2. "login_id": "",
    3. "name": "new-member",
    4. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    5. "is_admin": false,
    6. "contact_email": "new-member@email.com",
    7. "email": "new-member@email.com"
    8. }

    Bulk Add Group Members" class="reference-link">Bulk Add Group Members

    POST https://cloud.seafile.com/api/v2.1/groups/770/members/bulk/

    Request parameters

    • emails

    Sample request

    1. curl -d "emails=new-member-1@email.com,new-member-2@email.com,new-member-3@email.com" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/bulk/

    Sample response

    1. {
    2. "failed":[
    3. {
    4. "error_msg": "Invalid email",
    5. "email": "new-member-3@email.com"
    6. },
    7. {
    8. "error_msg": "Is already group member",
    9. "email": "new-member-4@email.com"
    10. }
    11. "success":[
    12. {
    13. "login_id": "",
    14. "name": "new-member-1",
    15. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    16. "is_admin": false,
    17. "contact_email": "new-member-1@email.com",
    18. "email": "new-member-1@email.com"
    19. },
    20. {
    21. "login_id": "",
    22. "name": "new-member-2",
    23. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    24. "is_admin": false,
    25. "contact_email": "new-member-2@email.com",
    26. "email": "new-member-2@email.com"
    27. }
    28. ]
    29. }

    Get Info of a Group Member" class="reference-link">Get Info of a Group Member

    GET member@email.com/"">https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Sample request

    1. curl -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Request parameters

    • avatar_size

    Sample response

    1. {
    2. "login_id": "",
    3. "name": "group-member",
    4. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    5. "is_admin": false,
    6. "contact_email": "group-member@email.com",
    7. "email": "group-member@email.com"
    8. }

    Set a Group Member Admin" class="reference-link">Set a Group Member Admin

    PUT member@email.com/"">https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Request parameters

    • is_admin=true

    Sample request

    1. curl -X PUT -d "is_admin=true" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Sample response

    1. {
    2. "login_id": "",
    3. "name": "group-member",
    4. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    5. "is_admin": true,
    6. "contact_email": "group-member@email.com",
    7. "email": "group-member@email.com"
    8. }

    Unset a Group Member Admin" class="reference-link">Unset a Group Member Admin

    PUT member@email.com/"">https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Request parameters

    • is_admin=false

    Sample request

    1. curl -X PUT -d "is_admin=false" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Sample response

    1. {
    2. "login_id": "",
    3. "name": "group-member",
    4. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    5. "is_admin": false,
    6. "contact_email": "group-member@email.com",
    7. "email": "group-member@email.com"
    8. }

    Delete a Group Member" class="reference-link"> Delete a Group Member

    DELETE member@email.com/"">https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/groups/770/members/group-member@email.com/

    Sample response

    1. {"success":true}

    Group Message" class="reference-link">Group Message

    Get Group Messages" class="reference-link">Get Group Messages

    GET https://cloud.seafile.com/api2/groups/{group_id}/discussions/

    Request parameters

    • group_id
    • page (default 1)
    • per_page (default 20)
    • avatar_size (default 80)

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/772/discussions/"

    Sample response

    1. {'current_page': 1,
    2. 'msgs': [{'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    3. 'content': u'test',
    4. 'created_at': '2016-07-11T09:18:20+08:00',
    5. 'group_id': 772,
    6. 'id': 1,
    7. 'user_email': u'lian@lian.com',
    8. 'user_login_id': '',
    9. 'user_name': u'name-of-lian'}],
    10. 'page_num': 1}

    Send A Group Message" class="reference-link">Send A Group Message

    POST https://cloud.seafile.com/api2/groups/{group_id}/discussions/

    Request parameters

    • group_id
    • content
    • avatar_size (default 80)

    Sample request

    1. curl -d "content=this is another test" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/772/discussions/"

    Sample response

    1. {'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    2. 'content': u'this is another test',
    3. 'created_at': '2016-07-11T09:27:49+08:00',
    4. 'group_id': 772,
    5. 'id': 3,
    6. 'user_email': u'lian@lian.com',
    7. 'user_login_id': '',
    8. 'user_name': u'name-of-lian'}

    Delete A Group Message" class="reference-link">Delete A Group Message

    DELETE https://cloud.seafile.com/api2/groups/772/discussions/3/

    Request parameters

    • group_id
    • discuss_id

    Sample request

    1. curl -v -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/772/discussions/3/"

    sample response

    1. ...
    2. < http/1.0 204 no content
    3. ...

    Errors

    • 400 Discussion id not found.
    • 403 Permission denied.

    Group Owned Libraries" class="reference-link">Group Owned Libraries

    Add Group Owned Library" class="reference-link">Add Group Owned Library

    POST http://192.168.1.113:8000/api/v2.1/groups/{group_id}/group-owned-libraries/

    Request parameters

    • group_id
    • repo_name
    • password
    • permission, default rw.

    Sample request

    1. curl -d "repo_name=group-owned-repo-4&permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/groups/53/group-owned-libraries/"

    sample response

    1. {
    2. "repo_id": "9bc59af9-265e-4110-a0e2-619450a5cb35",
    3. "permission": "r",
    4. "encrypted": false,
    5. "owner_email": "53@seafile_group",
    6. "mtime": "2018-04-23T17:25:37+08:00",
    7. "repo_name": "group-owned-repo-4",
    8. "size": 0
    9. }

    Errors

    • 400 repo_name/permission invalid.
    • 403 NOT allow to create encrypted library..
    • 403 Permission denied.
    • 403 No group quota.
    • 404 Group not found.

    Delete Group Owned Library" class="reference-link">Delete Group Owned Library

    DELETE http://192.168.1.113:8000/api/v2.1/groups/{group_id}/group-owned-libraries/{repo_id}/

    Request parameters

    • group_id
    • repo_id

    Sample request

    1. curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/groups/53/group-owned-libraries/9bc59af9-265e-4110-a0e2-619450a5cb35/"

    sample response

    1. {"success":true}

    Errors

    • 403 Permission denied.
    • 404 Group/Library not found.
    • 500 Internal Server Error

    Get Group Owned Library User Share Info" class="reference-link">Get Group Owned Library User Share Info

    GET http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

    Request parameters

    • repo_id

    Sample request

    1. curl -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

    sample response

    1. [
    2. {
    3. "permission": "rw",
    4. "user_name": "1",
    5. "user_email": "1@1.com",
    6. "user_contact_email": "1@1.com"
    7. },
    8. {
    9. "permission": "rw",
    10. "user_name": "1",
    11. "user_email": "1@111.com",
    12. "user_contact_email": "1@111.com"
    13. },
    14. {
    15. "permission": "rw",
    16. "user_name": "10",
    17. "user_email": "10@10.com",
    18. "user_contact_email": "10@10.com"
    19. }
    20. ]

    Errors

    • 403 Permission denied.
    • 404 Group/Library not found.

    Share Group Owned Library to User" class="reference-link">Share Group Owned Library to User

    POST http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

    Request parameters

    • repo_id
    • permission, r or rw.
    • username

    Sample request

    1. curl -d "permission=r&username=1@1.com&username=2@1.com" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

    sample response

    1. {
    2. "failed": [
    3. {
    4. "email": "2@1.com",
    5. "error_msg": "User 2@1.com not found."
    6. }
    7. ],
    8. "success": [
    9. {
    10. "permission": "r",
    11. "user_name": "1",
    12. "user_email": "1@1.com",
    13. "user_contact_email": "1@1.com"
    14. }
    15. ]
    16. }

    Errors

    • 400 permission invalid.
    • 403 Permission denied.
    • 404 Group/Library not found.

    Modify Group Owned Library User Share Permission" class="reference-link">Modify Group Owned Library User Share Permission

    PUT http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

    Request parameters

    • repo_id
    • permission, r or rw.
    • username

    Sample request

    1. curl -X PUT -d "permission=rw&username=1@1.com" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

    sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 permission invalid.
    • 403 Permission denied.
    • 404 Group/Library not found.

    Delete Group Owned Library User Share" class="reference-link">Delete Group Owned Library User Share

    DELETE http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/user-share/

    Request parameters

    • repo_id
    • username

    Sample request

    1. curl -X DELETE -d "username=1@1.com" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/user-share/"

    sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 403 Permission denied.
    • 404 Group/Library not found.

    Get Group Owned Library Group Share Info" class="reference-link">Get Group Owned Library Group Share Info

    GET http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

    Request parameters

    • repo_id

    Sample request

    1. curl -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

    sample response

    1. [
    2. {
    3. "permission": "r",
    4. "group_id": 71,
    5. "group_name": "asd"
    6. },
    7. {
    8. "permission": "r",
    9. "group_id": 70,
    10. "group_name": "group-of-lian"
    11. }
    12. ]

    Errors

    • 403 Permission denied.
    • 404 Group/Library not found.

    Share Group Owned Library to Group" class="reference-link">Share Group Owned Library to Group

    POST http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

    Request parameters

    • repo_id
    • permission, r or rw.
    • group_id

    Sample request

    1. curl -d "permission=r&group_id=89&group_id=71&group_id=70" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

    sample response

    1. {
    2. "failed": [
    3. {
    4. "error_msg": "Group 89 not found"
    5. },
    6. {
    7. "error_msg": "This item has been shared to asd.",
    8. "group_name": "asd"
    9. }
    10. ],
    11. "success": [
    12. {
    13. "permission": "r",
    14. "group_id": 70,
    15. "group_name": "group-of-lian"
    16. }
    17. ]
    18. }

    Errors

    • 400 permission invalid.
    • 403 Permission denied.
    • 404 Group/Library not found.

    Modify Group Owned Library Group Share Permission" class="reference-link">Modify Group Owned Library Group Share Permission

    PUT http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

    Request parameters

    • repo_id
    • permission, r or rw.
    • group_id

    Sample request

    1. curl -X PUT -d "permission=rw&group_id=70" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

    sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 permission invalid.
    • 403 Permission denied.
    • 404 Group/Library not found.

    Delete Group Owned Library Group Share" class="reference-link">Delete Group Owned Library Group Share

    DELETE http://192.168.1.113:8000/api/v2.1/group-owned-libraries/{repo_id}/group-share/

    Request parameters

    • repo_id
    • group_id

    Sample request

    1. curl -X DELETE -d "group_id=71" -H 'Authorization: Token 5eba8c2f983404e33b140b13a1d050b9a4440e03' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/group-owned-libraries/4902dcc7-29be-4020-81e9-4e512f97db1e/group-share/"

    sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 403 Permission denied.
    • 404 Group/Library not found.

    Modify Group Owned Library Sub-Folder Permission" class="reference-link">Modify Group Owned Library Sub-Folder Permission

    PUT http://192.168.1.113:8000/api/v2.1/groups/{group_id}/group-owned-libraries/{repo_id}/

    Request parameters

    • group_id
    • repo_id
    • path, path of sub folder.
    • permission: r or rw.

    Sample request

    1. curl -X PUT -d "path=/tmp/&permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/groups/53/group-owned-libraries/9bc59af9-265e-4110-a0e2-619450a5cb35/"

    sample response

    1. {"success":true}

    Errors

    • 400 path/permission invalid.
    • 403 Permission denied.
    • 404 Group/Library/Folder not found.
    • 500 Internal Server Error

    Share" class="reference-link">Share

    This api will list all folder/file download share links in all libraries created by user.

    GET https://cloud.seafile.com/api/v2.1/share-links/

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/share-links/"

    Sample response

    1. [
    2. {
    3. "username": "lian@lian.com",
    4. "repo_id": "c474a093-19dc-4ddf-b0b0-72b33214ba33",
    5. "ctime": "2017-04-01T02:35:57+00:00",
    6. "expire_date": "",
    7. "token": "6afa667ff2c248378b70",
    8. "view_cnt": 0,
    9. "link": "https://cloud.seafile.com/d/6afa667ff2c248378b70/",
    10. "obj_name": "/",
    11. "path": "/",
    12. "is_dir": true,
    13. "is_expired": false,
    14. "repo_name": "seacloud.cc.124"
    15. },
    16. {
    17. "username": "lian@lian.com",
    18. "repo_id": "104f6537-b3a5-4d42-b8b5-8e47e494e4cf",
    19. "ctime": "2017-04-01T02:35:29+00:00",
    20. "expire_date": "",
    21. "token": "0c4eb0cb104a43caaeef",
    22. "view_cnt": 0,
    23. "link": "https://cloud.seafile.com/d/0c4eb0cb104a43caaeef/",
    24. "obj_name": "folder",
    25. "path": "/folder/",
    26. "is_dir": true,
    27. "is_expired": false,
    28. "repo_name": "for-test-web-api"
    29. },
    30. {
    31. "username": "lian@lian.com",
    32. "repo_id": "104f6537-b3a5-4d42-b8b5-8e47e494e4cf",
    33. "ctime": "2017-04-01T02:35:35+00:00",
    34. "expire_date": "",
    35. "token": "8c05a00c44db4764b3a5",
    36. "view_cnt": 0,
    37. "link": "https://cloud.seafile.com/f/8c05a00c44db4764b3a5/",
    38. "obj_name": "tmp.md",
    39. "path": "/tmp.md",
    40. "is_dir": false,
    41. "is_expired": false,
    42. "repo_name": "for-test-web-api"
    43. }
    44. ]

    Errors

    • 403 Permission denied.
    • 500 Internal Server Error

    This api will list all folder/file download share links in a specific library.

    GET https://cloud.seafile.com/api/v2.1/share-links/?repo_id={repo_id}

    Request parameters

    • repo-id

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/share-links/?repo_id=104f6537-b3a5-4d42-b8b5-8e47e494e4cf"

    Sample response

    1. [
    2. {
    3. "username": "lian@lian.com",
    4. "repo_id": "104f6537-b3a5-4d42-b8b5-8e47e494e4cf",
    5. "ctime": "2017-04-01T02:35:29+00:00",
    6. "expire_date": "",
    7. "token": "0c4eb0cb104a43caaeef",
    8. "view_cnt": 0,
    9. "link": "https://cloud.seafile.com/d/0c4eb0cb104a43caaeef/",
    10. "obj_name": "folder",
    11. "path": "/folder/",
    12. "is_dir": true,
    13. "is_expired": false,
    14. "repo_name": "for-test-web-api"
    15. },
    16. {
    17. "username": "lian@lian.com",
    18. "repo_id": "104f6537-b3a5-4d42-b8b5-8e47e494e4cf",
    19. "ctime": "2017-04-01T02:35:35+00:00",
    20. "expire_date": "",
    21. "token": "8c05a00c44db4764b3a5",
    22. "view_cnt": 0,
    23. "link": "https://cloud.seafile.com/f/8c05a00c44db4764b3a5/",
    24. "obj_name": "tmp.md",
    25. "path": "/tmp.md",
    26. "is_dir": false,
    27. "is_expired": false,
    28. "repo_name": "for-test-web-api"
    29. }
    30. ]

    Errors

    • 403 Permission denied.
    • 404 library not found.
    • 500 Internal Server Error

    This api will list download share link info of a specific folder/file.

    GET https://cloud.seafile.com/api/v2.1/share-links/?repo_id={rpeo_id}&path={path}

    Request parameters

    • repo-id
    • path, could be path of a foler or a file.

    Sample request

    Get folder download share link.

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/share-links/?repo_id=104f6537-b3a5-4d42-b8b5-8e47e494e4cf&path=/folder/"

    Sample response

    1. [
    2. {
    3. "username": "lian@lian.com",
    4. "repo_id": "104f6537-b3a5-4d42-b8b5-8e47e494e4cf",
    5. "ctime": "2017-04-01T02:35:29+00:00",
    6. "expire_date": "",
    7. "token": "0c4eb0cb104a43caaeef",
    8. "view_cnt": 0,
    9. "link": "https://cloud.seafile.com/d/0c4eb0cb104a43caaeef/",
    10. "obj_name": "folder",
    11. "path": "/folder/",
    12. "is_dir": true,
    13. "is_expired": false,
    14. "repo_name": "for-test-web-api"
    15. }
    16. ]

    or a empty list [] if this folder has no download share link.

    Get file download share link.

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/share-links/?repo_id=104f6537-b3a5-4d42-b8b5-8e47e494e4cf&path=/tmp.md"

    Sample response

    1. [
    2. {
    3. "username": "lian@lian.com",
    4. "repo_id": "104f6537-b3a5-4d42-b8b5-8e47e494e4cf",
    5. "ctime": "2017-04-01T02:35:35+00:00",
    6. "expire_date": "",
    7. "token": "8c05a00c44db4764b3a5",
    8. "view_cnt": 0,
    9. "link": "https://cloud.seafile.com/f/8c05a00c44db4764b3a5/",
    10. "obj_name": "tmp.md",
    11. "path": "/tmp.md",
    12. "is_dir": false,
    13. "is_expired": false,
    14. "repo_name": "for-test-web-api"
    15. }
    16. ]

    or a empty list [] if this file has no download share link.

    Errors

    • 403 Permission denied.
    • 404 folder/library not found.
    • 500 Internal Server Error

    POST https://cloud.seafile.com/api/v2.1/share-links/

    Request parameters

    • repo-id
    • path (file/folder path)
    • password (not necessary)
    • expire_days (not necessary)

    Sample request

    Create download link for file

    1. curl -d "path=/foo.md&repo_id=62ca6cf9-dab6-47e5-badc-bab13d9220ce" -H 'Authorization: Token ef12bf1e66a1aa797a1d6556fdc9ae84f1e9249f' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/share-links/

    Create download link for directory with password and expire date

    1. curl -d "path=/bar/&repo_id=62ca6cf9-dab6-47e5-badc-bab13d9220ce&password=password&expire_days=6" -H 'Authorization: Token ef12bf1e66a1aa797a1d6556fdc9ae84f1e9249f' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/share-links/

    Sample response

    1. {
    2. "username": "lian@lian.com",
    3. "view_cnt": 0,
    4. "ctime": "2016-03-04T04:06:35.477",
    5. "token": "409f5aa54a",
    6. "repo_id": "62ca6cf9-dab6-47e5-badc-bab13d9220ce",
    7. "link": "https://cloud.seafile.com/f/409f5aa54a/",
    8. "expire_date": null,
    9. "path": "/foo.md",
    10. "is_expired": false
    11. }
    1. {
    2. "username": "lian@lian.com",
    3. "view_cnt": 0,
    4. "ctime": "2016-03-04T04:12:48.959",
    5. "token": "db1a50e686",
    6. "repo_id": "62ca6cf9-dab6-47e5-badc-bab13d9220ce",
    7. "link": "https://cloud.seafile.com/d/db1a50e686/",
    8. "expire_date": null,
    9. "path": "/bar/",
    10. "is_expired": false
    11. }

    Errors

    • 400 path/repo_id invalid
    • 403 Permission denied.
    • 404 file/folder/library not found.
    • 500 Internal Server Error

    DELETE https://cloud.seafile.com/api/v2.1/share-links/{token}/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api/v2.1/share-links/0ae587a7d1/"

    Sample response

    1. {"success":true}

    POST https://cloud.seafile.com/api2/send-share-link/

    Request parameters

    • token
    • email
    • extra_msg (not necessary)

    Sample request

    1. curl -d "email=sample@eamil.com,invalid-email&token=4cbd625c5e" -H 'Authorization: Token ef12bf1e66a1aa797a1d6556fdc9ae84f1e9249f' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/send-share-link/

    Sample response

    1. {
    2. "failed": [
    3. {
    4. "email": "invalid-email",
    5. "error_msg": "email invalid."
    6. }
    7. ],
    8. "success": [
    9. "sample@eamil.com"
    10. ]
    11. }

    Errors

    • 400 token/repo_id invalid
    • 403 Permission denied.
    • 403 Sending shared link failed. Email service is not properly configured, please contact administrator.
    • 404 token/library not found

    GET https://cloud.seafile.com/api2/d/{token}/dir/

    Request parameters

    • token (upload link token)
    • p (sub folder path)
    • password (if link is encrypted)

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/d/3af7c46595/dir/?p=/subfolder/"

    Sample response

    1. [{"mtime": 1436846750, "type": "dir", "name": "sadof", "id": "1806dbdb700b7bcd49e6275107c7ccf7b3ea1776"}, {"id": "bdb06f6de972c42893fda590ac954988b562429c", "mtime": 1436431020, "type": "file", "name": "test.mdert", "size": 20}]

    GET https://cloud.seafile.com/api/v2.1/upload-links/

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api/v2.1/upload-links/"

    Sample response

    1. [{"username":"lian@lian.com","repo_id":"62ca6cf9-dab6-47e5-badc-bab13d9220ce","ctime":"2016-03-03T15:26:15.223","token":"9a5d5c8391","link":"https://cloud.seafile.com/u/d/9a5d5c8391/","path":"/"},{"username":"lian@lian.com","repo_id":"78c620ee-2989-4427-8eff-7748f4fbebc0","ctime":"2016-03-04T05:37:17.968","token":"d17d87ea4d","link":"https://cloud.seafile.com/u/d/d17d87ea4d/","path":"/yutong/"}]

    POST https://cloud.seafile.com/api/v2.1/upload-links/

    Request parameters

    • repo-id
    • path (file/folder path)
    • password (not necessary)

    Sample request

    Create upload link for directory with password

    1. curl -d "path=/bar/&repo_id=afc3b694-7d4c-4b8a-86a4-89c9f3261b12&password=password" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/upload-links/

    Sample response

    1. {
    2. "username": "lian@lian.com",
    3. "repo_id": "62ca6cf9-dab6-47e5-badc-bab13d9220ce",
    4. "ctime": "2016-03-04T05:51:34.022",
    5. "token": "dce40e8594",
    6. "link": "https://cloud.seafile.com/u/d/dce40e8594/",
    7. "path": "/bar/"
    8. }

    Errors

    • 400 path/repo_id invalid
    • 403 Permission denied.
    • 500 Internal Server Error

    DELETE https://cloud.seafile.com/api/v2.1/upload-links/{token}/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api/v2.1/upload-links/0ae587a7d1/"

    Sample response

    1. {"success":true}

    POST https://cloud.seafile.com/api2/send-upload-link/

    Request parameters

    • token
    • email
    • extra_msg (not necessary)

    Sample request

    1. curl -d "email=sample@eamil.com,invalid-email&token=4cbd625c5e" -H 'Authorization: Token ef12bf1e66a1aa797a1d6556fdc9ae84f1e9249f' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/send-upload-link/

    Sample response

    1. {
    2. "failed": [
    3. {
    4. "email": "invalid-email",
    5. "error_msg": "email invalid."
    6. }
    7. ],
    8. "success": [
    9. "sample@eamil.com"
    10. ]
    11. }
    • 400 token/repo_id invalid
    • 403 Permission denied.
    • 403 Sending shared link failed. Email service is not properly configured, please contact administrator.
    • 404 token/library not found

    Shared Libraries" class="reference-link">Shared Libraries

    List User Shared Libraries" class="reference-link">List User Shared Libraries

    GET https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/&share_type=user

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, user

    Sample request

    1. curl -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/&share_type=user

    Sample response

    1. [
    2. {"user_info": {"nickname": "5", "name": "5@1.com"}, "share_type": "user", "permission": "r"},
    3. {"user_info": {"nickname": "name of 4", "name": "4@1.com"}, "share_type": "user", "permission": "r"}
    4. ]

    Errors

    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.

    List Group Shared Libraries" class="reference-link">List Group Shared Libraries

    GET https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/&share_type=group

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, group

    Sample request

    1. curl -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/&share_type=group

    Sample response

    1. [
    2. {"group_info": {"id": 65, "name": "group"}, "share_type": "group", "permission": "r"},
    3. {"group_info": {"id": 395, "name": "lsd"}, "share_type": "group", "permission": "rw"}
    4. ]

    Errors

    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.

    List Be Shared Libraries" class="reference-link">List Be Shared Libraries

    GET https://cloud.seafile.com/api2/beshared-repos/

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/beshared-repos/"

    Sample response

    1. "[{"user": "user@example.com", "repo_id": "989e3952-9d6f-4427-ab16-4bf9b53212eb", "share_type": "personal", "permission": "rw", "encrypted": false, "repo_desc": "lib shared to imwhatiam", "enc_version": false, "last_modified": 1398218747, "is_virtual": false, "group_id": 0, "repo_name": "lib shared to imwhatiam"}]"

    Delete Be Shared Library" class="reference-link">Delete Be Shared Library

    DELETE from_user@name.com"">https://cloud.seafile.com/api2/beshared-repos/{repo_id}/?share_type=personal&from=from_user@name.com

    Sample request

    1. curl -X DELETE -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/beshared-repos/{repo_id}/?share_type=personal&from=from_user@name.com

    Sample response

    1. {"success": true}

    Errors

    • 400 Invalid argument
    • 400 Library does not exist

    Share a Library to User" class="reference-link">Share a Library to User

    PUT https://cloud.seafile.com/api2/repos/{repo_id}/dir/shared_items/?p=/

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, user
    • username, a email string or a list contains multi emails
    • permission, r, rw or admin, default r.

    Sample request

    1. curl -X PUT -d "share_type=user&username=4@1.com&username=5@1.com&username=invalid@email.com&permission=r" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/

    Sample response

    1. {
    2. "failed": [
    3. {"email": "invalid@email.com", "error_msg": "User invalid@email.com not found."}
    4. ],
    5. "success": [
    6. {"user_info": {"nickname": "name of 4", "name": "4@1.com"}, "share_type": "user", "permission": "r"},
    7. {"user_info": {"nickname": "5", "name": "5@1.com"}, "share_type": "user", "permission": "r"}
    8. ]
    9. }

    Errors

    • 400 permission invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.

    Unshare a Library from User" class="reference-link">Unshare a Library from User

    DELETE 5@1.com"">https://cloud.seafile.com/api2/repos/{repo_id}/dir/shared_items/?p=/&share_type=user&username=5@1.com

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, user
    • username, a email string

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/&share_type=user&username=5@1.com"

    Sample response

    1. {"success": true}

    Errors

    • 400 share_type invalid.
    • 400 email invalid.
    • 403 Permission denied.
    • 404 Library not found.

    Update Permission of User Shared Library" class="reference-link">Update Permission of User Shared Library

    POST 5@1.com"">https://cloud.seafile.com/api2/repos/{repo_id}/dir/shared_items/?p=/&share_type=user&username=5@1.com

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, user
    • username, a email string
    • permisson, r or rw

    Sample request

    1. curl -d "permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' "https://cloud.seafile.com/api2/repos/2deffbac-d7be-4ace-b406-efb799083ee9/dir/shared_items/?p=/&share_type=user&username=5@1.com"

    Sample response

    1. {"success": true}

    Errors

    • 400 share_type invalid.
    • 403 permission invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.

    Share a Library to Group" class="reference-link">Share a Library to Group

    PUT https://cloud.seafile.com/api2/repos/{repo_id}/dir/shared_items/?p=/

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, group
    • group_id , an integer or a list contains multi integers
    • permission, r, rw or admin, default r.

    Sample request

    1. curl -X PUT -d "share_type=group&group_id=65&group_id=395&group_id=invalid_group_id&group_id=111&permission=rw" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/

    Sample response

    1. {
    2. "failed": [],
    3. "success": [
    4. {"group_info": {"id": 65, "name": "group"}, "share_type": "group", "permission": "rw"},
    5. {"group_info": {"id": 395, "name": "lsd"}, "share_type": "group", "permission": "rw"}
    6. ]
    7. }

    Errors

    • 400 permission invalid.
    • 400 group_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.

    Unshare a Library from Group" class="reference-link">Unshare a Library from Group

    DELETE https://cloud.seafile.com/api2/repos/{repo_id}/dir/shared_items/?p=/&share_type=group&group=65

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, group
    • group_id , an integer

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/shared_items/?p=/&share_type=group&group_id=65"

    Sample response

    1. {"success": true}

    Errors

    • 400 share_type invalid.
    • 400 group_id invalid.
    • 403 Permission denied.
    • 404 Library not found.

    Update Permission of Group Shared Library" class="reference-link">Update Permission of Group Shared Library

    POST https://cloud.seafile.com/api2/repos/{repo_id}/dir/shared_items/?p=/&share_type=group&group_id=65

    Request parameters

    • p, / means the root folder, which is equivalent to the library.
    • share_type, group
    • group_id , an integer
    • permisson, r or rw

    Sample request

    1. curl -d "permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' "https://cloud.seafile.com/api2/repos/2deffbac-d7be-4ace-b406-efb799083ee9/dir/shared_items/?p=/&share_type=group&group_id=65"

    Sample response

    1. {"success": true}

    Errors

    • 400 share_type invalid.
    • 403 permission invalid.
    • 403 Permission denied.
    • 404 Library not found.

    Batch Share Libraries to User" class="reference-link">Batch Share Libraries to User

    POST https://cloud.seafile.com/api/v2.1/repos/batch/

    Request parameters

    • operation, share
    • share_type, user
    • username, email of a user
    • permission, default is rw
    • repo_id

    Sample request

    1. curl -d "operation=share&share_type=user&username=2@org.com&repo_id=b6cfa05d-07af-422b-924e-45202dc1cbb5&repo_id=48aa475d-deb0-40f0-ab9b-22ec84989a58" -H 'Authorization: Token 40c89d06a2beeec672d091156de4cc163c6aa31a' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api/v2.1/repos/batch/

    Sample response

    1. {
    2. "failed": [
    3. {"repo_id": "3761ade3-100b-4c3b-9508-79b3a510e6f6", "error_msg": "This item has been shared to 1@1.com."}
    4. ],
    5. "success": [
    6. {"username": "1@1.com", "repo_id": "f820bd12-0511-4542-b14b-3e48d8efc294", "permission": "rw"}
    7. ]
    8. }

    Errors

    • 400 permission invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 User not found.
    • 500 Internal Server Error

    Batch Share Libraries to Group" class="reference-link">Batch Share Libraries to Group

    POST https://cloud.seafile.com/api/v2.1/repos/batch/

    Request parameters

    • operation, share
    • share_type, group
    • group_id
    • permission, default is rw
    • repo_id

    Sample request

    1. curl -d "operation=share&share_type=group&group_id=540&repo_id=b6cfa05d-07af-422b-924e-45202dc1cbb5&repo_id=48aa475d-deb0-40f0-ab9b-22ec84989a58" -H 'Authorization: Token 40c89d06a2beeec672d091156de4cc163c6aa31a' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api/v2.1/repos/batch/

    Sample response

    1. {
    2. "failed": [
    3. {"repo_id": "f820bd12-0511-4542-b14b-3e48d8efc294", "error_msg": "This item has been shared to group-of-lian."}
    4. ],
    5. "success": [
    6. {"permission": "rw", "repo_id": "3761ade3-100b-4c3b-9508-79b3a510e6f6", "group_id": 65, "group_name": "group-of-lian"}
    7. ]
    8. }

    Errors

    • 400 permission invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Group not found.
    • 500 Internal Server Error

    Shared Folders" class="reference-link">Shared Folders

    Share A Folder" class="reference-link">Share A Folder

    PUT https://cloud.seafile.com/api2/repos/{repo-id}/dir/shared_items/?p={path}

    • repo-id
    • path
    • permission, r or rw
    • share_type, user or group
    • username, necessary if share_type is user
    • group_id, necessary if share_type is group

    Sample request for share folder to user

    1. curl -X PUT -d "username=2@1.com&share_type=user&permission=r" -H 'Authorization: Token ef12bf1e66a1aa797a1d6556fdc9ae84f1e9249f' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/78c620ee-2989-4427-8eff-7748f4fbebc0/dir/shared_items/?p=/q

    Sample response for share folder to user

    1. {"failed": [], "success": [{"user_info": {"nickname": "2", "name": "2@1.com"}, "share_type": "user", "permission": "r"}]}

    Sample request for share folder to group

    1. curl -X PUT -d "group_id=772&share_type=group&permission=rw" -H 'Authorization: Token ef12bf1e66a1aa797a1d6556fdc9ae84f1e9249f' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/78c620ee-2989-4427-8eff-7748f4fbebc0/dir/shared_items/?p=/q

    Sample response for share folder to group

    1. {"failed": [], "success": [{"group_info": {"id": 772, "name": "group-2"}, "share_type": "group", "permission": "rw"}]}

    Errors

    • 400 share_type/permission/group_id invalid.
    • 403 Permission denied.
    • 404 Library/Folder/Group not found.
    • 500 Failed to get sub repo.

    List Shared Folders" class="reference-link">List Shared Folders

    GET https://cloud.seafile.com/api/v2.1/shared-folders/

    Sample request

    1. curl -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/shared-folders/

    Sample response

    1. [
    2. {
    3. "share_permission": "rw",
    4. "repo_id": "2deffbac-d7be-4ace-b406-efb799083ee9",
    5. "share_type": "personal",
    6. "folder_name": "asd",
    7. "path": "/asd",
    8. "user_name": "1",
    9. "contact_email": "contact@email.com",
    10. "user_email": "1@1.com"
    11. },
    12. {
    13. "share_permission": "r",
    14. "repo_id": "2deffbac-d7be-4ace-b406-efb799083ee9",
    15. "share_type": "group",
    16. "group_name": "test_group",
    17. "folder_name": "asd",
    18. "path": "/asd",
    19. "group_id": 1448
    20. }
    21. ]

    Errors

    • 500 Internal Server Error

    Update Shared Folder Permission" class="reference-link">Update Shared Folder Permission

    POST 1@1.com"">https://cloud.seafile.com/api2/repos/2deffbac-d7be-4ace-b406-efb799083ee9/dir/shared_items/?p=/asd&share_type=user&username=1@1.com

    Sample request

    1. curl -d "permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/2deffbac-d7be-4ace-b406-efb799083ee9/dir/shared_items/?p=/asd&share_type=user&username=1@1.com

    Sample response

    1. {"success":true}

    Errors

    • 400 permission invalid.
    • 400 Email invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Unshare A Folder" class="reference-link">Unshare A Folder

    POST https://cloud.seafile.com/api2/repos/2deffbac-d7be-4ace-b406-efb799083ee9/dir/shared_items/?p=/asd&share_type=group&group_id=1448

    Sample request

    1. curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/2deffbac-d7be-4ace-b406-efb799083ee9/dir/shared_items/?p=/asd&share_type=group&group_id=1448

    Sample response

    1. {"success":true}

    Errors

    • 400 Email invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Folder Permission" class="reference-link">Folder Permission

    User Folder Permission" class="reference-link">User Folder Permission

    Get User Folder Permission" class="reference-link">Get User Folder Permission

    GET http://192.168.1.124:8000/api2/repos/{repo_id}/user-folder-perm/?folder_path=/123

    Request parameters

    • repo_id
    • folder_path

    Sample request

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/?folder_path=/123"

    Sample response

    1. [
    2. {
    3. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    4. "folder_path": "/123",
    5. "permission": "r",
    6. "folder_name": "123",
    7. "user_name": "1",
    8. "user_email": "1@1.com"
    9. },
    10. {
    11. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    12. "folder_path": "/123",
    13. "permission": "rw",
    14. "folder_name": "123",
    15. "user_name": "2",
    16. "user_email": "2@1.com"
    17. }
    18. ]

    Errors

    • 403 Permission denied.
    • 404 Library not found.

    Set User Folder Permission" class="reference-link">Set User Folder Permission

    POST http://192.168.1.124:8000/api2/repos/{repo_id}/user-folder-perm/

    Request parameters

    • repo_id
    • folder_path
    • user_email
    • permission, r or rw

    Sample request

    1. curl -d "folder_path=/123&permission=rw&user_email=3@1.com&user_email=2@1.com" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/"

    Sample response

    1. {
    2. "failed": [
    3. {
    4. "error_msg": "Permission already exists.",
    5. "user_email": "2@1.com"
    6. }
    7. ],
    8. "success": [
    9. {
    10. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    11. "folder_path": "/123",
    12. "permission": "rw",
    13. "folder_name": "123",
    14. "user_name": "3",
    15. "user_email": "3@1.com"
    16. }
    17. ]
    18. }

    Errors

    • 400 folder_path invalid.
    • 400 permission invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.

    Modify User Folder Permission" class="reference-link">Modify User Folder Permission

    PUT http://192.168.1.124:8000/api2/repos/{repo_id}/user-folder-perm/

    Request parameters

    • repo_id
    • folder_path
    • user_email
    • permission, r or rw

    Sample request

    1. curl -X PUT -d "folder_path=/123&permission=r&user_email=3@1.com" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/"

    Sample response

    1. {
    2. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    3. "folder_path": "/123",
    4. "permission": "r",
    5. "folder_name": "123",
    6. "user_name": "3",
    7. "user_email": "3@1.com"
    8. }

    Errors

    • 400 folder_path invalid.
    • 400 permission invalid.
    • 400 user_email invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 404 User not found.
    • 404 Folder permission not found.
    • 500 Internal Server Error

    Delete User Folder Permission" class="reference-link">Delete User Folder Permission

    DELETE http://192.168.1.124:8000/api2/repos/{repo_id}/user-folder-perm/

    Request parameters

    • repo_id
    • folder_path
    • user_email

    Sample request

    1. curl -X DELETE -d "folder_path=/123&user_email=3@1.com" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/user-folder-perm/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 user_email invalid.
    • 400 folder_path invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 User not found.
    • 500 Internal Server Error

    Group Folder Permission" class="reference-link">Group Folder Permission

    Get Group Folder Permission" class="reference-link">Get Group Folder Permission

    GET http://192.168.1.124:8000/api2/repos/{repo_id}/group-folder-perm/?folder_path=/123

    Request parameters

    • repo_id
    • folder_path

    Sample request

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/?folder_path=/123"

    Sample response

    1. [
    2. {
    3. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    4. "folder_path": "/123",
    5. "permission": "rw",
    6. "group_name": "group-2-of-lian",
    7. "folder_name": "123",
    8. "group_id": 586
    9. },
    10. {
    11. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    12. "folder_path": "/123",
    13. "permission": "r",
    14. "group_name": "group-of-lian",
    15. "folder_name": "123",
    16. "group_id": 65
    17. }
    18. ]

    Errors

    • 403 Permission denied.
    • 404 Library not found.

    Set Group Folder Permission" class="reference-link">Set Group Folder Permission

    POST http://192.168.1.124:8000/api2/repos/{repo_id}/group-folder-perm/

    Request parameters

    • repo_id
    • folder_path
    • group_id
    • permission, r or rw

    Sample request

    1. curl -d "folder_path=/123&permission=rw&group_id=586&group_id=65" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/"

    Sample response

    1. {
    2. "failed": [
    3. {
    4. "group_id": 65,
    5. "error_msg": "Permission already exists."
    6. }
    7. ],
    8. "success": [
    9. {
    10. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    11. "folder_path": "/123",
    12. "permission": "rw",
    13. "group_name": "group-2-of-lian",
    14. "folder_name": "123",
    15. "group_id": 586
    16. }
    17. ]
    18. }

    Errors

    • 400 folder_path invalid.
    • 400 permission invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.

    Modify Group Folder Permission" class="reference-link">Modify Group Folder Permission

    PUT http://192.168.1.124:8000/api2/repos/{repo_id}/group-folder-perm/

    Request parameters

    • repo_id
    • folder_path
    • group_id
    • permission, r or rw

    Sample request

    1. curl -X PUT -d "folder_path=/123&permission=rw&group_id=65" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/"

    Sample response

    1. {
    2. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    3. "folder_path": "/123",
    4. "permission": "rw",
    5. "group_name": "group-of-lian",
    6. "folder_name": "123",
    7. "group_id": 65
    8. }

    Errors

    • 400 folder_path invalid.
    • 400 permission invalid.
    • 400 group_id invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 404 Group not found.
    • 404 Folder permission not found.
    • 500 Internal Server Error

    Delete Group Folder Permission" class="reference-link">Delete Group Folder Permission

    DELETE http://192.168.1.124:8000/api2/repos/{repo_id}/group-folder-perm/

    Request parameters

    • repo_id
    • folder_path
    • group_id

    Sample request

    1. curl -X DELETE -d "folder_path=/123&group_id=65" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/group-folder-perm/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 group_id invalid.
    • 400 folder_path invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Group not found.
    • 500 Internal Server Error

    Library" class="reference-link">Library

    Get Default Library" class="reference-link">Get Default Library

    GET https://cloud.seafile.com/api2/default-repo/

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/default-repo/"

    Sample response

    1. {
    2. "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e",
    3. "exists": true
    4. }

    Create Default Library" class="reference-link">Create Default Library

    POST https://cloud.seafile.com/api2/default-repo/

    Sample request

    1. curl -X POST -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/default-repo/"

    Sample response

    1. {
    2. "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e",
    3. "exists": true
    4. }

    List Libraries" class="reference-link">List Libraries

    GET https://cloud.seafile.com/api2/repos/?type={type}

    Request parameters

    • type
      • mine, get my owned libraries.
      • shared, get libraries shared to me.
      • group, get group libraries.
      • org, get public libraires.

    NOTE: If no type parameter contained in the url, this api will return all libraries user can access.

    Sample request for get all libraries I can accessed

    1. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/

    Sample response for get all libraries I can accessed

    1. [
    2. {
    3. "permission": "rw",
    4. "encrypted": false,
    5. "mtime_relative": "<time datetime=\"2017-08-12T10:48:42\" is=\"relative-time\" title=\"Sat, 12 Aug 2017 10:48:42 +0800\" >1 minute ago</time>",
    6. "mtime": 1502506122,
    7. "owner": "1@1.com",
    8. "root": "",
    9. "id": "b8c8eeaf-a62f-4ece-a2cb-e1c67f49f881",
    10. "size": 0,
    11. "name": "group-lib",
    12. "type": "repo",
    13. "virtual": false,
    14. "version": 1,
    15. "head_commit_id": "b0a8c797972b83af1054428a397f843612257425",
    16. "size_formatted": "0 bytes"
    17. },
    18. {
    19. "permission": "rw",
    20. "encrypted": false,
    21. "mtime_relative": "<time datetime=\"2017-08-03T17:42:49\" is=\"relative-time\" title=\"Thu, 3 Aug 2017 17:42:49 +0800\" >8 days ago</time>",
    22. "mtime": 1501753369,
    23. "owner": "1@1.com",
    24. "root": "",
    25. "id": "cd0df3ce-7e1b-4fc3-9b76-714c48db47d7",
    26. "size": 1449,
    27. "name": "My Library",
    28. "type": "repo",
    29. "virtual": false,
    30. "version": 1,
    31. "head_commit_id": "9d47232bb87d39dbbba54fb8f09f9795b2d396e4",
    32. "size_formatted": "1.4 KB"
    33. },
    34. {
    35. "owner_nickname": "lian",
    36. "permission": "rw",
    37. "encrypted": false,
    38. "mtime_relative": "<time datetime=\"2017-08-12T10:44:07\" is=\"relative-time\" title=\"Sat, 12 Aug 2017 10:44:07 +0800\" >6 minutes ago</time>",
    39. "mtime": 1502505847,
    40. "owner": "lian@lian.com",
    41. "root": "",
    42. "id": "c474a093-19dc-4ddf-b0b0-72b33214ba33",
    43. "size": 708833229,
    44. "name": "seacloud.cc.124",
    45. "share_type": "personal",
    46. "type": "srepo",
    47. "version": 1,
    48. "head_commit_id": "0b11fc08518d0c9acfd15e95a580664896484336",
    49. "size_formatted": "676.0 MB"
    50. },
    51. {
    52. "permission": "rw",
    53. "encrypted": false,
    54. "mtime": 1502506122,
    55. "owner": "asdf",
    56. "id": "b8c8eeaf-a62f-4ece-a2cb-e1c67f49f881",
    57. "size": 0,
    58. "name": "group-lib",
    59. "root": "",
    60. "version": 1,
    61. "head_commit_id": "b0a8c797972b83af1054428a397f843612257425",
    62. "type": "grepo",
    63. "groupid": 1675
    64. },
    65. {
    66. "share_from": "lian@lian.com",
    67. "permission": "rw",
    68. "encrypted": false,
    69. "mtime_relative": "<time datetime=\"2017-08-12T10:33:47\" is=\"relative-time\" title=\"Sat, 12 Aug 2017 10:33:47 +0800\" >16 minutes ago</time>",
    70. "mtime": 1502505227,
    71. "owner": "Organization",
    72. "root": "",
    73. "id": "050ef344-45fb-49b6-80e6-e1bf094ab7bd",
    74. "size": 0,
    75. "name": "public-repo",
    76. "share_type": "public",
    77. "type": "grepo",
    78. "version": 1,
    79. "head_commit_id": "b71a95373896eb52e2971d72a869b7c413791b0b",
    80. "size_formatted": "0 bytes"
    81. }
    82. ]

    Sample request for get my owned libraries

    1. curl -H "Authorization: Token 8cc0e7085a24b6abfee721e758b6aab4a90e7321" -H 'Accept: application/json; indent=4' "http://192.168.1.124:8000/api2/repos/?type=mine"

    Sample response for get my owned libraries

    1. [
    2. {
    3. "permission": "rw",
    4. "encrypted": false,
    5. "mtime_relative": "<time datetime=\"2017-08-12T10:48:42\" is=\"relative-time\" title=\"Sat, 12 Aug 2017 10:48:42 +0800\" >19 minutes ago</time>",
    6. "mtime": 1502506122,
    7. "owner": "1@1.com",
    8. "root": "",
    9. "id": "b8c8eeaf-a62f-4ece-a2cb-e1c67f49f881",
    10. "size": 0,
    11. "name": "group-lib",
    12. "type": "repo",
    13. "virtual": false,
    14. "version": 1,
    15. "head_commit_id": "b0a8c797972b83af1054428a397f843612257425",
    16. "size_formatted": "0 bytes"
    17. },
    18. {
    19. "permission": "rw",
    20. "encrypted": false,
    21. "mtime_relative": "<time datetime=\"2017-08-03T17:42:49\" is=\"relative-time\" title=\"Thu, 3 Aug 2017 17:42:49 +0800\" >8 days ago</time>",
    22. "mtime": 1501753369,
    23. "owner": "1@1.com",
    24. "root": "",
    25. "id": "cd0df3ce-7e1b-4fc3-9b76-714c48db47d7",
    26. "size": 1449,
    27. "name": "My Library",
    28. "type": "repo",
    29. "virtual": false,
    30. "version": 1,
    31. "head_commit_id": "9d47232bb87d39dbbba54fb8f09f9795b2d396e4",
    32. "size_formatted": "1.4 KB"
    33. }
    34. ]

    Get Library Info" class="reference-link">Get Library Info

    GET https://cloud.seafile.com/api2/repos/{repo-id}/

    Request parameters

    • repo-id

    Sample request

    1. curl -G -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/632ab8a8-ecf9-4435-93bf-f495d5bfe975/

    Sample response

    1. {
    2. "encrypted": false,
    3. "password_need": null,
    4. "mtime": null,
    5. "owner": "self",
    6. "id": "632ab8a8-ecf9-4435-93bf-f495d5bfe975",
    7. "size": 1356155,
    8. "name": "org",
    9. "root": "b5227040de360dd22c5717f9563628fe5510cbce",
    10. "desc": "org file",
    11. "type": "repo"
    12. }

    Get Library Owner" class="reference-link">Get Library Owner

    GET https://cloud.seafile.com/api2/repos/{repo-id}/owner/

    Request parameters

    • repo-id

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/owner/

    Sample response

    1. {
    2. "owner": "user@example.com"
    3. }

    Errors

    • 403 Permission error(only administrator/repo-owner can perform this action).

    Get Library History" class="reference-link">Get Library History

    GET https://cloud.seafile.com/api/v2.1/repos/{repo_id}/history/

    Request parameters

    • repo_id
    • page, default 1
    • per_page, default 100

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/history/"

    Sample response

    1. {
    2. "data": [
    3. {
    4. "commit_id": "2b1313e4bbce2b938403c829b114b12b549128a3",
    5. "time": "2017-04-10T03:24:09+00:00",
    6. "description": "Recovered deleted directory \"456\"",
    7. "creator": "lian@lian.com"
    8. },
    9. {
    10. "commit_id": "0be8bba456ece31598557d9f3d5471b5b4d9d7c0",
    11. "time": "2017-04-10T03:23:49+00:00",
    12. "description": "Removed directory \"456\"",
    13. "creator": "lian@lian.com"
    14. },
    15. {
    16. "commit_id": "e6f21a80d60b7f1797434fdab622e562af937f81",
    17. "time": "2017-04-10T03:23:45+00:00",
    18. "description": "Deleted \"empty.docx\"",
    19. "creator": "lian@lian.com"
    20. },
    21. {
    22. "commit_id": "0bddb7401a75a9799209a24fb118e8d49151b6d6",
    23. "time": "2017-04-10T03:23:41+00:00",
    24. "description": "Deleted \"QQ_account_manager.png\"",
    25. "creator": "lian@lian.com"
    26. }
    27. ],
    28. "more": false
    29. }

    Errors

    • 403 Permission denied.
    • 404 Library not found.
    • 500 Internal Server Error

    Get Library Trash" class="reference-link">Get Library Trash

    GET https://cloud.seafile.com/api/v2.1/repos/{repo_id}/trash/

    Request parameters

    • repo_id
    • path, default ‘/‘.
    • per_page, default 100.
    • scan_stat, An opaque status returned by the last call. In the first call, None must be passed. The last entry of the result list contains a ‘scan_stat’ attribute. In the next call, pass in the returned ‘scan_stat’.

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/trash/"

    Sample response

    1. {
    2. "scan_stat": "2b1313e4bbce2b938403c829b114b12b549128a3",
    3. "data": [
    4. {
    5. "commit_id": "2364981a2bef50c16281a664df55af209019a88c",
    6. "scan_stat": null,
    7. "obj_id": "f86ef37332e89d6a132e27ce857c76e15971b227",
    8. "deleted_time": "2017-04-10T03:23:41+00:00",
    9. "obj_name": "QQ_account_manager.png",
    10. "is_dir": false,
    11. "parent_dir": "/",
    12. "size": 77970
    13. },
    14. {
    15. "commit_id": "0bddb7401a75a9799209a24fb118e8d49151b6d6",
    16. "scan_stat": null,
    17. "obj_id": "10ae7309338efe92d9ceddb9d6835463d277da34",
    18. "deleted_time": "2017-04-10T03:23:45+00:00",
    19. "obj_name": "empty.docx",
    20. "is_dir": false,
    21. "parent_dir": "/456/",
    22. "size": 10682
    23. }
    24. ...
    25. ],
    26. "more": true
    27. }

    Get more trash items.

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/trash/?scan_stat=2b1313e4bbce2b938403c829b114b12b549128a3"

    Sample response

    1. {
    2. "scan_stat": null,
    3. "data": [
    4. {
    5. "commit_id": "726d2ce009df9176592ab88eca297b5e50c15639",
    6. "scan_stat": null,
    7. "obj_id": "cfc5e4299a862b366c98eeb7f5a8a1f689d2916a",
    8. "deleted_time": "2017-04-10T09:11:02+00:00",
    9. "obj_name": "empty.xlsx",
    10. "is_dir": false,
    11. "parent_dir": "/456/",
    12. "size": 8176
    13. },
    14. {
    15. "commit_id": "2b1313e4bbce2b938403c829b114b12b549128a3",
    16. "scan_stat": null,
    17. "obj_id": "414a75f5c67ca56c480ca2ae9137b7812940c3ce",
    18. "deleted_time": "2017-04-10T09:11:01+00:00",
    19. "obj_name": "empty.pptx",
    20. "is_dir": false,
    21. "parent_dir": "/456/",
    22. "size": 40506
    23. }
    24. ],
    25. "more": false
    26. }

    Errors

    • 403 Permission denied.
    • 404 Library not found.
    • 500 Internal Server Error

    Get Library History Limit Days" class="reference-link">Get Library History Limit Days

    GET https://cloud.seafile.com/api2/repos/{repo-id}/history-limit/

    Request parameters

    • repo-id

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/history-limit/

    Sample response

    1. {
    2. "keep_days": -1,
    3. }

    Errors

    • 403 Permission denied.
    • 404 Library not found.
    • 500 Internal Server Error

    Set Library History Limit Days" class="reference-link">Set Library History Limit Days

    PUT https://cloud.seafile.com/api2/repos/{repo-id}/history-limit/

    Request parameters

    • repo-id
    • keep_days. -1 for keep full history; 0 for do not keep history; positive number for keep a period of limit days.

    Sample request

    1. curl -v -X PUT -d "keep_days=4" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/history-limit/

    Sample response

    1. {
    2. "keep_days": 4,
    3. }

    Errors

    • 400 keep_days invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 500 Internal Server Error
    • 520 Failed to set library history limit.

    Create Library" class="reference-link">Create Library

    POST https://cloud.seafile.com/api2/repos/

    Request parameters

    • name
    • desc (defaults to “new repo”)
    • passwd (needed by encrypt library)

    Sample request

    1. curl -v -d "name=foo&desc=new library" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/

    Sample response

    1. {
    2. "encrypted": "",
    3. "enc_version": 0,
    4. "repo_id": "f15811fd-5c19-412c-b143-2ac83f352290",
    5. "magic": "",
    6. "relay_id": "c5e41170db250ea497075e2911104faf0105b7fb",
    7. "repo_version": 1,
    8. "relay_addr": "cloud.seafile.com",
    9. "token": "c1f3defe9ba408cd7964427ec276843e9d10c23b",
    10. "relay_port": "10001",
    11. "random_key": "",
    12. "email": "user@mail.com",
    13. "repo_name": "foo"
    14. }

    Success

    Response code 200 and newly created library information are returned.

    Errors

    • 400 Library name missing.
    • 520 Operation failed.

    Check/Create Sub Library" class="reference-link">Check/Create Sub Library

    check if a dir has a corresponding sub_repo, if it does not have, create one

    GET https://cloud.seafile.com/api2/repos/{repo-id}/dir/sub_repo/?p=/\&name=sub_lib

    Request parameters

    • repo-id
    • p
    • name

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/dir/sub_repo/?p=/\&name=sub_lib

    Sample response

    1. {"sub_repo_id": "c0a3283c-013c-4a7c-8f68-006f06fa6dec"}

    Errors

    • 400 Argument missing
    • 500 INTERNAL SERVER ERROR

    Delete Library" class="reference-link">Delete Library

    DELETE https://cloud.seafile.com/api2/repos/{repo-id}/

    Sample request

    1. curl -v -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/8f5f2222-72a8-454f-ac40-8397c5a556a8/

    Sample response

    “success”

    Errors

    • 400 Library does not exist.

    • 403 Only library owner can perform this operation.

    Rename Library" class="reference-link">Rename Library

    POST https://cloud.seafile.com/api2/repos/{repo-id}/?op=rename

    Sample request

    1. curl -d "repo_name=new-repo-name" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/8f5f2222-72a8-454f-ac40-8397c5a556a8/op=rename

    Sample response

    “success”

    Errors

    • 404 Library not found.
    • 403 You do not have permission to rename this library.
    • 500 Unable to rename library

    Transfer Library" class="reference-link">Transfer Library

    PUT https://cloud.seafile.com/api2/repos/{repo-id}/owner/

    Request parameters

    • repo-id
    • owner

    Sample request

    1. curl -v -X PUT -d "owner=new@owner.com" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/owner/

    Sample response

    1. {
    2. "success": True
    3. }

    Errors

    • 440 Email invalid.
    • 403 Permission error(only administrator/repo-owner can perform this action).
    • 404 Library not found.
    • 404 User not found.

    Decrypt Library" class="reference-link">Decrypt Library

    POST https://cloud.seafile.com/api2/repos/{repo-id}/

    Request parameters

    • password

    Sample request

    1. curl -v -d "password=123" -H 'Authorization: Token e6a33d61954f219a96b60f635cf02717964e4385' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/0c2465a5-4753-4660-8a22-65abec9ec8d0/

    Sample response

    “success”

    Errors

    • 400 Incorrect password
    • 409 Repo is not encrypt
    • 500 Internal server error

    Create Public Library" class="reference-link">Create Public Library

    POST https://cloud.seafile.com/api2/repos/public/

    Request parameters

    • name
    • permission, r or rw, default r.
    • passwd (optional).

    Sample request, create an encrypted public repo with rw permission

    1. curl -X POST -d "name=test-public-repo&permission=rw&passwd=password" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/public/

    Sample response

    1. {
    2. "owner_nickname": "lian",
    3. "permission": "rw",
    4. "encrypted": true,
    5. "mtime_relative": "<time datetime=\"2016-05-31T12:01:49\" is=\"relative-time\" title=\"Tue, 31 May 2016 12:01:49 +0800\" >1 second ago</time>",
    6. "mtime": 1464667309,
    7. "owner": "lian@lian.com",
    8. "id": "6553fd8b-bf3e-41ad-a481-90c8523d3b4a",
    9. "size": 0,
    10. "name": "test-public-repo",
    11. "desc": "",
    12. "size_formatted": "0 bytes"
    13. }

    Errors

    • 400 Library name is required.
    • 400 Invalid permission
    • 403 You do not have permission to create library.
    • 403 NOT allow to create encrypted library.

    Set Exist Lib as Public Library" class="reference-link">Set Exist Lib as Public Library

    PUT https://cloud.seafile.com/api2/shared-repos/{repo-id}/?share_type=public

    Request parameters

    • repo_id
    • share_type, must be public
    • permission, r or rw.

    Sample request, create an encrypted public repo with rw permission

    1. curl -X PUT -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api2/shared-repos/2deffbac-d7be-4ace-b406-efb799083ee9/?share_type=public&permission=rw'

    Sample response

    1. success

    Errors

    • 400 Permission need to be rw or r.
    • 403 You do not have permission to share library.
    • 500 Failed to share library to public.

    Remove Public Library" class="reference-link">Remove Public Library

    DELETE https://cloud.seafile.com/api2/shared-repos/{repo-id}/?share_type=public

    Request parameters

    • repo-id
    • share_type

    Sample request

    1. curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/shared-repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/?share_type=public

    Success

    1. "success"

    Errors

    • 400 Share type is required.
    • 400 Share type can only be personal or group or public.
    • 403 You do not have permission to unshare library.

    Fetch library download info" class="reference-link">Fetch library download info

    GET https://cloud.seafile.com/api2/repos/{repo-id}/download-info/

    Request parameters

    • repo-id

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/download-info/

    Sample response

    1. {
    2. "applet_root": "https://localhost:13420",
    3. "relay_addr": "localhost",
    4. "token": "46acc4d9ca3d6a5c7102ef379f82ecc1edc629e1",
    5. "repo_id": "dae8cecc-2359-4d33-aa42-01b7846c4b32",
    6. "relay_port": "10002",
    7. "encrypted": "",
    8. "repo_name": "test",
    9. "relay_id": "8e4b13b49ca79f35732d9f44a0804940d985627c",
    10. "email": "user@example.com"
    11. }

    Search Files in Libraries" class="reference-link">Search Files in Libraries

    GET https://cloud.seafile.com/api2/search/

    Request parameters

    • q, keyword for searching.

    • page, optional, a number greater than or equal to 1.

    • per_page, optional.

    • search_repo, all, mine, shared, group, public or a repo_id, (all for searching in all libraries, etc.), optional. For searching in shared libraries, you can also pass shared_from or not_shared_from parameter beside shared to filter shared libraries.

    • search_path, path of specifiy library.(This option works only when search_repo is a single repo_id.)

    • search_ftypes, all or custom, (all for searching all file types, custom for only searching the specific file types you defined in ftype and input_fexts).

    • ftype, must be in (Text, Document, Image, Video, Audio, PDF, Markdown).

    TEXT: (‘ac’, ‘am’, ‘bat’, ‘c’, ‘cc’, ‘cmake’, ‘cpp’, ‘cs’, ‘css’, ‘diff’, ‘el’, ‘h’, ‘html’, ‘htm’, ‘java’, ‘js’, ‘json’, ‘less’, ‘make’, ‘org’, ‘php’, ‘pl’, ‘properties’, ‘py’, ‘rb’, ‘scala’, ‘script’, ‘sh’, ‘sql’, ‘txt’, ‘text’, ‘tex’, ‘vi’, ‘vim’, ‘xhtml’, ‘xml’, ‘log’, ‘csv’, ‘groovy’, ‘rst’, ‘patch’, ‘go’),

    DOCUMENT: (‘doc’, ‘docx’, ‘ppt’, ‘pptx’, ‘odt’, ‘fodt’, ‘odp’, ‘fodp’),

    IMAGE: (‘gif’, ‘jpeg’, ‘jpg’, ‘png’, ‘ico’, ‘bmp’, ‘tif’, ‘tiff’, ‘eps’),

    VIDEO: (‘mp4’, ‘ogv’, ‘webm’, ‘mov’),

    AUDIO: (‘mp3’, ‘oga’, ‘ogg’),

    PDF: (‘pdf’,),

    MARKDOWN: (‘markdown’, ‘md’),

    • input_fexts, file extensions manually specific.

    • with_permission, true or false. Whether return permission info of the file or not, default is false.

    Sample request

    1. curl -H 'Authorization: Token 076de58233c09f19e7a5179abff14ad55987350e' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/search/?q=seafile&search_repo=all&search_ftypes=custom&ftype=Document&input_fexts=md,png&per_page=3&page=3&with_permission=true"

    Sample response

    1. {
    2. "has_more": true,
    3. "total": 336,
    4. "results": [
    5. {
    6. "repo_id": "040a8aad-5646-4c68-ba8a-73f90c60089f",
    7. "name": "seafile \u8fd0\u7ef4.docx",
    8. "permission": "r",
    9. "oid": "ecba7db3d6b818873bf94cb1f2161f6a0fc22494",
    10. "last_modified": 1482910730,
    11. "content_highlight": "... .<b>seafile</b>.com...",
    12. "fullpath": "/\u4e1c\u98ce\u65e5\u4ea7/Archived/seafile \u8fd0\u7ef4.docx",
    13. "repo_name": "\u4ee3\u7ef4\u5ba2\u6237",
    14. "is_dir": false,
    15. "repo_type": 'mine',
    16. "size": 494490
    17. },
    18. {
    19. "repo_id": "233191c7-8e33-4fd2-b0a3-e480363d8e0d",
    20. "name": "seafile-tutorial.doc",
    21. "permission": "rw",
    22. "oid": "1066014004ad479dd7f3cc0a12462c3f1fd2edeb",
    23. "last_modified": 1389771193,
    24. "content_highlight": "...A Brief Tour of <b>Seafile</b> <b>Seafile</b> is a file m...",
    25. "fullpath": "/\u4ea7\u54c1\u4f7f\u7528\u6587\u6863/seafile-tutorial.doc",
    26. "repo_name": "seafile-dev",
    27. "is_dir": false,
    28. "repo_type": 'mine',
    29. "size": 414208
    30. },
    31. {
    32. "repo_id": "233191c7-8e33-4fd2-b0a3-e480363d8e0d",
    33. "name": "seafile_vm.md",
    34. "permission": "rw",
    35. "oid": "66c8dbe139333ead26b4878340da486fffdc5330",
    36. "last_modified": 1439277140,
    37. "content_highlight": "...<b>Seafile</b> server VM...",
    38. "fullpath": "/\u90e8\u7f72\u548c\u8fd0\u7ef4/seafile_vm.md",
    39. "repo_name": "seafile-dev",
    40. "is_dir": false,
    41. "repo_type": 'shared',
    42. "size": 3255
    43. }
    44. ]
    45. }

    Sample request

    1. Search for files in a library specified directory.
    2. curl -H 'Authorization: Token 076de58233c09f19e7a5179abff14ad55987350e' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/search/?q=a&search_repo=2628a63b-cfad-41f5-a748-392ec9287686&search_path=/testtest"

    Sample response

    1. {
    2. "has_more": false,
    3. "total": 2,
    4. "results": [
    5. {
    6. "repo_owner_name": "admin",
    7. "repo_id": "2628a63b-cfad-41f5-a748-392ec9287686",
    8. "name": "3a",
    9. "repo_owner_contact_email": "admin@admin.com",
    10. "repo_owner_email": "admin@admin.com",
    11. "last_modified": 1520836447,
    12. "content_highlight": "",
    13. "fullpath": "/testtest/3a",
    14. "repo_name": "dev",
    15. "is_dir": false,
    16. "size": 0
    17. },
    18. {
    19. "repo_owner_name": "admin",
    20. "repo_id": "2628a63b-cfad-41f5-a748-392ec9287686",
    21. "name": "1a",
    22. "repo_owner_contact_email": "admin@admin.com",
    23. "repo_owner_email": "admin@admin.com",
    24. "last_modified": 1520836462,
    25. "content_highlight": "",
    26. "fullpath": "/testtest/1a",
    27. "repo_name": "dev",
    28. "is_dir": false,
    29. "size": 0
    30. }
    31. ]
    32. }

    Errors

    • 404 Search not supported.
    • 400 Missing argument q.

    GET https://cloud.seafile.com/api2/repos/{repo-id}/download-shared-links/

    Request parameters

    • repo-id

    Sample request

    1. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/632ab8a8-ecf9-4435-93bf-f495d5bfe975/download-shared-links/

    Sample response

    1. [
    2. {
    3. "view_count": 0,
    4. "name": "/",
    5. "share_type": "d",
    6. "creator_name": "lian",
    7. "create_by": "lian@lian.com",
    8. "token": "105f108fb6",
    9. "create_time": "2016-01-18T15:03:10+0800",
    10. "path": "/",
    11. "size": ""
    12. },
    13. {
    14. "view_count": 3,
    15. "name": "1.md",
    16. "share_type": "f",
    17. "creator_name": "lian",
    18. "create_by": "lian@lian.com",
    19. "token": "a626012c1b",
    20. "create_time": "2016-01-19T11:27:43+0800",
    21. "path": "/1.md",
    22. "size": "4"
    23. }
    24. ]

    Errors

    • 403 Permission denied.
    • 404 Library not found.

    GET https://cloud.seafile.com/api2/repos/{repo-id}/upload-shared-links/

    Request parameters

    • repo-id

    Sample request

    1. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/632ab8a8-ecf9-4435-93bf-f495d5bfe975/upload-shared-links/

    Sample response

    1. [
    2. {
    3. "view_count": 3,
    4. "name": "/",
    5. "creator_name": "lian",
    6. "create_by": "lian@lian.com",
    7. "token": "43340efca5",
    8. "create_time": "2016-01-18T15:03:12+0800",
    9. "path": "/"
    10. },
    11. {
    12. "view_count": 8,
    13. "name": "a&b",
    14. "creator_name": "lian",
    15. "create_by": "lian@lian.com",
    16. "token": "f1e49d445a",
    17. "create_time": "2016-01-18T15:03:18+0800",
    18. "path": "/a&b/"
    19. }
    20. ]

    Errors

    • 403 Permission denied.
    • 404 Library not found.

    GET https://cloud.seafile.com/api2/repos/{repo-id}/download-shared-links/{token}/

    Request parameters

    • repo-id
    • token

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/632ab8a8-ecf9-4435-93bf-f495d5bfe975/download-shared-links/105f108fb6/

    Sample response

    1. {"success": true}

    Errors

    • 403 Permission denied.
    • 404 Library not found.
    • 404 Link not found.

    GET https://cloud.seafile.com/api2/repos/{repo-id}/upload-shared-links/{token}/

    Request parameters

    • repo-id
    • token

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/632ab8a8-ecf9-4435-93bf-f495d5bfe975/upload-shared-links/f1e49d445a/

    Sample response

    1. {"success": true}

    Errors

    • 403 Permission denied.
    • 404 Library not found.
    • 404 Link not found.

    Search Library By Name" class="reference-link">Search Library By Name

    GET https://cloud.seafile.com/api2/repos/

    Request parameters

    • type (optional)
    • nameContains (optional)

    Sample request

    1. Search the all library
    2. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -sS 'https://cloud.seafile.com/api2/repos/?nameContains=T'

    Sample response

    1. [
    2. {
    3. "root": "",
    4. "modifier_email": null,
    5. "name": "TEST",
    6. "permission": "rw",
    7. "size_formatted": "424.6 MB",
    8. "virtual": false,
    9. "mtime_relative": "<time datetime=\"2017-07-04T08:30:33\" is=\"relative-time\" title=\"Tue, 4 Jul 2017 08:30:33 +0000\" >2017-07-04</time>",
    10. "head_commit_id": "05418e616a5325b3f0ccfaf7d4c54c803b8168de",
    11. "encrypted": false,
    12. "version": 1,
    13. "mtime": 1499157033,
    14. "owner": "admin@admin.com",
    15. "modifier_contact_email": "",
    16. "type": "repo",
    17. "id": "a9025464-2c72-4b9c-9cdd-6de62e56f696",
    18. "modifier_name": "",
    19. "size": 445243555
    20. }
    21. ]

    Sample request

    1. Search the specified library
    2. curl -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -sS 'https://cloud.seafile.com/api2/repos/?type=mime&nameContains=T'

    Sample response

    1. []

    Errors

    None

    File" class="reference-link">File

    View File Through Owa" class="reference-link">View File Through Owa

    GET https://cloud.seafile.com/api2/repos/{repo-id}/owa-file/?path=/foo.docx

    Request parameters

    • repo-id
    • path
    • action, view or edit, default value is view;

    Sample request for view

    1. curl -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' 'https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/owa-file/?path=/foo.docx'

    Sample response for view

    1. {
    2. "access_token": "7decacff-6e55-4856-9734-01aaab26ef45",
    3. "action_url": "http://off1.off.com/wv/wordviewerframe.aspx?WOPIsrc=http%3A%2F%2F192.168.1.124%3A8000%2Fapi2%2Fwopi%2Ffiles%2F2b0750085925fa85238e5f64cfd13ed6f1076bfd%2F",
    4. "access_token_ttl": 1456906784000
    5. }

    Sample request for edit

    1. curl -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' 'https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/owa-file/?path=/foo.docx&action=edit'

    Sample response for edit

    1. {
    2. "access_token": "bb80a7934b42454189ade73bdfba7f62",
    3. "action_url": "http://off1.off.com/we/wordeditorframe.aspx?WOPISrc=http%3A%2F%2F192.168.1.227%3A8000%2Fapi2%2Fwopi%2Ffiles%2F1ef1da7af8dc2d02f85f156dba779a31ff1db9f7&ui=zh-CN&rs=zh-CN",
    4. "access_token_ttl": 1496925674000
    5. }

    After get response

    In order to instantiate the Office Online applications, a host must create an HTML page that will host an iframe element within it pointing to a particular WOPI action URL. And then use a form element and POST the access_token and access_token_ttl values to the Office Online.

    For more info, you can see this official docs.

    Errors

    • 400 path invalid.
    • 403 permission denied.
    • 403 Library encrypted.
    • 403 Office Web App feature not enabled.
    • 403 Office Web App feature only supported in professional edition.
    • 404 File/Library not found.
    • 500 Internal Server Error

    Download File" class="reference-link">Download File

    GET https://cloud.seafile.com/api2/repos/{repo-id}/file/?p=/foo

    Request parameters

    • repo-id
    • p
    • reuse (optional): Set reuse to 1 if you want the generated download link can be accessed more than once in one hour.

    Sample request

    1. curl -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' 'https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/?p=/foo.c&reuse=1'

    Sample response

    1. "https://cloud.seafile.com:8082/files/adee6094/foo.c"

    Errors

    • 400 Path is missing
    • 404 File not found
    • 520 Operation failed.

    Get File Detail" class="reference-link">Get File Detail

    GET https://cloud.seafile.com/api2/repos/{repo-id}/file/detail/?p=/foo.c

    • repo-id
    • p

    Sample request

    1. curl -H 'Authorization: Token f2210dacd3606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/detail/?p=/foo.c

    Sample response

    1. {
    2. "id": "013d3d38fed38b3e8e26b21bb3463eab6831194f",
    3. "mtime": 1398148877,
    4. "type": "file",
    5. "name": "foo.py",
    6. "size": 22
    7. }

    Errors

    • 400 Path is missing
    • 520 Operation failed.

    Get File History" class="reference-link">Get File History

    GET https://cloud.seafile.com/api2/repos/{repo-id}/file/history/?p=/foo.c

    Request parameters

    • repo-id
    • p

    Sample request

    1. curl -H 'Authorization: Token f2210dacd3606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/history/?p=/foo.c

    Sample response

    1. {
    2. "commits":
    3. [
    4. {
    5. "rev_file_size": 0,
    6. "repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4",
    7. "ctime": 1398149763,
    8. "creator_name": "user@example.com",
    9. "creator": "0000000000000000000000000000000000000000",
    10. "root_id": "b64d413d9894c9206beac3faf9c2a0d75b4a8ebf",
    11. "rev_renamed_old_path": null,
    12. "parent_id": "8e546762e1657ab22dad83e9cb1e5ea31a767c9a",
    13. "new_merge": false,
    14. "version": 1,
    15. "conflict": false,
    16. "desc": "Added \"foo.c\"",
    17. "id": "9464f7499bfa7363d563282361339eaf96a93318",
    18. "rev_file_id": "0000000000000000000000000000000000000000",
    19. "second_parent_id": null
    20. },
    21. {
    22. "rev_file_size": 0,
    23. "repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4",
    24. "ctime": 1398146059,
    25. "creator_name": "user@example.com",
    26. "creator": "0000000000000000000000000000000000000000",
    27. "root_id": "572413414257c76039897e00aeb35f819471206b",
    28. "rev_renamed_old_path": null,
    29. "parent_id": "f977bdb0ebb205645c3b42216c2817e511c3f68f",
    30. "new_merge": false,
    31. "version": 1,
    32. "conflict": false,
    33. "desc": "Added \"foo.c\"",
    34. "id": "a1ec20709675f4dc8db825cdbca296be245d189b",
    35. "rev_file_id": "0000000000000000000000000000000000000000",
    36. "second_parent_id": null
    37. }
    38. ]
    39. }

    Errors

    • 400 Path is missing
    • 404 File not found

    Restore File From History" class="reference-link">Restore File From History

    POST https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/file/?p=/1.md

    Request parameters

    • repo_id
    • p
    • operation
    • commit_id

    Sample request

    1. curl -d "operation=revert&commit_id=7ed3ccdc7559d1afddb95bc050230e3d54bbffef" -H "Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a" -H 'Accept: application/json; indent=4' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/file/?p=/1.md"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 commit_id invalid.
    • 403 Permission denied.
    • 403 File is locked
    • 500 Internal Server Error
    • 500 Check file lock error

    Download File From a Revision" class="reference-link">Download File From a Revision

    GET https://cloud.seafile.com/api2/repos/{repo-id}/file/revision/?p=/foo.c&commit_id=a1ec20709675f4dc8db825cdbca296be245d189b

    Request parameters

    • repo-id
    • p
    • commit_id

    Sample request

    1. curl -H 'Authorization: Token f2210dacd3606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/revision/?p=/foo.c\&commit_id=a1ec20709675f4dc8db825cdbca296be245d189b

    Sample response

    1. "https://cloud.seafile.com:8082/files/adee6094/foo.c"

    Errors

    • 400 Path is missing
    • 404 Revision not found

    Create File" class="reference-link">Create File

    POST https://cloud.seafile.com/api/v2.1/repos/{repo_id}/file/?p={file_path}

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    1. curl -d 'operation=create' -H 'Authorization: Token c5de3074be40861f399f02c65149c6460bbf073f' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/file/?p=/test.xlsx"

    Sample response

    1. {
    2. 'is_locked': False,
    3. 'mtime': '2017-09-12T14:57:42+08:00',
    4. 'obj_id': u'44bdca6005429390d1ecc6943b05c821bd30917a',
    5. 'obj_name': u'test.xlsx',
    6. 'parent_dir': u'/',
    7. 'repo_id': u'7460f7ac-a0ff-4585-8906-bb5a57d2e118',
    8. 'size': 7631,
    9. 'type': 'file'
    10. }

    Errors

    • 400 operation/name invalid.
    • 400 operation can only be ‘create’, ‘rename’, ‘move’, ‘copy’ or ‘revert’.
    • 404 Library/Folder not found.
    • 403 Permission denied.
    • 500 Internal Server Error

    Rename File" class="reference-link">Rename File

    POST https://cloud.seafile.com/api2/repos/{repo-id}/file/?p=/foo.c

    Request parameters

    • repo-id
    • p
    • operation=rename
    • newname

    Sample request

    1. curl -v -d "operation=rename&newname=newfoo.c" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/?p=/foo.c

    Sample response

    1. ...
    2. < HTTP/1.1 301 MOVED PERMANENTLY
    3. ...
    4. "success"

    Success

    Response code is 301, and a string "success" is returned.

    Errors

    • 400 BAD REQUEST, Path is missing or invalid(e.g. p=/) or newname is missing(newname too long)
    • 403 FORBIDDEN, You do not have permission to rename file
    • 404 NOT FOUND, repo not found
    • 409 CONFLICT, the newname is the same to the old
    • 520 OPERATION FAILED, fail to rename file

    Lock File" class="reference-link">Lock File

    PUT https://cloud.seafile.com/api2/repos/{repo-id}/file/

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    1. curl -v -X PUT -d "operation=lock&p=/foo.c" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Success

    Response code is 200, and a string "success" is returned.

    Errors

    • 400 BAD REQUEST, Path is missing or invalid(e.g. p=/)
    • 403 FORBIDDEN, You do not have permission to lock file
    • 404 NOT FOUND, repo not found
    • 520 OPERATION FAILED, fail to lock file

    Unlock File" class="reference-link">Unlock File

    PUT https://cloud.seafile.com/api2/repos/{repo-id}/file/

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    1. curl -v -X PUT -d "operation=unlock&p=/foo.c" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Success

    Response code is 200, and a string "success" is returned.

    Errors

    • 400 BAD REQUEST, Path is missing or invalid(e.g. p=/)
    • 403 FORBIDDEN, You do not have permission to lock file
    • 404 NOT FOUND, repo not found
    • 520 OPERATION FAILED, fail to unlock file

    Move File" class="reference-link">Move File

    POST https://cloud.seafile.com/api2/repos/{repo-id}/file/?p=/foo.c

    Request parameters

    • repo-id
    • p
    • operation
    • dst_repo
    • dst_dir

    Sample request

    1. curl -v -d "operation=move&dst_repo=affc837f-7fdd-4e91-b88a-32caf99897f2&dst_dir=/123" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/?p=/foo.c

    Sample response

    1. ...
    2. < HTTP/1.1 301 MOVED PERMANENTLY
    3. ...
    4. {
    5. "repo_id": "affc837f-7fdd-4e91-b88a-32caf99897f2",
    6. "parent_dir": "/123",
    7. "obj_name": "foo.c"
    8. }

    Success

    Response code is 301, and a string "success" is returned.

    Errors

    • 400 BAD REQUEST, Path is missing or invalid(e.g. p=/)
    • 403 FORBIDDEN, You do not have permission to move file
    • 404 NOT FOUND, repo not found
    • 500 INTERNAL SERVER ERROR

    Copy File" class="reference-link">Copy File

    POST https://cloud.seafile.com/api2/repos/{repo-id}/file/?p=/foo.c

    Request parameters

    • repo-id
    • p
    • operation
    • dst_repo
    • dst_dir

    Sample request

    1. curl -v -d "operation=copy&dst_repo=73ddb2b8-dda8-471b-b7a7-ca742b07483c&dst_dir=/123" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/c7436518-5f46-4296-97db-2fcba4c8c8db/file/?p=/foo.c

    Sample response

    1. ...
    2. < HTTP/1.1 200 OK
    3. ...
    4. {
    5. "repo_id": "73ddb2b8-dda8-471b-b7a7-ca742b07483c",
    6. "parent_dir": "/123",
    7. "obj_name": "foo.c"
    8. }

    Success

    Response code is 200, and a string "success" is returned.

    Errors

    • 400 BAD REQUEST, Path is missing or invalid(e.g. p=/)
    • 403 FORBIDDEN, You do not have permission to copy file
    • 500 INTERNAL SERVER ERROR

    Revert File" class="reference-link">Revert File

    PUT https://cloud.seafile.com/api2/repos/{repo_id}/file/revert/

    Request parameters

    • repo_id
    • p
    • commit_id

    Sample request

    1. curl -v -X PUT -d "commit_id=a1ec20709675f4dc8db825cdbca296be245d189b&p=/foo.c" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/8f5f2222-72a8-454f-ac40-8397c5a556a8/file/revert/

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. {"ret": 0}

    Success

    1. Response code 200(OK) is returned.

    Errors

    • 400 Path is missing

    Delete File" class="reference-link">Delete File

    DELETE https://cloud.seafile.com/api2/repos/{repo-id}/file/?p=/foo

    Request parameters

    • repo-id
    • p

    Sample request

    1. curl -X DELETE -v -H 'Authorization: Token f2210dacd3606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/file/?p=/foo.c

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Errors

    • 400 Path is missing
    • 520 Operation failed.

    Note

    This can also be used to delete directory.

    Upload File" class="reference-link">Upload File

    GET https://cloud.seafile.com/api2/repos/{repo-id}/upload-link/?p=/upload-dir

    Request parameters

    • repo-id
    • p (use ‘/‘ as default)

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" https://cloud.seafile.com/api2/repos/99b758e6-91ab-4265-b705-925367374cf0/upload-link/

    Sample response

    1. "http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3"

    Errors

    1. 403 Permission denied.
    2. 500 Run out of quota

    Upload File" class="reference-link">Upload File

    After getting the upload link, POST to this link for uploading files.

    POST http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3

    Request parameters

    • file: local file path.
    • parent_dir : path in your Seafile repo that you want to upload local file to.
    • relative_path: sub path of “parent_dir”, if this sub path does not exist, Seafile will create it recursively.
    • ret-json: returns a json array including file info if set to 1.
    • replace: whether overwrite file with the same name. 1 for replace, 0 for not replace.

    NOTE:

    1. parent_dir must endswith /
    2. relative_path must NOT startswith /

    Sample request

    upload file to /path-in-seafile-repo/, if a file named ‘test.txt’ already exists in /path-in-seafile-repo/, replace it with the new file:

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -F file=@local-folder/test.txt -F parent_dir=/path-in-seafile-repo/ -F replace=1 http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3

    Sample response for no ret-json parameter

    1. "adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"

    upload file to /path-in-seafile-repo/sub_path_1/sub_path_2/, Seafile will create sub_path_1/sub_path_2/ recursively if it does not exist:

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -F file=@local-folder/test.txt -F file=@1.jpg -F parent_dir=/path-in-seafile-repo/ -F relative_path=sub_path_1/sub_path_2/ http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3?ret-json=1

    Sample response for with ?ret-json=1 parameter

    1. [
    2. {
    3. "name": "test.txt",
    4. "id": "4ccd37916552e2943314027931edd0b45240be7c",
    5. "size": 2987
    6. },
    7. {
    8. "name": "1.jpg",
    9. "id": "12e07dd00c124fa7ea3b645ff9fe183f73eab2a1",
    10. "size": 1699246
    11. }
    12. ]

    Note

    Errors

    1. 400 Bad request
    2. 440 Invalid filename
    3. 500 Internal server error

    Resumable Upload File" class="reference-link">Resumable Upload File

    Can only be used when size of file to be uploaded bigger than 100MB.

    Check If Enable Resumable Upload" class="reference-link">Check If Enable Resumable Upload

    GET http://192.168.1.113:8000/api/v2.1/repos/{repo_id}/file-uploaded-bytes/?parent_dir={parent_dir}&file_name={file_name}

    Request parameters

    • repo_id
    • parent_dir
    • file_name

    Sample request

    1. curl -v -H 'Authorization: Token e71c00e93af863ba9bcddb61a46bb4de11d713fc' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/repos/09b7d3c0-5f0d-49be-9318-7ca136f386cd/file-uploaded-bytes/?parent_dir=/&file_name=test.md"

    Sample response

    1. * Trying 192.168.1.113...
    2. * Connected to 192.168.1.113 (192.168.1.113) port 8000 (#0)
    3. > GET /api/v2.1/repos/09b7d3c0-5f0d-49be-9318-7ca136f386cd/file-uploaded-bytes/?parent_dir=/&file_name=test.md HTTP/1.1
    4. > Host: 192.168.1.113:8000
    5. > User-Agent: curl/7.50.1
    6. > Authorization: Token e71c00e93af863ba9bcddb61a46bb4de11d713fc
    7. > Accept: application/json; charset=utf-8; indent=4
    8. >
    9. * HTTP 1.0, assume close after body
    10. < HTTP/1.0 200 OK
    11. < Date: Fri, 01 Jun 2018 08:59:27 GMT
    12. < Server: WSGIServer/0.1 Python/2.7.12+
    13. < Content-Length: 26
    14. < Content-Language: en
    15. < Accept-Ranges: bytes
    16. < Vary: Accept, Accept-Language, Cookie
    17. < Allow: GET, HEAD, OPTIONS
    18. < Content-Type: application/json; charset=utf-8; indent=4
    19. <
    20. {
    21. "uploadedBytes": 0
    22. * Closing connection 0
    23. }

    If the response has this header Accept-Ranges: bytes, means that Seafile server supports resumable upload file.

    Errors

    • 400 parent_dir/file_name invalid.
    • 404 Library/Folder not found.
    • 500 Internal server error

    Same as Get Upload Link

    Get Bytes Already Uploaded" class="reference-link">Get Bytes Already Uploaded

    GET http://192.168.1.113:8000/api/v2.1/repos/{repo_id}/file-uploaded-bytes/?parent_dir={parent_dir}&file_name={file_name}

    Request parameters

    • repo_id
    • parent_dir
    • file_name

    Sample request

    1. curl -v -H 'Authorization: Token e71c00e93af863ba9bcddb61a46bb4de11d713fc' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/repos/09b7d3c0-5f0d-49be-9318-7ca136f386cd/file-uploaded-bytes/?parent_dir=/path-in-seafile-repo/&file_name=test.md"

    Sample response

    File has not been uploaded before.

    1. {
    2. "uploadedBytes": 0
    3. }

    File has already been uploaded 149946368 bytes. If you want to continue uploading this file, upload it begin with 149946368 bytes.

    1. {
    2. "uploadedBytes": 149946368
    3. }

    Errors

    • 400 parent_dir/file_name invalid.
    • 404 Library/Folder not found.
    • 500 Internal server error

    Upload File" class="reference-link">Upload File

    After getting the upload link and uploadedBytes, POST to this link for uploading files.

    POST http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3

    Request parameters

    • file: local file path.
    • parent_dir : path in your Seafile repo that you want to upload local file to.
    • replace: whether overwrite file with the same name. 1 for replace, 0 for not replace.

    Sample request

    upload file to /path-in-seafile-repo/, if a file named ‘test.txt’ already exists in /path-in-seafile-repo/, replace it with the new file::

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H "Content-Range: bytes 149946368-150994943/1587609600" -F file=@test.md -F parent_dir=/path-in-seafile-repo/ -F replace=1 http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3
    • 149946368-150994943 means is now uploading 149946368-150994943 bytes.
    • 1587609600 is file’s total bytes.

    Example of Request Payload

    1. ------WebKitFormBoundaryiUPBhwtLnoqOBFlA
    2. Content-Disposition: form-data; name="parent_dir"
    3. /
    4. ------WebKitFormBoundaryiUPBhwtLnoqOBFlA
    5. Content-Disposition: form-data; name="file"; filename="ubuntu-16.04.3-desktop-amd64.iso"
    6. Content-Type: application/x-cd-image
    7. ...file content...

    Sample response

    1. {
    2. "success": true
    3. }

    After the whole file is uploaded, Seafile will do some background index task for this file, it will take time if the file is very large.

    If you don’t want to wait, you can pass a need_idx_progress parameter when you send file upload request.

    Sample request

    upload file to /path-in-seafile-repo/:

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H "Content-Range: bytes 149946368-150994943/1587609600" -F file=@test.md -F parent_dir=/path-in-seafile-repo/ "http://cloud.seafile.com:8082/upload-api/73c5d117-3bcf-48a0-aa2a-3f48d5274ae3?need_idx_progress=true"

    A task id will be returned.

    1. b6a30c27-73ea-415f-bff1-cd4025585b00

    Then, you can use this task id to check the background index task progress.

    1. {
    2. "indexed":602,
    3. "total":602,
    4. "status":0,
    5. "ret_json":"[
    6. {
    7. \"name\": \"book.json\",
    8. \"id\": \"dfb70f907118e0a96c249316281de429d485d8b2\",
    9. \"size\": 602
    10. }
    11. ]"
    12. }

    Note: You should upload up to 1MB of file content every request.

    Errors

    1. 400 Bad request
    2. 440 Invalid filename
    3. 500 Internal server error

    Update file" class="reference-link">Update file

    GET https://cloud.seafile.com/api2/repos/{repo-id}/update-link/?p=/update-dir

    Request parameters

    • repo-id
    • p (use ‘/‘ as default)

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" https://cloud.seafile.com/api2/repos/99b758e6-91ab-4265-b705-925367374cf0/update-link/

    Sample response

    1. "http://cloud.seafile.com:8082/update-api/e69e5ee7-9329-4f42-bf1b-12879bd72c28"

    Errors

    1. 403 Permission denied.
    2. 500 Run out of quota

    Update File" class="reference-link">Update File

    After getting the update link, POST to this link for updating files.

    POST http://cloud.seafile.com:8082/update-api/e69e5ee7-9329-4f42-bf1b-12879bd72c28

    Request parameters

    • target_file

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -F file=@test.txt -F filename=test.txt -F target_file=/test.txt http://cloud.seafile.com:8082/update-api/e69e5ee7-9329-4f42-bf1b-12879bd72c28

    Returns

    The id of the updated file

    Sample response

    1. "adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"

    Errors

    • 400 Bad request
    • 440 Invalid filename
    • 500 Internal server error

    Step 1, POST the block list to Seahub

    POST https://cloud.seafile.com/api2/repos/{repo-id}/upload-blks-link/?p=/parent-folder-path

    Request parameters

    • repo-id.
    • p, parent folder path, default is /.
    • blklist: string of block ids, seperated by ,, for example:

    Sample request

    1. curl -H "Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17" -d 'blklist=1faee57feb464aa1f61165722c93a5075d1993ff,0cfc000bbde26a7b9d4754103501af76a7a' http://192.168.1.113:8000/api2/repos/d4f596ed-09ea-4ac6-8d59-12acbd089097/upload-blks-link/?p=/

    Sample response

    The response is in json format containing the following fields:

    • rawblksurl: the url to upload raw blocks to file server
    • commiturl: the url to commit file in file server
    • blklist: the block id list of the missing blocks
    1. {
    2. "blklist": [
    3. "1faee57feb464aa1f61165722c93a5075d1993ff",
    4. "0cfc000bbde26a7b9d4754103501af76a7a"],
    5. "commiturl": "http://192.168.1.113:8082/upload-blks-api/8bd0ae30-e543-4e03-84ce-03a3cc79e14a?commitonly=true&ret-json=true",
    6. "rawblksurl": "http://192.168.1.113:8082/upload-raw-blks-api/8bd0ae30-e543-4e03-84ce-03a3cc79e14a"
    7. }

    Errors

    • 403 Permission denied.
    • 404 Folder not found.
    • 404 Library not found.
    • 443 Out of quota.
    • 500 Internal Server Error

    Step 2, upload missing blocks to rawblksurl

    1. POST http://server-address:8082/upload-raw-blks-api/<token>

    Request parameters

    • filename: file block id.

    The content of the request is in multipart form-data format.

    1. ------WebKitFormBoundaryWWPdItXjNGBDlSuZ
    2. Content-Disposition: form-data; name="file"; filename=<block id>
    3. Content-Type: text/xml
    4. ------WebKitFormBoundaryWWPdItXjNGBDlSuZ--

    Each block is sent in a file field. You should set filename attribute to the id of each block.

    Sample request

    1. curl -F file=@1.txt -F filename=1faee57feb464aa1f61165722c93a5075d1993ff https://dev.seafile.com/seafhttp/upload-raw-blks-api/389479a2-01fb-4073-8cd3-8f5115e78fc9

    Success

    Response code 200 if everything is ok

    Errors

    • 400 Invalid URL | Access denied | Duplicate progress id | Invalid Seafile-Content-Range
    • 440 Invalid filename
    • 441 File already exists
    • 442 File size is too large
    • 443 Out of quota
    • 500 Internal error

    Step 3, let the server to commit the file

    1. POST commiturl: `http://server-address:8082/upload-blks-api/<token>?commitonly=true&ret-json=true`

    The content is in multipart form-data format. Fields and corresponding values are:

    Request parameters

    • parent_dir: parent directory path
    • file_name: file name
    • file_size: file size in bytes
    • replace: whether overwrite file with the same name. 1 for replace, 0 for not replace.
    • blockids: block id list of the file in JSON list format

    Sample request

    1. curl -d "parent_dir=/&file_name=1.md&file_size=1234&replace=0&blockids=["1faee57feb464aa1f61165722c93a5075d1993ff","0cfc000bbde26a7b9d4754103501af76a7a36f89"]" -H 'Accept: application/json; charset=utf-8; indent=4' https://dev.seafile.com/seafhttp/upload-blks-api/389479a2-01fb-4073-8cd3-8f5115e78fc9?commitonly=true&ret-json=true

    Sample response

    If you set ‘ret-json’ into url arguments, new_file_id will be returned

    1. {
    2. "id": "4ccd37916552e2943314027931edd0b45240be7c"
    3. }

    Errors

    • 400 Invalid URL | Access denied | Duplicate progress id | Invalid Seafile-Content-Range
    • 440 Invalid filename
    • 441 File already exists
    • 442 File size is too large
    • 443 Out of quota
    • 446 Block missing
    • 403 Permission denied
    • 500 Internal error

    GET https://cloud.seafile.com/api2/repos/{repo-id}/update-blks-link/

    Request parameters

    • repo-id

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" https://cloud.seafile.com/api2/repos/99b758e6-91ab-4265-b705-925367374cf0/update-blks-link/

    Sample response

    1. "https://cloud.seafile.com/seafhttp/update-blks-api/402c6d48-fe52-4592-97dd-85f462f03d66"

    Errors

    • 403 Can not access repo
    • 520 above quota

    File Comments" class="reference-link">File Comments

    Get Comment" class="reference-link">Get Comment

    GET https://cloud.seafile.com/api2/repos/{repo_id}/file/comments/{pk}/

    • rpeo_id
    • pk

    Sample request

    1. curl -H "Authorization: Token 05b05e30ee979e333ff33a437988820494fb0afd" https://cloud.seafile.com/api2/repos/4674c2bb-3702-4dd0-b768-8952db27ac87/file/comments/1/

    Sample response

    1. {
    2. "comment": "welcome",
    3. "repo_id": "4674c2bb-3702-4dd0-b768-8952db27ac87",
    4. "item_name": "q",
    5. "created_at": "2017-10-10T02:42:20+00:00",
    6. "parent_path": "/",
    7. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    8. "user_name": "admin",
    9. "id": 3,
    10. "user_email": "admin@admin.com",
    11. "user_contact_email": "admin@admin.com"
    12. }

    Errors

    • 400 Wrong comment id
    • 403 Can not access repo

    Delete Comment" class="reference-link">Delete Comment

    Delete https://cloud.seafile.com/api2/repos/{repo_id}/file/comments/{pk}/

    • rpeo_id
    • pk

    Sample request

    1. curl -X DELETE -H "Authorization: Token 05b05e30ee979e333ff33a437988820494fb0afd" https://cloud.seafile.com/api2/repos/4674c2bb-3702-4dd0-b768-8952db27ac87/file/comments/1/

    Sample response

    1. None

    Errors

    • 400 Wrong comment id
    • 403 Can not access repo
    • 403 Permission denied

    List Comments" class="reference-link">List Comments

    GET https://cloud.seafile.com/api2/repos/{repo_id}/file/comments/?p=/doc/doc

    • rpeo_id
    • p

    Sample request

    1. curl -H "Authorization: Token 05b05e30ee979e333ff33a437988820494fb0afd" https://cloud.seafile.com/api2/repos/4674c2bb-3702-4dd0-b768-8952db27ac87/file/comments/?p=%2Fdoc%2Fdoc

    Sample response

    1. {
    2. "comments": [
    3. {
    4. "comment": "word",
    5. "repo_id": "4674c2bb-3702-4dd0-b768-8952db27ac87",
    6. "item_name": "doc",
    7. "created_at": "2017-10-11T02:49:42+00:00",
    8. "parent_path": "/doc",
    9. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    10. "user_name": "admin",
    11. "id": 7,
    12. "user_email": "admin@admin.com",
    13. "user_contact_email": "admin@admin.com"
    14. },
    15. {
    16. "comment": "help",
    17. "repo_id": "4674c2bb-3702-4dd0-b768-8952db27ac87",
    18. "item_name": "doc",
    19. "created_at": "2017-10-11T02:49:44+00:00",
    20. "parent_path": "/doc",
    21. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    22. "user_name": "admin",
    23. "id": 8,
    24. "user_email": "admin@admin.com",
    25. "user_contact_email": "admin@admin.com"
    26. },
    27. {
    28. "comment": "test",
    29. "repo_id": "4674c2bb-3702-4dd0-b768-8952db27ac87",
    30. "item_name": "doc",
    31. "created_at": "2017-10-11T03:32:37+00:00",
    32. "parent_path": "/doc",
    33. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    34. "user_name": "admin",
    35. "id": 10,
    36. "user_email": "admin@admin.com",
    37. "user_contact_email": "admin@admin.com"
    38. }
    39. ]
    40. }

    Errors

    • 400 Wrong path
    • 403 Can not access repo

    Post Comments" class="reference-link">Post Comments

    POST https://cloud.seafile.com/api2/repos/{repo_id}/file/comments/?p=/doc/doc

    • rpeo_id
    • p
    • comment

    Sample request

    1. curl -X POST -d "comment=hello" -H "Authorization: Token 05b05e30ee979e333ff33a437988820494fb0afd" https://cloud.seafile.com/api2/repos/4674c2bb-3702-4dd0-b768-8952db27ac87/file/comments/?p=%2Fdoc%2Fdoc

    Sample response

    1. {
    2. "comment": "hello",
    3. "repo_id": "4674c2bb-3702-4dd0-b768-8952db27ac87",
    4. "item_name": "doc",
    5. "created_at": "2017-10-11T06:43:31+00:00",
    6. "parent_path": "/doc",
    7. "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
    8. "user_name": "admin",
    9. "id": 11,
    10. "user_email": "admin@admin.com",
    11. "user_contact_email": "admin@admin.com"
    12. }

    Errors

    • 400 Wrong path
    • 400 Comment can not be empty
    • 403 Can not access repo
    • 404 File not found
    • 500 Internal error

    Get Number of Comments" class="reference-link">Get Number of Comments

    GET https://cloud.seafile.com/api2/repos/{repo_id}/file/comments/counts/?p=/doc

    • rpeo_id
    • p

    Sample request

    get the number of file comment correspoding to the file under the folder

    1. curl -H "Authorization: Token 05b05e30ee979e333ff33a437988820494fb0afd" -sS 'https://cloud.seafile.com/api2/repos/4674c2bb-3702-4dd0-b768-8952db27ac87/file/comments/counts/?p=/doc'

    Sample response

    1. [
    2. {
    3. "doc": 3
    4. },
    5. {
    6. "pdfs": 1
    7. }
    8. ]

    Errors

    • 400 Wrong path
    • 403 Can not access repo
    • 404 Folder not found
    • 500 Internal error

    GEThttp://192.168.1.113:8000/api/v2.1/smart-link/?repo_id={repo_id}&path={path}&is_dir={is_dir}

    Request parameters

    • repo_id
    • path, path of file/folder.
    • is_dir, true or false.

    Sample request for view

    1. curl -H "Authorization: Token 1cb7908b876d9b1708c757a347f2e6346456ab91" -H 'Accept: application/json; indent=4' "http://192.168.1.113:8000/api/v2.1/smart-link/?repo_id=d4f596ed-09ea-4ac6-8d59-12acbd089097&path=/8.md&is_dir=false"

    Sample response

    1. {
    2. "smart_link": "http://192.168.1.113:8000/smart-link/3eb1657f-db82-4329-a05e-9c087022fb2f/8.md"
    3. }

    Errors

    • 400 repo_id/path/is_dir invalid.
    • 400 is_dir can only be ‘true’ or ‘false’.
    • 403 Permission denied.
    • 404 Library/Foldef/File/ not found.
    • 500 Internal Server Error

    Directory" class="reference-link">Directory

    List Directory Entries" class="reference-link">List Directory Entries

    GET https://cloud.seafile.com/api2/repos/{repo-id}/dir/

    • repo-id
    • p (optional): The path to a directory. If p is missing, then defaults to ‘/‘ which is the top directory.
    • oid (optional): The object id of the directory. The object id is the checksum of the directory contents.
    • t (optional): If set t argument as f, will only return file entries, and d for only dir entries.
    • recursive (optional): If set t argument as d AND recursive argument as 1, return all dir entries recursively

    Sample request

    request file/dir list of a folder.

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/99b758e6-91ab-4265-b705-925367374cf0/dir/?p=/foo

    Sample response

    If oid is the same as the current oid of the directory, returns "uptodate" , else returns

    1. [
    2. {
    3. "id": "0000000000000000000000000000000000000000",
    4. "type": "file",
    5. "name": "test1.c",
    6. "size": 0
    7. },
    8. {
    9. "id": "e4fe14c8cda2206bb9606907cf4fca6b30221cf9",
    10. "type": "dir",
    11. "name": "test_dir"
    12. }
    13. ]

    Sample request

    request recursive dir list of a folder.

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d9b477fd" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api2/repos/99b758e6-91ab-4265-b705-925367374cf0/dir/?t=d&recursive=1'

    Sample response

    1. [{'id': u'5e307101cad46398fb5fe52d9177836f73c4bae8',
    2. 'mtime': 1471490386,
    3. 'name': u'123',
    4. 'parent_dir': u'/video',
    5. 'permission': u'rw',
    6. 'type': 'dir'},
    7. {'id': u'0000000000000000000000000000000000000000',
    8. 'mtime': 1471490391,
    9. 'name': u'123-2',
    10. 'parent_dir': u'/video',
    11. 'permission': u'rw',
    12. 'type': 'dir'},
    13. {'id': u'0000000000000000000000000000000000000000',
    14. 'mtime': 1471490379,
    15. 'name': u'456',
    16. 'parent_dir': u'/video/123',
    17. 'permission': u'rw',
    18. 'type': 'dir'},
    19. {'id': u'0000000000000000000000000000000000000000',
    20. 'mtime': 1471490386,
    21. 'name': u'456-2',
    22. 'parent_dir': u'/video/123',
    23. 'permission': u'rw',
    24. 'type': 'dir'},
    25. {'id': u'd8f5f80fbd89bf5634dcf9e21b569c487541d34e',
    26. 'mtime': 1471490391,
    27. 'name': u'video',
    28. 'parent_dir': '/',
    29. 'permission': u'rw',
    30. 'type': 'dir'}
    31. ]

    Errors

    • 404 The path is not exist.
    • 440 Repo is encrypted, and password is not provided.
    • 520 Operation failed..

    Get Directory Detail" class="reference-link">Get Directory Detail

    GET http://192.168.1.113:8000/api/v2.1/repos/{repo_id}/dir/detail/?path={path}

    • repo_id
    • path, should not be /.

    Sample request

    1. curl -H "Authorization: Token e71c00e93af863ba9bcddb61a46bb4de11d713fc" -H 'Accept: application/json; indent=4' "http://192.168.1.113:8000/api/v2.1/repos/d4f596ed-09ea-4ac6-8d59-12acbd089097/dir/detail/?path=Develop"

    Sample response

    1. {
    2. "repo_id": "d4f596ed-09ea-4ac6-8d59-12acbd089097",
    3. "name": "Develop",
    4. "file_count": 4,
    5. "dir_count": 1,
    6. "mtime": "2018-01-05T17:45:41+08:00",
    7. "path": "/Develop/",
    8. "size": 397888
    9. }

    Errors

    • 400 path invalid.
    • 403 Permission denied.
    • 404 Folder not found.
    • 404 Library not found.
    • 500 Internal Server Error

    Create New Directory" class="reference-link">Create New Directory

    POST https://cloud.seafile.com/api2/repos/{repo-id}/dir/

    • repo-id
    • p
    • operation=mkdir (post)

    Sample request

    1. curl -d "operation=mkdir" -v -H 'Authorization: Token 076de58233c09f19e7a5179abff14ad55987350e' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/21b941c2-5411-4372-a514-00b62ab99ef2/dir/?p=/foo

    Sample response

    1. ...
    2. < HTTP/1.0 201 CREATED
    3. < Location: https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/dir/?p=/foo
    4. ...
    5. "success"

    Success

    Response code 201(Created) is returned, and Location header provides the url of created directory.

    Errors

    • 400 Path is missing or invalid(e.g. p=/)
    • 520 Operation failed.

    Notes

    Newly created directory will be renamed if the name is duplicated.

    Rename Directory" class="reference-link">Rename Directory

    POST https://cloud.seafile.com/api2/repos/{repo-id}/dir/?p=/foo

    Parameters

    • repo-id
    • p (path)
    • operation=rename
    • newname (the new name of the directory)

    Sample request

    1. curl -d "operation=rename&newname=pinkfloyd_newfolder" -v -H 'Authorization: Tokacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/dir/?p=/foo

    Success

    Response code 200 if everything is ok

    Errors

    • 403 if You do not have permission to rename a folder
    • 400 if newname is not given
    • 520 if Failed to rename directory (generic problem)

    Notes

    If the new name is the same of the old name no operation will be done.

    Delete Directory" class="reference-link">Delete Directory

    DELETE https://cloud.seafile.com/api2/repos/{repo-id}/dir/

    • repo-id
    • p

    Sample request

    1. curl -X DELETE -v -H 'Authorization: Token f2210dacd3606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/dir/?p=/foo

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Success

    Response code is 200(OK), and a string "success" is returned.

    Errors

    • 400 Path is missing or invalid(e.g. p=/)
    • 520 Operation failed.

    Note

    This can also be used to delete file.

    Download Directory" class="reference-link">Download Directory

    Perform the following two steps to download directory

    Get Task Token" class="reference-link">Get Task Token

    GET https://cloud.seafile.com/api/v2.1/repos/{repo-id}/zip-task/?parent_dir={parent_dir}&dirents={dir}

    • repo-id
    • parent_dir
    • dirents

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/zip-task/?parent_dir=/&dirents=my_dir_name"

    Sample response

    1. {
    2. "zip_token": "b2272645-35ee-44ce-8f68-07c022107015"
    3. }

    Errors

    • 400 parent_dir/dirents invalid.
    • 400 Unable to download directory: size is too large.
    • 404 Library/Folder not found.
    • 403 Permission denied.
    • 500 Internal Server Error

    Revert Directory" class="reference-link">Revert Directory

    PUT https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/revert/

    • repo_id
    • p
    • commit_id

    Sample request

    1. curl -X PUT -d "p=/456&commit_id=b1a33768517f65ac7d618ff078dd27855374c7e0" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api2/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/dir/revert/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 path invalid.
    • 400 commit_id invalid.
    • 404 Library/Folder not found.
    • 403 Permission denied.
    • 500 Internal Server Error
    Query Task Progress" class="reference-link">Query Task Progress

    Use the token returned from previous request to check if task progress finished.

    GET https://cloud.seafile.com/api/v2.1/query-zip-progress/?token={token}

    • token

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/query-zip-progress/?token=b2272645-35ee-44ce-8f68-07c022107015"

    Sample response

    If zipped is equal to total, means task finished.

    1. {
    2. "zipped":2,
    3. "total":2
    4. }

    Errors

    • 400 token invalid.
    • 500 Internal Server Error

    After the task finished, you can manually generate directory download url with the zip_token:

    1. FILE_SERVER_ROOT/zip/{zip_token}

    For example, https://cloud.seafile.com/seafhttp/zip/b2272645-35ee-44ce-8f68-07c022107015 is the final url here.

    Asynchronously Copy/Move File/Directory" class="reference-link">Asynchronously Copy/Move File/Directory

    Get Task Id" class="reference-link">Get Task Id

    POST https://cloud.seafile.com/api/v2.1/copy-move-task/

    Request parameters

    • src_repo_id
    • src_parent_dir
    • src_dirent_name
    • dst_repo_id
    • dst_parent_dir
    • operation, copy or move
    • dirent_type, file or dir

    Sample request

    Sample for copy file.

    1. curl -d "src_repo_id=534258e2-761b-465c-9e2c-56e021d3853f&src_parent_dir=/&src_dirent_name=file.md&dst_repo_id=a3fa768d-0f00-4343-8b8d-07b4077881db&dst_parent_dir=/&operation=copy&dirent_type=file" -H 'Authorization: Token ae265ae599a29c238ca25fb63087859798d5f55d' -H 'Accept: application/json; charset=utf-8; indent=4' 'http://192.168.1.124:8000/api/v2.1/copy-move-task/'

    Sample response

    1. {
    2. "task_id": "d1ca2b8c-8ab8-4dd4-8ad7-842130764484"
    3. }

    Errors

    • 400 path/operation/dirent_type invalid.
    • 404 Library/Folder not found.
    • 403 Permission denied.
    • 500 Internal Server Error

    Cancel Task" class="reference-link">Cancel Task

    DELETE https://cloud.seafile.com/api/v2.1/copy-move-task/

    Request parameters

    • task_id

    Sample request

    1. curl -X DELETE -d "task_id=d1ca2b8c-8ab8-4dd4-8ad7-842130764484" -H 'Authorization: Token ae265ae599a29c238ca25fb63087859798d5f55d' -H 'Accept: application/json; charset=utf-8; indent=4' 'http://192.168.1.124:8000/api/v2.1/copy-move-task/'

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 task_id invalid.
    • 500 Internal Server Error

    Query Progress" class="reference-link">Query Progress

    GET https://cloud.seafile.com/api/v2.1/query-copy-move-progress/

    Request parameters

    • task_id

    Sample request

    1. curl -H 'Authorization: Token ae265ae599a29c238ca25fb63087859798d5f55d' -H 'Accept: application/json; charset=utf-8; indent=4' 'http://192.168.1.124:8000/api/v2.1/query-copy-move-progress/?task_id=d1ca2b8c-8ab8-4dd4-8ad7-842130764484'

    Sample response

    1. {
    2. "successful": true,
    3. "canceled": false,
    4. "total": 1,
    5. "done": 1,
    6. "failed": false
    7. }

    Errors

    • 400 task_id invalid.
    • 500 Internal Server Error

    Multiple Files / Directories" class="reference-link">Multiple Files / Directories

    Copy" class="reference-link">Copy

    POST https://cloud.seafile.com/api2/repos/{repo_id}/fileops/copy/

    Request parameters

    • p: source folder path, defaults to "/"
    • file_names: list of file/folder names to copy. Multiple file/folder names can be seperated by :.
    • dst_repo: the destination repo id
    • dst_dir: the destination folder in dst_repo

    Sample request

    1. curl -d "dst_repo=bdf816e6-aba8-468c-962f-77c2fcfd1d1c&dst_dir=/1&file_names=1.md:2.md:test" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/fileops/copy/?p=/1/test-2"

    Sample response

    1. [
    2. {
    3. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    4. "parent_dir": "/1",
    5. "obj_name": "1 (2).md"
    6. },
    7. {
    8. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    9. "parent_dir": "/1",
    10. "obj_name": "2 (2).md"
    11. },
    12. {
    13. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    14. "parent_dir": "/1",
    15. "obj_name": "test (2)"
    16. }
    17. ]

    Errors

    • 400 missing argument
    • 403 You do not have permission to copy file
    • 404 repo not found
    • 502 failed to copy file

    Move" class="reference-link">Move

    POST https://cloud.seafile.com/api2/repos/{repo_id}/fileops/move/

    Request parameters

    • p: source folder path, defaults to "/"
    • file_names: list of file/folder names to move. Multiple file/folder names can be seperated by :.
    • dst_repo: the destination repo id
    • dst_dir: the destination folder in dst_repo

    Sample request

    1. curl -d "dst_repo=bdf816e6-aba8-468c-962f-77c2fcfd1d1c&dst_dir=/1&file_names=1.md:2.md:test" -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; indent=4' "https://cloud.seafile.com/api2/repos/bdf816e6-aba8-468c-962f-77c2fcfd1d1c/fileops/move/?p=/1/test-2"

    Sample response

    1. [
    2. {
    3. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    4. "parent_dir": "/1",
    5. "obj_name": "1 (3).md"
    6. },
    7. {
    8. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    9. "parent_dir": "/1",
    10. "obj_name": "2 (3).md"
    11. },
    12. {
    13. "repo_id": "bdf816e6-aba8-468c-962f-77c2fcfd1d1c",
    14. "parent_dir": "/1",
    15. "obj_name": "test (3)"
    16. }
    17. ]

    Errors

    • 400 missing argument
    • 403 You do not have permission to move file
    • 404 repo not found
    • 502 failed to move file

    Delete" class="reference-link">Delete

    POST https://cloud.seafile.com/api2/repos/{repo_id}/fileops/delete/

    Request parameters

    • p: source folder path, defaults to "/"
    • file_names: list of file/folder names to delete. Multiple file/folder names can be seperated by :.

    Sample request

    1. curl -d "file_names=foo.c:bar.c:dir1:dir2" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' https://cloud.seafile.com/api2/repos/c7436518-5f46-4296-97db-2fcba4c8c8db/fileops/delete/?p=src_path

    Sample response

    1. "success"

    Errors

    • 400 missing argument
    • 403 You do not have permission to delete file
    • 404 repo not found
    • 502 failed to delete file

    Download" class="reference-link">Download

    Perform the following two steps to download multiple files and directories.

    Get Task Token" class="reference-link">Get Task Token

    GET https://cloud.seafile.com/api/v2.1/repos/{repo-id}/zip-task/?parent_dir={parent_dir}&dirents={dir,file}

    • repo-id
    • parent_dir
    • dirents

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/repos/7460f7ac-a0ff-4585-8906-bb5a57d2e118/zip-task/?parent_dir=/&dirents=my_dir_name&dirents=my_file_name"

    Sample response

    1. {
    2. "zip_token": "b2272645-35ee-44ce-8f68-07c022107015"
    3. }

    Errors

    • 400 parent_dir/dirents invalid.
    • 400 Unable to download directory: size is too large.
    • 404 Library/Folder not found.
    • 403 Permission denied.
    • 500 Internal Server Error
    Query Task Progress" class="reference-link">Query Task Progress

    Use the token returned from previous request to check if task progress finished.

    GET https://cloud.seafile.com/api/v2.1/query-zip-progress/?token={token}

    • token

    Sample request

    1. curl -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' -H 'Accept: application/json; charset=utf-8; indent=4' "https://cloud.seafile.com/api/v2.1/query-zip-progress/?token=b2272645-35ee-44ce-8f68-07c022107015"

    Sample response

    If zipped is equal to total, means task finished.

    1. {
    2. "zipped":2,
    3. "total":2
    4. }

    Errors

    • 400 token invalid.
    • 500 Internal Server Error

    After the task finished, you can manually generate directory download url with the zip_token:

    1. FILE_SERVER_ROOT/zip/{zip_token}

    For example, https://cloud.seafile.com/seafhttp/zip/b2272645-35ee-44ce-8f68-07c022107015 is the final url here.

    Avatar" class="reference-link">Avatar

    Update User Avatar" class="reference-link">Update User Avatar

    POST https://cloud.seafile.com/api/v2.1/user-avatar/

    Request parameters

    • avatar: image file

    Sample request

    1. curl -H "Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154" -F "avatar=@1.jpg" https://cloud.seafile.com/api/v2.1/user-avatar/

    Sample response

    1. {"success": true}

    Errors

    • 400 invalid file extension
    • 400 file is too big
    • 500 Internal Server Error

    Get User Avatar" class="reference-link">Get User Avatar

    GET https://cloud.seafile.com/api2/avatars/user/{user}/resized/{size}/

    Request parameters

    • user
    • size

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/avatars/user/user@example.com/resized/80/"

    Sample response

    1. {
    2. "url": "http://127.0.0.1:8000/media/avatars/default.png",
    3. "is_default": true,
    4. "mtime": 0
    5. }

    Get Group Avatar" class="reference-link">Get Group Avatar

    GET https://cloud.seafile.com/api2/avatars/group/{group_id}/resized/{size}/

    Request parameters

    • group_id
    • size

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/avatars/group/1/resized/80/"

    Sample response

    1. {
    2. "url": "http://127.0.0.1:8000/media/avatars/groups/default.png",
    3. "is_default": true,
    4. "mtime": 0
    5. }

    Devices" class="reference-link">Devices

    Get User Devices" class="reference-link">Get User Devices

    GET https://cloud.seafile.com/api2/devices/

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/devices/

    Sample response

    1. [
    2. {
    3. "synced_repos": [
    4. {
    5. "repo_id": "47945b31-dedb-4b92-a048-32bf825595ce",
    6. "sync_time": 1458008928,
    7. "repo_name": "wopi"
    8. },
    9. {
    10. "repo_id": "78c620ee-2989-4427-8eff-7748f4fbebc0",
    11. "sync_time": 1457943466,
    12. "repo_name": "lib-of-lian"
    13. }
    14. ],
    15. "last_accessed": "2016-03-15T10:28:48+08:00",
    16. "device_name": "lian",
    17. "platform_version": "",
    18. "platform": "linux",
    19. "user": "lian@lian.com",
    20. "key": "99abe1a7cc7d614db0bfa19db81e42ef675abe4f",
    21. "client_version": "5.0.0",
    22. "last_login_ip": "192.168.1.16",
    23. "device_id": "be10980211752515053bf9036a13139375de0cc8"
    24. },
    25. {
    26. "last_accessed": "2016-03-15T13:59:51+08:00",
    27. "device_name": "PLK-AL10",
    28. "platform_version": "5.0.2",
    29. "platform": "android",
    30. "user": "lian@lian.com",
    31. "key": "067051c94163ed193f2131d48c61882daa7cb238",
    32. "client_version": "2.0.3",
    33. "last_login_ip": "192.168.1.208",
    34. "device_id": "4a0d62c1f27b3b74"
    35. }
    36. ]

    Errors

    • 401 UNAUTHORIZED

    DELETE https://cloud.seafile.com/api2/devices/

    Request parameters

    • platform
    • device_id

    Sample request

    1. curl -X DELETE -d "platform=linux&device_id=be10980211752515053bf9036a13139375de0cc8" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/devices/

    Sample response

    1. {"success": true}

    Errors

    • 400 platform invalid
    • 400 device_id invalid
    • 500 Internal Server Error

    Snapshot Label" class="reference-link">Snapshot Label

    Get Snapshot Label" class="reference-link">Get Snapshot Label

    GET https://cloud.seafile.com/api/v2.1/revision-tags/tag-names/

    Sample request

    Sample for get snapshot label

    1. curl -H 'Authorization: Token 88aaa1e6fe35d0444868b4c67f8ca1766cf82f55' -H 'Accept: application/json; indent=4' http://cloud.seafile.com/api/v2.1/revision-tags/tag-names/

    Sample response

    1. [
    2. "q1",
    3. "qwe",
    4. "qwe",
    5. "qwe_-.12",
    6. "qwe_-1.",
    7. "r",
    8. "r",
    9. "v3",
    10. "\u4e2d\u6587",
    11. "\u82f1\u6587"
    12. ]

    Create New Snapshot Label" class="reference-link">Create New Snapshot Label

    POST https://cloud.seafile.com/api/v2.1/revision-tags/tagged-items/

    Request parameters

    • repo_id
    • commit_id, optional
    • tag_names

    Sample request

    Sample for create snapshot label.

    1. curl -d "repo_id=7377c95d-b303-4914-a555-306651cc4cbf&commit_id=4c03938da11e83d6c1d3e8ff469e92f46a80eeaf&tag_names=v2.1,v2.2" -H 'Authorization: Token 88aaa1e6fe35d0444868b4c67f8ca1766cf82f55' -H 'Accept: application/json; indent=4' http://cloud.seafile.com/api/v2.1/revision-tags/tagged-items/

    Sample response

    1. {
    2. "revisionTags": [
    3. {
    4. "tag": "v2.1",
    5. "tag_creator": "foo@foo.com",
    6. "revision": {
    7. "commit_id": "4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    8. "repo_id": "7377c95d-b303-4914-a555-306651cc4cbf",
    9. "contact_email": "foo@foo.com",
    10. "name": "foo",
    11. "time": "2017-09-13T15:20:54+08:00",
    12. "link": "/repo/history/view/7377c95d-b303-4914-a555-306651cc4cbf/?commit_id=4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    13. "email": "foo@foo.com",
    14. "description": "Added \"ca (1).js\"."
    15. }
    16. },
    17. {
    18. "tag": "v2.2",
    19. "tag_creator": "foo@foo.com",
    20. "revision": {
    21. "commit_id": "4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    22. "repo_id": "7377c95d-b303-4914-a555-306651cc4cbf",
    23. "contact_email": "foo@foo.com",
    24. "name": "foo",
    25. "time": "2017-09-13T15:20:54+08:00",
    26. "link": "/repo/history/view/7377c95d-b303-4914-a555-306651cc4cbf/?commit_id=4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    27. "email": "foo@foo.com",
    28. "description": "Added \"ca (1).js\"."
    29. }
    30. }
    31. ]
    32. }

    Errors

    • 400 repo_id/commit_id/tag_names invalid.
    • 403 Permission denied(need rw permission).

    Update Snapshot Label" class="reference-link">Update Snapshot Label

    PUT https://cloud.seafile.com/api/v2.1/revision-tags/tagged-items/

    Request parameters

    • repo_id
    • commit_id(default is head commit if commit_id is empty)
    • tag_names

    Sample request

    Sample for update snapshot label.

    1. curl -X PUT -d "repo_id=7377c95d-b303-4914-a555-306651cc4cbf&commit_id=4c03938da11e83d6c1d3e8ff469e92f46a80eeaf&tag_names=v3" -H 'Authorization: Token 88aaa1e6fe35d0444868b4c67f8ca1766cf82f55' -H 'Accept: application/json; indent=4' http://cloud.seafile.com/api/v2.1/revision-tags/tagged-items/

    Sample response

    1. {
    2. "revisionTags": [
    3. {
    4. "tag": "v3",
    5. "tag_creator": "foo@foo.com",
    6. "revision": {
    7. "commit_id": "4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    8. "repo_id": "7377c95d-b303-4914-a555-306651cc4cbf",
    9. "contact_email": "foo@foo.com",
    10. "name": "foo",
    11. "time": "2017-09-13T15:20:54+08:00",
    12. "link": "/repo/history/view/7377c95d-b303-4914-a555-306651cc4cbf/?commit_id=4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    13. "email": "foo@foo.com",
    14. "description": "Added \"ca (1).js\"."
    15. }
    16. }
    17. ]
    18. }

    Errors

    • 400 repo_id/commit_id/tag_names invalid.
    • 403 Permission denied(need rw permission).

    Delete Snapshot Label" class="reference-link">Delete Snapshot Label

    Delete https://cloud.seafile.com/api/v2.1/revision-tags/tagged-items/

    Request parameters

    • repo_id
    • tag_name

    Sample request

    Sample for update snapshot label.

    1. curl -X DELETE -H 'Authorization: Token 88aaa1e6fe35d0444868b4c67f8ca1766cf82f55' -H 'Accept: application/json; indent=4' -sS 'http://cloud.seafile.com/api/v2.1/revision-tags/tagged-items/?repo_id=7377c95d-b303-4914-a555-306651cc4cbf&tag_names=v3'

    Sample response

    1. {}

    Errors

    • 400 repo_id/tag_names invalid.
    • 403 Permission denied(need rw permission).

    Get File Activities" class="reference-link">Get File Activities

    GET https://cloud.seafile.com/api2/events/

    Request parameters

    this api will only return first 15 records of activities. if want get more, pass start parameter

    • start (default 0)
    • size (size of user avatar, default 36)

    Sample request

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/events/"

    Sample response

    1. {'events': [{'author': u'lian@lian.com',
    2. 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
    3. 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    4. 'date': '2016-05-06',
    5. 'etype': u'repo-delete',
    6. 'name': u'lian',
    7. 'nick': u'lian',
    8. 'repo_id': u'13e2ae06-8927-465b-8f57-319b3a7cfbdd',
    9. 'repo_name': u'2',
    10. 'time': 1462552942,
    11. 'time_relative': u'<time datetime="2016-05-06T16:42:22.967104" is="relative-time" title="Fri, 6 May 2016 16:42:22 +0800" >19 hours ago</time>'},
    12. {'author': u'lian@lian.com',
    13. 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
    14. 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    15. 'commit_id': u'1be92d40a1b526863bbf39e8abdae7d317a1195f',
    16. 'converted_cmmt_desc': u'Modified "<a href="/convert_cmmt_desc_link/?repo_id=47945b31-dedb-4b92-a048-32bf825595ce&cmmt_id=1be92d40a1b526863bbf39e8abdae7d317a1195f&nm=excel-view.xlsx" class="normal">excel-view.xlsx</a>"',
    17. 'date': '2016-04-25',
    18. 'desc': u'Modified "excel-view.xlsx"',
    19. 'etype': u'repo-update',
    20. 'more_files': False,
    21. 'name': u'lian',
    22. 'nick': u'lian',
    23. 'repo_encrypted': False,
    24. 'repo_id': u'47945b31-dedb-4b92-a048-32bf825595ce',
    25. 'repo_name': u'wopi',
    26. 'time': 1461569125,
    27. 'time_relative': u'<time datetime="2016-04-25T15:25:25" is="relative-time" title="Mon, 25 Apr 2016 15:25:25 +0800" >11 days ago</time>'}
    28. ...
    29. ],
    30. 'more': True,
    31. 'more_offset': 15}

    Sample request for more activities

    1. curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/events/?start=15"

    Sample response for more activities

    1. {'events': [{'author': u'lian@lian.com',
    2. 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
    3. 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    4. 'date': '2016-05-06',
    5. 'etype': u'repo-delete',
    6. 'name': u'lian',
    7. 'nick': u'lian',
    8. 'repo_id': u'13e2ae06-8927-465b-8f57-319b3a7cfbdd',
    9. 'repo_name': u'2',
    10. 'time': 1462552942,
    11. 'time_relative': u'<time datetime="2016-05-06T16:42:22.967104" is="relative-time" title="Fri, 6 May 2016 16:42:22 +0800" >19 hours ago</time>'},
    12. {'author': u'lian@lian.com',
    13. 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
    14. 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    15. 'commit_id': u'1be92d40a1b526863bbf39e8abdae7d317a1195f',
    16. 'converted_cmmt_desc': u'Modified "<a href="/convert_cmmt_desc_link/?repo_id=47945b31-dedb-4b92-a048-32bf825595ce&cmmt_id=1be92d40a1b526863bbf39e8abdae7d317a1195f&nm=excel-view.xlsx" class="normal">excel-view.xlsx</a>"',
    17. 'date': '2016-04-25',
    18. 'desc': u'Modified "excel-view.xlsx"',
    19. 'etype': u'repo-update',
    20. 'more_files': False,
    21. 'name': u'lian',
    22. 'nick': u'lian',
    23. 'repo_encrypted': False,
    24. 'repo_id': u'47945b31-dedb-4b92-a048-32bf825595ce',
    25. 'repo_name': u'wopi',
    26. 'time': 1461569125,
    27. 'time_relative': u'<time datetime="2016-04-25T15:25:25" is="relative-time" title="Mon, 25 Apr 2016 15:25:25 +0800" >11 days ago</time>'}
    28. ...
    29. ],
    30. 'more': True,
    31. 'more_offset': 30}

    Get Thumbnail Image" class="reference-link">Get Thumbnail Image

    GET https://cloud.seafile.com/api2/repos/{repo_id}/thumbnail/

    Request parameters

    • repo_id
    • p
    • size

    Sample request

    1. curl -H 'Authorization: Token 40f9a510a0629430865dc199a3880898ad2e48fc' https://cloud.seafile.com/api2/repos/fbead5d0-4817-4446-92f3-7ac8e6a8e5f5/thumbnail/?p=/5.jpg\&size=123 > thumbnail.png

    Search User" class="reference-link">Search User

    GET https://cloud.seafile.com/api2/search-user/?q=foo

    Request parameters

    • q

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/search-user/?q=foo

    Sample response

    1. [
    2. {'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    3. 'contact_email': u'foo@foo.com',
    4. 'email': u'foo@foo.com',
    5. 'name': 'foo'},
    6. {'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
    7. 'contact_email': u'foo-bar@foo-bar.com',
    8. 'email': u'foo-bar@foo-bar.com',
    9. 'name': 'foo-bar'}
    10. ]

    Errors

    • 400 Argument missing.
    • 403 Guest user can not use global address book.

    Note: The following APIs are only available since Seafile v5.1.

    Admin Only" class="reference-link">Admin Only

    Account" class="reference-link">Account

    List Accounts" class="reference-link">List Accounts

    GET https://cloud.seafile.com/api2/accounts/

    Request parameters

    • start (default to 0)
    • limit (default to 100)
    • scope (default None, accepted values: ‘LDAP’ or ‘DB’ or ‘LDAPImport’)

    To retrieve all users, just set both start and limit to -1.

    If scope parameter is passed then accounts will be searched inside the specific scope, otherwise it will be used the old approach: first LDAP and, if no account is found, DB.

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/

    Sample response

    1. [
    2. {
    3. "email": "foo@foo.com"
    4. },
    5. {
    6. "email": "bar@bar.com"
    7. }
    8. ]

    Errors

    • 403 Permission error, only administrator can perform this action

    Get Account Info" class="reference-link">Get Account Info

    GET https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    Sample request

    1. curl -v -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/user@mail.com/

    Sample response

    1. {
    2. "is_staff": false,
    3. "is_active": true,
    4. "id": 2,
    5. "create_time": 1356061187741686,
    6. "usage": 651463187,
    7. "total": 107374182400,
    8. "email": "user@mail.com"
    9. }

    Errors

    • 403 Permission error, only administrator can perform this action

    Create Account" class="reference-link">Create Account

    PUT https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    • password
    • is_staff (defaults to False)
    • is_active (defaults to True)

    Sample request

    1. curl -v -X PUT -d "password=123456" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/newaccount@gmail.com/

    Sample response

    1. ...
    2. < HTTP/1.0 201 CREATED
    3. < Location: https://cloud.seafile.com/api2/accounts/newaccount@gmail.com/
    4. ...
    5. "success"

    Success

    1. Response code 201(Created) is returned and the Location header provides shared link.

    Errors

    • 403 Permission error, only administrator can perform this action

    Update Account" class="reference-link">Update Account

    PUT https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    At least one of followings:

    • password
    • is_staff
    • is_active
    • name
    • note
    • storage, the unit is MB.
    • role.

    Sample request

    1. curl -v -X PUT -d "password=654321&is_staff=true&storage=100&role=guest" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/user@mail.com/

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Success

    1. Response code 200(OK) is returned.

    Errors

    • 400 Bad Request, keyword password is required
    • 403 Permission error, only administrator can perform this action

    Migrate Account" class="reference-link">Migrate Account

    POST https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    • op
    • to_user this user must exist

    Sample request

    1. curl -v -d "op=migrate&to_user=user2@mail.com" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/user@mail.com/

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...
    4. "success"

    Success

    1. Response code 200(OK) is returned.

    Errors

    • 400 Bad Request, arguments are missing or invalid
    • 403 Permission error, only administrator can perform this action

    Delete Account" class="reference-link">Delete Account

    DELETE https://cloud.seafile.com/api2/accounts/{email}/

    Sample request

    1. curl -v -X DELETE -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/newaccount@gmail.com/

    Sample response

    1. "success"

    Errors

    • 403 Permission error, only administrator can perform this action

    Devices" class="reference-link">Devices

    Get Desktop Devices" class="reference-link">Get Desktop Devices

    Get first page (50 records per page) of desktop devices.

    GET https://cloud.seafile.com/api/v2.1/admin/devices/?platform=desktop&page=1&per_page=50

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/devices/?platform=desktop&page=1&per_page=50

    Sample response

    1. [
    2. {'has_next_page': False},
    3. [
    4. {
    5. 'last_accessed': '2016-04-11T18:24:29+08:00',
    6. 'last_login_ip': u'192.168.1.210',
    7. 'platform': u'linux',
    8. 'user': u'1@1.com',
    9. 'client_version': u'2.0.4',
    10. 'device_name': u'PLK-AL10',
    11. 'device_id': u'4a0d62c1f27b3b74'
    12. }
    13. ]
    14. ]

    Errors

    • 403 Permission error, only administrator can perform this action

    Get Mobile Devices" class="reference-link">Get Mobile Devices

    Get first page (50 records per page) of mobile devices.

    GET https://cloud.seafile.com/api/v2.1/admin/devices/?platform=mobile&page=1&per_page=50

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/devices/?platform=mobile&page=1&per_page=50

    Sample response

    1. [
    2. {'has_next_page': False},
    3. [
    4. {
    5. 'last_accessed': '2016-04-11T18:24:29+08:00',
    6. 'last_login_ip': u'192.168.1.210',
    7. 'platform': u'ios',
    8. 'user': u'1@1.com',
    9. 'client_version': u'2.0.4',
    10. 'device_name': u'PLK-AL10',
    11. 'device_id': u'4a0d62c1f27b3b74'
    12. }
    13. ]
    14. ]

    Errors

    • 403 Permission error, only administrator can perform this action

    DELETE https://cloud.seafile.com/api/v2.1/admin/devices/

    Request parameters

    • platform
    • device_id
    • user

    Sample request

    1. curl -X DELETE -d "platform=linux&device_id=be10980211752515053bf9036a13139375de0cc8&user=1@1.com" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/devices/

    Sample response

    1. {"success": true}

    Errors

    • 400 platform invalid
    • 400 device_id invalid
    • 400 user invalid
    • 500 Internal Server Error

    Get Device Errors" class="reference-link">Get Device Errors

    This api is only supported in pro edition.

    GET https://cloud.seafile.com/api/v2.1/admin/device-errors/

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/device-errors/

    Sample response

    1. [
    2. {
    3. 'repo_id': u'47945b31-dedb-4b92-a048-32bf825595ce',
    4. 'device_ip': u'192.168.1.124',
    5. 'error_time': '2016-04-13T17:49:11+08:00',
    6. 'device_name': u'lian-ubuntu-1404-64',
    7. 'email': u'1@1.com',
    8. 'client_version': u'5.0.6',
    9. 'error_msg': u'No permission.',
    10. 'repo_name': u'wopi'
    11. }
    12. ]

    Errors

    • 403 Feature disabled.
    • 500 Internal Server Error

    Clean Device Errors" class="reference-link">Clean Device Errors

    This api is only supported in pro edition.

    DELETE https://cloud.seafile.com/api/v2.1/admin/device-errors/

    Sample request

    1. curl -X DELETE -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/device-errors/

    Sample response

    1. {"success":true}

    Errors

    • 403 Feature disabled.
    • 500 Internal Server Error

    Get Snapshots by Label" class="reference-link">Get Snapshots by Label

    GET https://cloud.seafile.com/api/v2.1/admin/revision-tags/tagged-items/

    Request parameters

    • user, optional
    • repo_id, optional
    • tag_name, optional
    • tag_contains, optional

    Sample request

    Sample for get snapshots by label

    1. curl -H 'Authorization: Token 88aaa1e6fe35d0444868b4c67f8ca1766cf82f55' -H 'Accept: application/json; indent=4' http://cloud.seafile.com/api/v2.1/admin/revision-tags/tagged-items/?repo_id=7377c95d-b303-4914-a555-306651cc4cbf&tag_contains=v

    Sample response

    1. [
    2. {
    3. "tag": "v3",
    4. "tag_creator": "foo@foo.com",
    5. "revision": {
    6. "commit_id": "4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    7. "repo_id": "7377c95d-b303-4914-a555-306651cc4cbf",
    8. "contact_email": "foo@foo.com",
    9. "name": "foo",
    10. "time": "2017-09-13T15:20:54+08:00",
    11. "link": "/repo/history/view/7377c95d-b303-4914-a555-306651cc4cbf/?commit_id=4c03938da11e83d6c1d3e8ff469e92f46a80eeaf",
    12. "email": "foo@foo.com",
    13. "description": "Added \"ca (1).js\"."
    14. }
    15. }
    16. ]

    Default Library" class="reference-link">Default Library

    Get User Default Library" class="reference-link">Get User Default Library

    Available for Seafile v6.0.9+

    GET https://cloud.seafile.com/api/v2.1/admin/default-library/{user_email}

    Sample request

    1. curl -H 'Authorization: Token 024692f8411a656baa2cc2d5ed4cd46177b3b3d0' "https://cloud.seafile.com/api/v2.1/admin/default-library/?user_email=foo@foo.com"

    Sample response

    1. {
    2. "repo_id":"9e58655f-d2a2-4df9-baa2-5ca50698ad98",
    3. "exists":true,
    4. "user_email":"lian@lian.com"
    5. }

    Errors

    • 400 user_email invalid.
    • 404 User not found.
    • 403 Permission error, only administrator can perform this action.
    • 500 Internal Server Error

    Create User Default Library" class="reference-link">Create User Default Library

    Available for Seafile v6.0.9+

    POST https://cloud.seafile.com/api/v2.1/admin/default-library/

    Sample request

    1. curl -d "user_email=foo@foo.com" -H 'Authorization: Token 024692f8411a656baa2cc2d5ed4cd46177b3b3d0' "https://cloud.seafile.com/api/v2.1/admin/default-library/"

    Sample response

    1. {
    2. "repo_id":"9e58655f-d2a2-4df9-baa2-5ca50698ad98",
    3. "exists":true,
    4. "user_email":"lian@lian.com"
    5. }

    Errors

    • 400 user_email invalid.
    • 403 Permission error, only administrator can perform this action.
    • 403 Permission error, user can not create library.
    • 404 User not found.
    • 500 Internal Server Error

    Libraries" class="reference-link">Libraries

    Get all Libraries" class="reference-link">Get all Libraries

    Available for Seafile v6.0.0+

    GET https://cloud.seafile.com/api/v2.1/admin/libraries/?page=1&per_page=100

    Get first page (100 records per page) of libraries.

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/libraries/?page=1&per_page=100

    Sample response

    1. {
    2. "page_info": {
    3. "current_page": 1,
    4. "has_next_page": true
    5. },
    6. "repos": [
    7. {
    8. "name": null,
    9. "encrypted": false,
    10. "file_count": 0,
    11. "owner": "lian@lian.com",
    12. "size_formatted": "0 bytes",
    13. "id": "04df5005-1dfc-4e30-ae55-95ed6559583f",
    14. "size": 0
    15. },
    16. {
    17. "name": "My Library",
    18. "encrypted": false,
    19. "file_count": 161,
    20. "owner": "lian@lian.com",
    21. "size_formatted": "25.4 MB",
    22. "id": "2deffbac-d7be-4ace-b406-efb799083ee9",
    23. "size": 26617460
    24. }
    25. ...
    26. ]
    27. }

    Errors

    • 403 Permission error, only administrator can perform this action

    Search Library by Name" class="reference-link">Search Library by Name

    Available for Seafile v6.0.0+

    GET https://cloud.seafile.com/api/v2.1/admin/libraries/?name=file

    Request parameters

    • name

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/libraries/?name=file

    Sample response

    1. {
    2. "owner": "",
    3. "repos": [
    4. {
    5. "name": "file-preview",
    6. "encrypted": false,
    7. "file_count": 25,
    8. "owner": "lian@lian.com",
    9. "size_formatted": "10.9 MB",
    10. "id": "6ce1383b-ed1c-45c7-ab31-a13b64471e64",
    11. "size": 11437897
    12. }
    13. ],
    14. "name": "file"
    15. }

    Errors

    • 403 Permission error, only administrator can perform this action

    Search Library by Owner" class="reference-link">Search Library by Owner

    Available for Seafile v6.0.0+

    GET lian@lian.com"">https://cloud.seafile.com/api/v2.1/admin/libraries/?owner=lian@lian.com

    Request parameters

    • owner

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/libraries/?owner=lian@lian.com

    Sample response

    1. {
    2. "owner": "lian@lian.com",
    3. "repos": [
    4. {
    5. "name": "lib-of-lian",
    6. "encrypted": false,
    7. "file_count": 0,
    8. "owner": "lian@lian.com",
    9. "size_formatted": "16.5 KB",
    10. "id": "78c620ee-2989-4427-8eff-7748f4fbebc0",
    11. "size": 16883
    12. },
    13. {
    14. "name": "encrypted",
    15. "encrypted": true,
    16. "file_count": 0,
    17. "owner": "lian@lian.com",
    18. "size_formatted": "18.1 MB",
    19. "id": "47695bb8-3364-4274-939d-3c5a0df9710c",
    20. "size": 18997225
    21. },
    22. ...
    23. ],
    24. "name": ""
    25. }

    Errors

    • 403 Permission error, only administrator can perform this action

    Delete a Library" class="reference-link">Delete a Library

    Available for Seafile v6.0.0+

    DELETE https://cloud.seafile.com/api/v2.1/admin/libraries/{repo_id}/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/libraries/ee3b2d19-1a06-47f0-bbfa-554cab3bdedc/

    Sample response

    1. {"success":true}

    Errors

    • 403 Permission error, only administrator can perform this action

    Transfer a Library" class="reference-link">Transfer a Library

    Available for Seafile v6.0.0+

    PUT https://cloud.seafile.com/api/v2.1/admin/libraries/{repo_id}/

    Sample request

    1. curl -X PUT -d "owner=1@1.com" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/libraries/ee3b2d19-1a06-47f0-bbfa-554cab3bdedc/

    Sample response

    1. {
    2. "name": "test-repo",
    3. "encrypted":false,
    4. "file_count":0,
    5. "owner":"1@1.com",
    6. "size_formatted":"0 bytes",
    7. "id":"ee3b2d19-1a06-47f0-bbfa-554cab3bdedc",
    8. "size":0
    9. }

    Errors

    • 400 owner invalid.
    • 403 Permission error, only administrator can perform this action
    • 404 User not found.
    • 404 Library not found.
    • 500 Internal Server Error

    Get Library Dirents" class="reference-link">Get Library Dirents

    GET https://cloud.seafile.com/api/v2.1/admin/libraries/{repo_id}/dirents/?parent_dir={parent_dir}

    • repo-id
    • parent_dir

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/libraries/104f6537-b3a5-4d42-b8b5-8e47e494e4cf/dirents/?parent_dir=/asd

    Sample response

    1. {
    2. "repo_id": "c474a093-19dc-4ddf-b0b0-72b33214ba33",
    3. "dirent_list": [
    4. {
    5. "file_size": "",
    6. "last_update": "2016-12-19T03:35:14+00:00",
    7. "is_file": false,
    8. "obj_name": "book"
    9. },
    10. {
    11. "file_size": "",
    12. "last_update": "2016-10-12T07:43:32+00:00",
    13. "is_file": false,
    14. "obj_name": "image"
    15. },
    16. {
    17. "file_size": "47.0 KB",
    18. "last_update": "2017-02-13T02:41:05+00:00",
    19. "is_file": true,
    20. "obj_name": "123.md"
    21. }
    22. ],
    23. "is_system_library": false,
    24. "repo_name": "seacloud.cc.124"
    25. }

    Errors

    • 400 parent_dir invalid.
    • 403 Feature disabled.
    • 403 Permission error, only administrator can perform this action
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Get All Deleted Libraries" class="reference-link">Get All Deleted Libraries

    GET http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/

    • page, default 1.
    • per_page, default 100.

    Sample request

    1. curl -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/"

    Sample response

    1. {
    2. "page_info": {
    3. "current_page": 1,
    4. "has_next_page": false
    5. },
    6. "repos": [
    7. {
    8. "owner": "1@1.com",
    9. "delete_time": "2018-06-04T17:24:55+08:00",
    10. "name": "a-stor-2",
    11. "id": "ed46b580-8df7-4a2b-bb45-c3d179cfc668"
    12. },
    13. {
    14. "owner": "1@1.com",
    15. "delete_time": "2018-06-04T17:24:54+08:00",
    16. "name": "a-st",
    17. "id": "560d9b7b-fd24-4ce3-9e4a-20a953bee1b9"
    18. },
    19. {
    20. "owner": "lian@lian.com",
    21. "delete_time": "2018-06-04T17:21:35+08:00",
    22. "name": "dst",
    23. "id": "09b7d3c0-5f0d-49be-9318-7ca136f386cd"
    24. },
    25. {
    26. "owner": "lian@lian.com",
    27. "delete_time": "2018-06-04T17:21:32+08:00",
    28. "name": "k",
    29. "id": "fbf4b69c-5a46-41a3-a9a3-58c1274ec536"
    30. },
    31. {
    32. "owner": "lian@lian.com",
    33. "delete_time": "2018-06-04T17:21:29+08:00",
    34. "name": "src",
    35. "id": "d4aac5b9-28d4-4372-a4b3-d6de171402df"
    36. }
    37. ]
    38. }

    Errors

    • 403 Permission error, only administrator can perform this action
    • 500 Internal Server Error

    Get Deleted Libraries by Owner" class="reference-link">Get Deleted Libraries by Owner

    GET http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/?owner={owner}

    • owner, library owner’s email.

    Sample request

    1. curl -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/?owner=1@1.com"

    Sample response

    1. {
    2. "repos": [
    3. {
    4. "owner": "1@1.com",
    5. "delete_time": "2018-06-04T17:24:55+08:00",
    6. "name": "a-stor-2",
    7. "id": "ed46b580-8df7-4a2b-bb45-c3d179cfc668"
    8. },
    9. {
    10. "owner": "1@1.com",
    11. "delete_time": "2018-06-04T17:24:54+08:00",
    12. "name": "a-st",
    13. "id": "560d9b7b-fd24-4ce3-9e4a-20a953bee1b9"
    14. }
    15. ],
    16. "search_owner": "1@1.com"
    17. }

    Errors

    • 403 Permission error, only administrator can perform this action
    • 500 Internal Server Error

    Clean Deleted Library" class="reference-link">Clean Deleted Library

    DELETE http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/{repo_id}/

    • repo_id, deleted library’s id.

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/560d9b7b-fd24-4ce3-9e4a-20a953bee1b9/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 403 Permission error, only administrator can perform this action
    • 500 Internal Server Error

    Restore Deleted Library" class="reference-link">Restore Deleted Library

    PUT http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/d4aac5b9-28d4-4372-a4b3-d6de171402df/

    • repo_id, deleted library’s id.

    Sample request

    1. curl -X PUT -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/d4aac5b9-28d4-4372-a4b3-d6de171402df/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Library does not exist in trash.
    • 500 Internal Server Error

    Clean ALl Deleted Libraries" class="reference-link">Clean ALl Deleted Libraries

    DELETE http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.113:8000/api/v2.1/admin/trash-libraries/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 403 Permission error, only administrator can perform this action
    • 500 Internal Server Error

    Shares" class="reference-link">Shares

    Get Repo User Shares" class="reference-link">Get Repo User Shares

    Available for Seafile v6.0.1+

    GET https://cloud.seafile.com/api/v2.1/admin/shares/?repo_id={repo_id)&share_type={share_type}

    Request parameters

    • repo_id
    • share_type

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/?repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=user'

    Sample response

    1. [
    2. {
    3. "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
    4. "share_type": "user",
    5. "permission": "r",
    6. "path": "/",
    7. "user_name": "name of user 2",
    8. "user_email": "2@2.com"
    9. }
    10. ]

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Get Repo Group Shares" class="reference-link">Get Repo Group Shares

    Available for Seafile v6.0.1+

    GET https://cloud.seafile.com/api/v2.1/admin/shares/?repo_id={repo_id)&share_type={share_type}

    Request parameters

    • repo_id
    • share_type

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/?repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=group'

    Sample response

    1. [
    2. {
    3. "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
    4. "share_type": "group",
    5. "permission": "rw",
    6. "group_name": "group-of-lian-2",
    7. "path": "/",
    8. "group_id": 2
    9. }
    10. ]

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Share Repo to User" class="reference-link">Share Repo to User

    Available for Seafile v6.0.1+

    POST https://cloud.seafile.com/api/v2.1/admin/shares/

    Request parameters

    • repo_id
    • share_type
    • share_to (user email)
    • permission

    Sample request

    1. curl -d "repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=user&permission=r&share_to=1@1.com&share_to=invalid@email.com" -H "Authorization: Token 9c845638b855e549c07ff81be2a0471aa52810d7" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/'

    Sample response

    1. {
    2. "failed": [
    3. {
    4. "error_msg": "User invalid@email.com not found.",
    5. "user_email": "invalid@email.com"
    6. }
    7. ],
    8. "success": [
    9. {
    10. "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
    11. "share_type": "user",
    12. "permission": "r",
    13. "path": "/",
    14. "user_name": "name of user 1",
    15. "user_email": "1@1.com"
    16. }
    17. ]
    18. }

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Share Repo to Group" class="reference-link">Share Repo to Group

    Available for Seafile v6.0.1+

    POST https://cloud.seafile.com/api/v2.1/admin/shares/

    Request parameters

    • repo_id
    • share_type
    • share_to (group_id)
    • permission

    Sample request

    1. curl -d "repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=group&permission=r&share_to=1&share_to=1232" -H "Authorization: Token 9c845638b855e549c07ff81be2a0471aa52810d7" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/'

    Sample response

    1. {
    2. "failed": [
    3. {
    4. "group_id": 1232,
    5. "error_msg": "Group %s not found"
    6. }
    7. ],
    8. "success": [
    9. {
    10. "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
    11. "share_type": "group",
    12. "permission": "r",
    13. "group_name": "group-of-lian",
    14. "path": "/",
    15. "group_id": 1
    16. }
    17. ]
    18. }

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Modify Repo User Share Permission" class="reference-link">Modify Repo User Share Permission

    Available for Seafile v6.0.1+

    PUT https://cloud.seafile.com/api/v2.1/admin/shares/

    Request parameters

    • repo_id
    • share_type
    • share_to (user email)
    • permission

    Sample request

    1. curl -X PUT -d "repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=user&permission=rw&share_to=1@1.com" -H "Authorization: Token 9c845638b855e549c07ff81be2a0471aa52810d7" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/'

    Sample response

    1. {
    2. "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
    3. "share_type": "user",
    4. "permission": "rw",
    5. "path": "/",
    6. "user_name": "name of user 1",
    7. "user_email": "1@1.com"
    8. }

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Modify Repo Group Share Permission" class="reference-link">Modify Repo Group Share Permission

    Available for Seafile v6.0.1+

    PUT https://cloud.seafile.com/api/v2.1/admin/shares/

    Request parameters

    • repo_id
    • share_type
    • share_to (group_id)
    • permission

    Sample request

    1. curl -X PUT -d "repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=group&permission=rw&share_to=1" -H "Authorization: Token 9c845638b855e549c07ff81be2a0471aa52810d7" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/'

    Sample response

    1. {
    2. "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
    3. "share_type": "group",
    4. "permission": "rw",
    5. "group_name": "group-of-lian",
    6. "path": "/",
    7. "group_id": 1
    8. }

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Delete Repo User Share" class="reference-link">Delete Repo User Share

    Available for Seafile v6.0.1+

    DELETE https://cloud.seafile.com/api/v2.1/admin/shares/

    Request parameters

    • repo_id
    • share_type
    • share_to (user email)

    Sample request

    1. curl -X DELETE -d "repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=user&share_to=1@1.com" -H "Authorization: Token 9c845638b855e549c07ff81be2a0471aa52810d7" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/'

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Delete Repo Group Share" class="reference-link">Delete Repo Group Share

    Available for Seafile v6.0.1+

    DELETE https://cloud.seafile.com/api/v2.1/admin/shares/

    Request parameters

    • repo_id
    • share_type
    • share_to (group id)

    Sample request

    1. curl -X DELETE -d "repo_id=ddd42241-e003-425d-960e-0f9f7144866f&share_type=group&share_to=1" -H "Authorization: Token 9c845638b855e549c07ff81be2a0471aa52810d7" -H 'Accept: application/json; indent=4' 'https://cloud.seafile.com/api/v2.1/admin/shares/'

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 repo_id invalid.
    • 400 share_type invalid.
    • 403 Permission denied.
    • 404 Library not found.
    • 404 Folder not found.
    • 500 Internal Server Error

    Groups" class="reference-link">Groups

    Get all groups" class="reference-link">Get all groups

    Available for Seafile v6.0.0+

    GET https://cloud.seafile.com/api/v2.1/admin/groups/?page=1&per_page=100

    Get first page (100 records per page) of groups.

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/groups/?page=1&per_page=100

    Sample response

    1. {
    2. "page_info": {
    3. "current_page": 1,
    4. "has_next_page": true
    5. },
    6. "groups": [
    7. {
    8. "owner": "test@test.com",
    9. "created_at": "2016-08-01T16:58:14+08:00",
    10. "id": 1476,
    11. "name": "test_group"
    12. },
    13. {
    14. "owner": "1@1.com",
    15. "created_at": "2016-08-02T16:48:14+08:00",
    16. "id": 1486,
    17. "name": "group"
    18. }
    19. ...
    20. ]
    21. }

    Errors

    • 403 Permission error, only administrator can perform this action

    Delete a Group" class="reference-link">Delete a Group

    Available for Seafile v6.0.0+

    DELETE https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/groups/1486/

    Sample response

    1. {"success":true}

    Errors

    • 403 Permission error, only administrator can perform this action

    Transfer a Group" class="reference-link">Transfer a Group

    Available for Seafile v6.0.0+

    PUT https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/

    Sample request

    1. curl -X PUT -d "new_owner=1@1.com" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/groups/1528/

    Sample response

    1. {
    2. "owner": "1@1.com",
    3. "created_at": "2016-08-04T17:34:05+08:00",
    4. "id": 1528,
    5. "name": "test_group"
    6. }

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 User not found.
    • 500 Internal Server Error

    Set Group Quota" class="reference-link">Set Group Quota

    Available for Seafile v6.3

    PUT https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/

    Request parameters

    • quota: integer, -2 means no quota limit.

    Sample request

    1. curl -X PUT -d "quota=100" -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/groups/1528/

    Sample response

    1. {
    2. "owner": "1@1.com",
    3. "created_at": "2016-08-04T17:34:05+08:00",
    4. "id": 1528,
    5. "name": "test_group",
    6. "quota": 100
    7. }

    Errors

    • 400 Quota invalid.
    • 403 Permission error, only administrator can perform this action
    • 500 Internal Server Error

    Get Group Libraries" class="reference-link">Get Group Libraries

    Available for Seafile v6.0.0+

    GET https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/libraries/

    Get all libraries of a group.

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/groups/64/libraries/

    Sample response

    1. [
    2. {
    3. "repo_id":"7460f7ac-a0ff-4585-8906-bb5a57d2e118",
    4. "name":"My Library",
    5. "permission":"rw",
    6. "group_id":65,
    7. "shared_by":"lian@lian.com",
    8. "size":97662
    9. }
    10. ]

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Group not found.

    Delete Group Library" class="reference-link">Delete Group Library

    Available for Seafile v6.0.0+

    DELETE https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/libraries/{repo_id}/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/groups/64/libraries/7460f7ac-a0ff-4585-8906-bb5a57d2e118/

    Sample response

    1. {"success":true}

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Library/Group not found.
    • 500 Internal Server Error

    Get Group Members" class="reference-link">Get Group Members

    Available for Seafile v6.0.0+

    GET https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/members/

    Get all members of a group.

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/groups/64/members/

    Sample response

    1. [
    2. {
    3. "login_id":"",
    4. "avatar_url":"https://cloud.seafile.com/media/avatars/0/1/a72299021077701e7c522c46fdaa87/resized/80/6ad30837f69ea7ef234dc272fb15e9e9.png",
    5. "contact_email":"lian@lian.com",
    6. "name":"name of lian",
    7. "is_admin":true,
    8. "role":"Owner",
    9. "group_id":65,
    10. "email":"lian@lian.com"
    11. },
    12. {
    13. "login_id":"",
    14. "avatar_url":"https://cloud.seafile.com/media/avatars/default.png",
    15. "contact_email":"1@1.com",
    16. "name":"123",
    17. "is_admin":false,
    18. "role":"Member",
    19. "group_id":65,
    20. "email":"1@1.com"
    21. }
    22. ]

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Group not found.

    Delete Group Member" class="reference-link">Delete Group Member

    Available for Seafile v6.0.0+

    DELETE https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/members/{email}/

    Sample request

    1. curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/groups/64/members/foo@foo.com/

    Sample response

    1. {"success":true}

    Errors

    • 403 Permission error, only administrator can perform this action
    • 403 foo@foo.com is group owner, can not be removed.
    • 404 Group not found.
    • 500 Internal Server Error

    Add Group Member" class="reference-link">Add Group Member

    Available for Seafile v6.0.8+

    POST https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/members/

    Sample request

    1. curl -d "email=1@1.com&email=2@1.com" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' https://cloud.seafile.com/api/v2.1/admin/groups/65/members/

    Sample response

    1. {
    2. "failed":[
    3. {
    4. "email":"2@1.com","error_msg":"User 2@1.com is already a group member."
    5. }
    6. ],
    7. "success":[
    8. {
    9. "login_id":"",
    10. "avatar_url":"https://cloud.seafile.com/media/avatars/default.png",
    11. "contact_email":"8@1.com",
    12. "name":"name of 8",
    13. "is_admin":0,
    14. "role":"Member",
    15. "group_id":65,
    16. "email":"8@1.com"
    17. }
    18. ]
    19. }

    Errors

    • 400 email invalid.
    • 404 Group not found.

    Update Group Member Role" class="reference-link">Update Group Member Role

    Available for Seafile v6.0.8+

    Set a group member as admin

    PUT https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/members/{email}

    Sample request

    1. curl -X PUT -d "is_admin=true" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' https://cloud.seafile.com/api/v2.1/admin/groups/65/members/3@1.com/

    Sample response

    1. {
    2. "login_id":"",
    3. "avatar_url":"https://cloud.seafile.com/media/avatars/default.png",
    4. "contact_email":"3@1.com",
    5. "name":"update name of 3",
    6. "is_admin":1,
    7. "role":"Admin",
    8. "group_id":65,
    9. "email":"3@1.com"
    10. }

    Errors

    • 400 email invalid.
    • 400 is_admin invalid.
    • 404 Group/User not found.
    • 500 Internal Server Error

    Add Group Owned Library" class="reference-link">Add Group Owned Library

    POST http://192.168.1.113:8000/api/v2.1/admin/groups/{group_id}/group-owned-libraries/

    Request parameters

    • group_id
    • repo_name
    • password
    • permission, default rw.

    Sample request

    1. curl -d "repo_name=group-owned-repo-4&permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/amdin/groups/53/group-owned-libraries/"

    sample response

    1. {
    2. "repo_id": "9bc59af9-265e-4110-a0e2-619450a5cb35",
    3. "permission": "r",
    4. "encrypted": false,
    5. "owner_email": "53@seafile_group",
    6. "mtime": "2018-04-23T17:25:37+08:00",
    7. "repo_name": "group-owned-repo-4",
    8. "size": 0
    9. }

    Errors

    • 400 repo_name/permission invalid.
    • 403 NOT allow to create encrypted library..
    • 403 Permission denied.
    • 403 No group quota.
    • 404 Group not found.

    Delete Group Owned Library" class="reference-link">Delete Group Owned Library

    DELETE http://192.168.1.113:8000/api/v2.1/admin/groups/{group_id}/group-owned-libraries/{repo_id}/

    Request parameters

    • group_id
    • repo_id

    Sample request

    1. curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/admin/groups/53/group-owned-libraries/9bc59af9-265e-4110-a0e2-619450a5cb35/"

    sample response

    1. {"success":true}

    Errors

    • 403 Permission denied.
    • 404 Group/Library not found.
    • 500 Internal Server Error

    Modify Group Owned Library Sub-Folder Permission" class="reference-link">Modify Group Owned Library Sub-Folder Permission

    PUT http://192.168.1.113:8000/api/v2.1/admin/groups/{group_id}/group-owned-libraries/{repo_id}/

    Request parameters

    • group_id
    • repo_id
    • path, path of sub folder.
    • permission: r or rw.

    Sample request

    1. curl -X PUT -d "path=/tmp/&permission=r" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "http://192.168.1.113:8000/api/v2.1/admin/groups/53/group-owned-libraries/9bc59af9-265e-4110-a0e2-619450a5cb35/"

    sample response

    1. {"success":true}

    Errors

    • 400 path/permission invalid.
    • 403 Permission denied.
    • 404 Group/Library/Folder not found.
    • 500 Internal Server Error
    Unset a group member as admin

    PUT https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/members/{email}

    Sample request

    1. curl -X PUT -d "is_admin=false" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' https://cloud.seafile.com/api/v2.1/admin/groups/65/members/3@1.com/

    Sample response

    1. {
    2. "login_id":"",
    3. "avatar_url":"https://cloud.seafile.com/media/avatars/default.png",
    4. "contact_email":"3@1.com",
    5. "name":"update name of 3",
    6. "is_admin":0,
    7. "role":"Member",
    8. "group_id":65,
    9. "email":"3@1.com"
    10. }

    Errors

    • 400 email invalid.
    • 400 is_admin invalid.
    • 404 Group/User not found.
    • 500 Internal Server Error

    GET http://192.168.1.124:8000/api/v2.1/admin/share-links/{token}/

    Request parameters

    • token

    Sample request

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/share-links/db62f56baf1b4460996e/"

    Sample response

    1. {
    2. "repo_id": "0a5647c8-7708-445a-bd80-49f04b85b153",
    3. "ctime": "2017-06-20T08:37:13+00:00",
    4. "creator_name": "name of lian",
    5. "creator_email": "lian@lian.com",
    6. "obj_name": "asdf",
    7. "token": "db62f56baf1b4460996e",
    8. "view_cnt": 8,
    9. "link": "http://192.168.1.124:8000/d/db62f56baf1b4460996e/",
    10. "expire_date": "2017-06-23T08:37:13+00:00",
    11. "path": "/asdf/",
    12. "creator_contact_email": "lian@lian.com",
    13. "is_dir": true,
    14. "permissions": {
    15. "can_preview": true,
    16. "can_download": true
    17. },
    18. "is_expired": false,
    19. "repo_name": "sadfdaa"
    20. }

    Errors

    • 403 Permission denied.
    • 404 Share link not found.

    GET http://192.168.1.124:8000/api/v2.1/admin/share-links/{token}/dirents/

    Request parameters

    • token
    • path, sub-folder of shared dir, default is /.

    Sample request

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/share-links/db62f56baf1b4460996e/dirents/?path=/sdf"

    Sample response

    1. [
    2. {
    3. "path": "/sdf/1122",
    4. "is_dir": true,
    5. "size": 0,
    6. "last_modified": "2017-06-21T02:18:40+00:00",
    7. "obj_name": "1122"
    8. },
    9. {
    10. "path": "/sdf/12.docx",
    11. "is_dir": false,
    12. "size": 457426,
    13. "last_modified": "2017-06-20T10:09:53+00:00",
    14. "obj_name": "12.docx"
    15. },
    16. {
    17. "path": "/sdf/slack-desktop-2.3.3-amd64.deb",
    18. "is_dir": false,
    19. "size": 47434600,
    20. "last_modified": "2017-06-20T10:27:47+00:00",
    21. "obj_name": "slack-desktop-2.3.3-amd64.deb"
    22. }
    23. ]

    Errors

    • 403 Permission denied.
    • 404 Share link not found.

    GET http://192.168.1.124:8000/api/v2.1/admin/share-links/{token}/download/

    Request parameters

    • token
    • type, only used for download (sub) file/folder of shared dir, file or folder.
    • path, only used for download (sub) file/folder of shared dir.

    Sample request for download (sub) folder in shared dir

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/share-links/db62f56baf1b4460996e/download/?path=/sdf&type=folder"

    Sample response for download (sub) folder in shared dir

    1. {
    2. "download_link": "http://192.168.1.124:8082/zip/395e0ea8-3936-4084-b650-64a93d8a313d"
    3. }

    After you get the download link for the (sub) folder, you should use the token in the download link (here’s 395e0ea8-3936-4084-b650-64a93d8a313d) to check if the background compression packaging has been completed by Query Task Progress, once it is finished, you can use the download link to download the (sub) folder.

    Sample request for download (sub) file in shared dir

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/share-links/db62f56baf1b4460996e/download/?path=/sdf/12.docx&type=file"

    Sample response for download (sub) file in shared dir

    1. {
    2. "download_link": "http://192.168.1.124:8082/files/2fec8ae7-ffd5-4586-b125-7234e7a69656/12.docx"
    3. }

    Sample request for download shared file

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/share-links/dac219add64f4a4b9c51/download/"

    Sample response for download shared file

    1. {
    2. "download_link": "http://192.168.1.124:8082/files/a34af6cb-4762-4eea-b5a4-0b924e6767d0/excel-view.xlsx"
    3. }

    Errors

    • 403 Permission denied.
    • 404 Share link not found.
    • 404 File not found.
    • 404 Folder not found.
    • 404 Library not found.
    • 500 Internal Server Error

    GET http://192.168.1.124:8000/api/v2.1/admin/share-links/{token}/check-password/

    Request parameters

    • token
    • password

    Sample request

    1. curl -d 'password=11111111' -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/share-links/db62f56baf1b4460996e/check-password/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 Share link is not encrypted.
    • 400 password invalid.
    • 403 Permission denied.
    • 403 Password is not correct.
    • 404 Share link not found.

    GET http://192.168.1.124:8000/api/v2.1/admin/upload-links/{token}/

    Request parameters

    • token

    Sample request

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/upload-links/360fe7d6dc684045b7f6/"

    Sample response

    1. {
    2. "view_cnt": 0,
    3. "ctime": "2017-06-20T08:37:22+00:00",
    4. "creator_name": "name of lian",
    5. "creator_email": "lian@lian.com",
    6. "creator_contact_email": "lian@lian.com",
    7. "token": "360fe7d6dc684045b7f6",
    8. "repo_id": "0a5647c8-7708-445a-bd80-49f04b85b153",
    9. "link": "http://192.168.1.124:8000/u/d/360fe7d6dc684045b7f6/",
    10. "obj_name": "asdf",
    11. "path": "/asdf/",
    12. "repo_name": "sadfdaa"
    13. }

    Errors

    • 403 Permission denied.
    • 404 Upload link not found.

    GET http://192.168.1.124:8000/api/v2.1/admin/upload-links/{token}/upload/

    Request parameters

    • token

    Sample request

    1. curl -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/upload-links/360fe7d6dc684045b7f6/upload/"

    Sample response

    1. {
    2. "upload_link": "http://192.168.1.124:8082/upload-api/b08b20e4-beb2-4c7a-af03-fed6be859330"
    3. }

    After get upload link, you can upload file to the shared dir, for more info, please see Upload File.

    Errors

    • 403 Permission denied.
    • 404 Upload link not found.
    • 404 Folder not found.

    GET http://192.168.1.124:8000/api/v2.1/admin/upload-links/{token}/check-password/

    Request parameters

    • token
    • password

    Sample request

    1. curl -d 'password=11111111' -H 'Authorization: Token cbd7705c06846425ed5c46ae0313d5b098d24154' -H 'Accept: application/json; charset=utf-8; indent=4' "http://192.168.1.124:8000/api/v2.1/admin/upload-links/360fe7d6dc684045b7f6/check-password/"

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 Upload link is not encrypted.
    • 400 password invalid.
    • 403 Permission denied.
    • 403 Password is not correct.
    • 404 Upload link not found.

    Admin Log" class="reference-link">Admin Log

    Get Login Log" class="reference-link">Get Login Log

    This api is only supported in pro edition.

    GET https://cloud.seafile.com/api/v2.1/admin/logs/login/?start=2016-03-20&end=2016-03-31

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/logs/login/?start=2016-03-20&end=2016-03-31

    Sample response

    1. [
    2. {
    3. 'email': u'lian@lian.com',
    4. 'login_ip': u'192.168.1.124',
    5. 'name': u'lian',
    6. 'login_time': '2016-03-31T14:42:23+08:00'
    7. },
    8. {
    9. 'email': u'org@org.com',
    10. 'login_ip': u'192.168.1.124',
    11. 'name': u'org',
    12. 'login_time': '2016-03-31T14:39:08+08:00'
    13. }
    14. ]

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    Get File Audit Log" class="reference-link">Get File Audit Log

    This api is only supported in pro edition.

    GET https://cloud.seafile.com/api/v2.1/admin/logs/file-audit/?start=2016-03-20&end=2016-03-31

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/logs/file-audit/?start=2016-03-20&end=2016-03-31

    Sample response

    1. [
    2. {
    3. 'repo_id': u'4929d0df-8c6c-43cb-8edf-40a8489689fb',
    4. 'time': '2016-03-31T05:46:03+08:00',
    5. 'etype': u'file-download-web',
    6. 'ip': u'192.168.1.124',
    7. 'user_name': u'org',
    8. 'file_path': u'/earth.jpg',
    9. 'user_email': u'org@org.com',
    10. 'repo_name': ''
    11. },
    12. {
    13. 'repo_id': u'513cd72c-c54a-463e-a18f-841efe91bd61',
    14. 'time': '2016-03-31T06:25:22+08:00',
    15. 'etype': u'file-download-web',
    16. 'ip': u'192.168.1.124',
    17. 'user_name': u'org',
    18. 'file_path': u'/kj.md',
    19. 'user_email': u'org@org.com',
    20. 'repo_name': u'new-lib-of-org-1'
    21. }
    22. ]

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    Get File Update Log" class="reference-link">Get File Update Log

    This api is only supported in pro edition.

    GET https://cloud.seafile.com/api/v2.1/admin/logs/file-update/?start=2016-03-20&end=2016-03-31

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/logs/file-update/?start=2016-03-20&end=2016-03-31

    Sample response

    1. [
    2. {
    3. 'commit_id': u'55ec5350b16d6c72a044b5a9cd9b2d62ad439364',
    4. 'file_operation': u'Added "user.csv".',
    5. 'repo_id': u'513cd72c-c54a-463e-a18f-841efe91bd61',
    6. 'repo_name': u'new-lib-of-org-1',
    7. 'time': '2016-03-31T06:25:15+08:00',
    8. 'user_email': u'org@org.com',
    9. 'user_name': u'org'
    10. },
    11. {
    12. 'commit_id': u'6820d809481e3c9fb856d0650ac73a09b570a301',
    13. 'file_operation': u'Added "kj.md"',
    14. 'repo_id': u'513cd72c-c54a-463e-a18f-841efe91bd61',
    15. 'repo_name': u'new-lib-of-org-1',
    16. 'time': '2016-03-31T06:25:21+08:00',
    17. 'user_email': u'org@org.com',
    18. 'user_name': u'org'
    19. }
    20. ]

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    Get Permission Audit Log" class="reference-link">Get Permission Audit Log

    This api is only supported in pro edition.

    GET https://cloud.seafile.com/api/v2.1/admin/logs/perm-audit/?start=2016-03-20&end=2016-03-31

    Sample request

    1. curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/logs/perm-audit/?start=2016-03-20&end=2016-03-31

    Sample response

    1. [
    2. {
    3. 'etype': u'add-repo-perm',
    4. 'file_path': u'/folder',
    5. 'from_email': u'org3@org3.com',
    6. 'from_name': u'org3',
    7. 'permission': u'rw',
    8. 'repo_id': u'a84544e5-0b84-459d-b1e6-0399dabc76a0',
    9. 'repo_name': '',
    10. 'time': '2016-03-31T06:21:50+08:00',
    11. 'to': u'org@org.com'
    12. },
    13. {
    14. 'etype': u'add-repo-perm',
    15. 'file_path': u'/folder',
    16. 'from_email': u'org3@org3.com',
    17. 'from_name': u'org3',
    18. 'permission': u'rw',
    19. 'repo_id': u'a84544e5-0b84-459d-b1e6-0399dabc76a0',
    20. 'repo_name': '',
    21. 'time': '2016-03-31T06:21:53+08:00',
    22. 'to': u'777'
    23. }
    24. ]

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    Organization" class="reference-link">Organization

    Add Organization" class="reference-link">Add Organization

    This api is only supported in pro edition.

    POST https://cloud.seafile.com/api2/organization/

    Request parameters

    • username
    • password
    • org_name
    • prefix
    • quota
    • member_limit

    Sample request

    1. curl -v -X POST -d "username=example@example.com&password=example&org_name=example&prefix=example&quota=100&member_limit=10" -H "Authorization: Token ccdff90e4d1efe76b2b3d91c06b027a5cff189d4" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/organization/

    Sample response

    1. "success"

    Add Organization User" class="reference-link">Add Organization User

    This api is only supported in pro edition (since 6.0.9).

    POST https://cloud.seafile.com/api/v2.1/admin/organizations/{org_id}/users/

    Request parameters

    • org_id
    • email
    • password

    Sample request
    curl -d “username=1@org-3.com&password=1&org_name=org-3&prefix=org-3&quota=100&member_limit=10” -H “Authorization: Token 3f1e23157c3a1fd740e9dc1c5d748929fe319b95” -H ‘Accept: application/json; indent=4’ http://192.168.1.165/api2/organization/

    Sample response

    1. {
    2. "quota_usage": 0,
    3. "name": "6",
    4. "org_id": 1,
    5. "contact_email": "6@org.com",
    6. "active": true,
    7. "quota_total": -1,
    8. "email": "6@org.com"
    9. }

    Errors

    • 400 org_id invalid.
    • 400 email invalid.
    • 400 password invalid.
    • 400 User already exists.
    • 403 The number of users exceeds the limit.
    • 403 Failed. You can only invite %d members.
    • 404 Organization not found.
    • 500 Fail to add user.
    • 500 Internal Server Error

    Get Organization User Info" class="reference-link">Get Organization User Info

    This api is only supported in pro edition (since 6.1.5).

    GET https://cloud.seafile.com/api/v2.1/admin/organizations/{org_id}/users/{email}/

    Request parameters

    • org_id
    • email

    Sample request

    1. curl -H "Authorization: Token 3f1e23157c3a1fd740e9dc1c5d748929fe319b95" -H 'Accept: application/json; indent=4' http://192.168.1.165/api/v2.1/admin/organizations/1/users/6@org.com/

    Sample response

    1. {
    2. "quota_usage": 0,
    3. "name": "6",
    4. "org_id": 1,
    5. "contact_email": "6@org.com",
    6. "active": true,
    7. "quota_total": -1,
    8. "email": "6@org.com"
    9. }

    Errors

    • 400 org_id invalid.
    • 400 User is not member of organization.
    • 404 Organization not found.
    • 404 User not found.
    • 500 Internal Server Error

    Updage Organization User Info" class="reference-link">Updage Organization User Info

    This api is only supported in pro edition (since 6.1.5).

    PUT https://cloud.seafile.com/api/v2.1/admin/organizations/{org_id}/users/{email}/

    Request parameters

    • org_id
    • email
    • active, true or false
    • name
    • contact_email
    • quota_total, integer greater than 0, unit is MB.

    Sample request

    1. curl -X PUT -d "active=false&name=name-of-6&contact_email=6-contact@email.com&quota_total=23" -H "Authorization: Token 3f1e23157c3a1fd740e9dc1c5d748929fe319b95" -H 'Accept: application/json; indent=4' http://192.168.1.165/api/v2.1/admin/organizations/1/users/6@org.com/

    Sample response

    1. {
    2. "quota_usage": 0,
    3. "name": "name-of-6",
    4. "org_id": 1,
    5. "contact_email": "6-contact@email.com",
    6. "active": false,
    7. "quota_total": 23,
    8. "email": "6@org.com"
    9. }

    Errors

    • 400 org_id invalid.
    • 400 active invalid, should be ‘true’ or ‘false’.
    • 400 Failed to set quota.
    • 404 Organization not found.
    • 404 User not found.
    • 500 Internal Server Error

    Delete Organization User" class="reference-link">Delete Organization User

    This api is only supported in pro edition (since 6.0.9).

    DELETE https://cloud.seafile.com/api/v2.1/admin/organizations/{org_id}/users/{email}/

    Request parameters

    • org_id
    • email

    Sample request

    1. curl -X DELETE -H "Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/organizations/160/users/6@org.com/

    Sample response

    1. {
    2. "success": true
    3. }

    Errors

    • 400 org_id invalid.
    • 403 Failed to delete: is an organization creator.
    • 404 Organization not found.
    • 404 User not found.
    • 500 Internal Server Error

    Department" class="reference-link">Department

    List departments" class="reference-link"> List departments

    GET http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/

    Sample request

    1. curl -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/

    Sample response

    1. {
    2. "data": [
    3. {
    4. "name": "test-xxx",
    5. "created_at": "2018-06-05T10:45:45+08:00",
    6. "quota": -2,
    7. "parent_group_id": -1,
    8. "owner": "system admin",
    9. "id": 176
    10. },
    11. {
    12. "name": "\u7814\u53d1\u90e8",
    13. "created_at": "2018-05-24T23:30:07+08:00",
    14. "quota": -2,
    15. "parent_group_id": -1,
    16. "owner": "system admin",
    17. "id": 172
    18. },
    19. {
    20. "name": "test1",
    21. "created_at": "2018-05-15T11:57:16+08:00",
    22. "quota": 1000000000,
    23. "parent_group_id": -1,
    24. "owner": "system admin",
    25. "id": 168
    26. }
    27. ]
    28. }

    List groups and members in a department" class="reference-link"> List groups and members in a department

    GET http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/{group_id}/?return_ancestors=true

    Request parameters

    • return_ancestors (true or false, defaults to false)

    Sample request

    1. curl -H 'Authorization: Token 2bac21cab9eb0c4baac10d1e6fc3cf590f0dcf17' -H 'Accept: application/json; charset=utf-8; indent=4' http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/172/?return_ancestors=true

    Sample response

    1. {
    2. "id": 172
    3. "name": "\u7814\u53d1\u90e8",
    4. "created_at": "2018-05-24T23:30:07+08:00",
    5. "quota": -2,
    6. "members": [
    7. {
    8. "login_id": "",
    9. "avatar_url": "http://192.168.1.113:8000/image-view\/avatars\/9\/3\/45638f87b4642ce4820dbe65e3438d\/resized\/80\/dfad850ea93d405f6e6cf51a9f1e36bf_GrrNVeZ.png",
    10. "contact_email": "xxx@gmail.com",
    11. "name": "xxx",
    12. "is_admin": true,
    13. "role": "Admin",
    14. "group_id": 172,
    15. "email": "xxx@gmail.com"
    16. }
    17. ],
    18. "parent_group_id": -1,
    19. "groups": [
    20. {
    21. "name": "\u5ba2\u6237\u7aef\u7ec4",
    22. "created_at": "2018-05-24T23:30:32+08:00",
    23. "quota": 5000000000,
    24. "parent_group_id": 172,
    25. "owner": "system admin",
    26. "id": 173
    27. },
    28. {
    29. "name": "\u670d\u52a1\u5668\u5f00\u53d1\u7ec4",
    30. "created_at": "2018-05-25T11:55:17+08:00",
    31. "quota": -2,
    32. "parent_group_id": 172,
    33. "owner": "system admin",
    34. "id": 174
    35. },
    36. ],
    37. "owner": "system admin",
    38. "ancestor_groups": [
    39. ],
    40. }

    Create department" class="reference-link"> Create department

    POST http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/

    Request parameters

    • group_name
    • group_owner (defaults to ‘’)
    • parent_group (Positive Integer, defaults to -1)

    Sample request

    1. curl -v -d "group_name=xxx&group_owner=system admin" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/

    Sample response

    1. {
    2. "name": "xxx",
    3. "created_at": "2018-06-05T10:45:45+08:00",
    4. "quota": -2,
    5. "parent_group_id": -1,
    6. "owner": "system admin",
    7. "id": 176
    8. }

    Errors

    • 400 group_name or parent_group invalid

    Dismiss department" class="reference-link"> Dismiss department

    DELETE http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/{group_id}/

    Sample request

    1. curl -X DELETE -v -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; charset=utf-8; indent=4' http://192.168.1.113:8000/api/v2.1/admin/address-book/groups/176/

    Sample response

    1. {"success":true}