Web API (For Seafile server v5.1.0+)

  • Admin Only
  • Seafile Web API

    API Basics

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

    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

    • 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

    ping

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

    obtain auth token

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

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

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

    auth ping

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

    Account

    Check Account Info

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

    Sample request

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

    Sample response

    {
    "usage": 26038531,
    "total": 104857600,
    "email": "user@example.com"
    }
    

    Errors

    • 403 Invalid token

    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

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

    Sample response

    Sample response from a seafile community edition server:

    {
        "version": "4.0.6",
        "features": [
        "seafile-basic",
        ]
    }
    

    Sample response from a seafile pro edition server:

    {
        "version": "4.0.6",
        "features": [
        "seafile-basic",
        "seafile-pro",
        "office-preview",
        "file-search"
        ]
    }
    

    Starred Files

    List starred files

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

    Sample request

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

    Sample response

    [
    {
        "repo": "99b758e6-91ab-4265-b705-925367374cf0",
        "mtime": 1355198150,
        "org": -1,
        "path": "/foo/bar.doc",
        "dir": false,
        "size": 0
    },
    {
        "repo": "99b758e6-91ab-4265-b705-925367374cf0",
        "mtime": 1353751237,
        "org": -1,
        "path": "/add_folder-blue.png",
        "dir": false,
        "size": 3170
    }
    ]
    

    Star A File

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

    Request parameters

    • repo_id (post)
    • p (post)

    Sample request

    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

    ...
    < HTTP/1.0 201 CREATED
    < Location: https://cloud.seafile.com/api2/starredfiles/
    ...
    "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

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

    Request parameters

    • repo_id
    • p

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    "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

    List Groups

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

    Sample request

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

    Sample response

    {
        "replynum": 0,
        "groups": [
            {
                "ctime": 1398134171327948,
                "creator": "user@example.com",
                "msgnum": 0,
                "mtime": 1398231100,
                "id": 1,
                "name": "lian"
            },
            {
                "ctime": 1398236081042441,
                "creator": "user@example.com",
                "msgnum": 0,
                "mtime": 0,
                "id": 2,
                "name": "123"
            }
        ]
    }
    

    Add a Group

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

    Request parameters

    • name (name of new group)

    Sample request

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

    Sample response

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

    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

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

    Sample response

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

    Rename a Group

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

    Request parameters

    • name (name of new group)

    Sample request

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

    Sample response

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

    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

    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

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

    Delete a Group

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

    Sample request

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

    Sample response

    {"success":true}
    

    Quit Group

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

    Sample request

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

    Sample response

    {"success":true}
    

    Group Member

    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

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

    Sample response

    [
        {
            "login_id": "",
            "name": "nickname-of-lian",
            "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
            "is_admin": true,
            "contact_email": "lian_contact@email.com",
            "email": "lian@lian.com"
        },
        {
            "login_id": "",
            "name": "1",
            "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
            "is_admin": false,
            "contact_email": "1@1.com",
            "email": "1@1.com"
        }
    ]
    

    Add a Group Member

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

    Request parameters

    • email

    Sample request

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

    Sample response

    {
        "login_id": "",
        "name": "new-member",
        "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
        "is_admin": false,
        "contact_email": "new-member@email.com",
        "email": "new-member@email.com"
    }
    

    Bulk Add Group Members

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

    Request parameters

    • emails

    Sample request

    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

    {
        "failed":[
            {
                "error_msg": "Invalid email",
                "email": "new-member-3@email.com"
            },
            {
                "error_msg": "Is already group member",
                "email": "new-member-4@email.com"
            }
        "success":[
            {
                "login_id": "",
                "name": "new-member-1",
                "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
                "is_admin": false,
                "contact_email": "new-member-1@email.com",
                "email": "new-member-1@email.com"
            },
            {
                "login_id": "",
                "name": "new-member-2",
                "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
                "is_admin": false,
                "contact_email": "new-member-2@email.com",
                "email": "new-member-2@email.com"
            }
        ]
    }
    

    Get Info of a Group Member

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

    Sample request

    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

    {
        "login_id": "",
        "name": "group-member",
        "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
        "is_admin": false,
        "contact_email": "group-member@email.com",
        "email": "group-member@email.com"
    }
    

    Set a Group Member Admin

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

    Request parameters

    • is_admin=true

    Sample request

    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

    {
        "login_id": "",
        "name": "group-member",
        "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
        "is_admin": true,
        "contact_email": "group-member@email.com",
        "email": "group-member@email.com"
    }
    

    Unset a Group Member Admin

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

    Request parameters

    • is_admin=false

    Sample request

    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

    {
        "login_id": "",
        "name": "group-member",
        "avatar_url": "https://cloud.seafile.com/media/avatars/default.png",
        "is_admin": false,
        "contact_email": "group-member@email.com",
        "email": "group-member@email.com"
    }
    

    Delete a Group Member

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

    Sample request

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

    Sample response

    {"success":true}
    

    Group Message

    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

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

    Sample response

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

    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

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

    Sample response

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

    Delete A Group Message

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

    Request parameters

    • group_id
    • discuss_id

    Sample request

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

    sample response

    ...
    < http/1.0 204 no content
    ...
    

    Errors

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

    Share

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

    Sample request

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

    Sample response

    [{"username":"lian@lian.com","view_cnt":0,"ctime":"2016-02-26T16:20:36.894","token":"4cbd625c5e","repo_id":"62ca6cf9-dab6-47e5-badc-bab13d9220ce","link":"https://cloud.seafile.com/f/4cbd625c5e/","expire_date":null,"path":"/file.md","is_expired":false},{"username":"lian@lian.com","view_cnt":0,"ctime":"2016-03-04T03:54:58.279","token":"8dc1e04ddd","repo_id":"62ca6cf9-dab6-47e5-badc-bab13d9220ce","link":"https://cloud.seafile.com/d/8dc1e04ddd/","expire_date":null,"path":"/","is_expired":false}]
    

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

    Request parameters

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

    Sample request

    Create download link for file

    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

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

    Sample response

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

    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

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

    Sample response

    {"success":true}
    

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

    Request parameters

    • token
    • email
    • extra_msg (not necessary)

    Sample request

    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

    {
        "failed": [
            {
                "email": "invalid-email",
                "error_msg": "email invalid."
            }
        ],
        "success": [
            "sample@eamil.com"
        ]
    }
    

    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

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

    Sample response

    [{"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

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

    Sample response

    [{"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

    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

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

    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

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

    Sample response

    {"success":true}
    

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

    Request parameters

    • token
    • email
    • extra_msg (not necessary)

    Sample request

    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

    {
        "failed": [
            {
                "email": "invalid-email",
                "error_msg": "email invalid."
            }
        ],
        "success": [
            "sample@eamil.com"
        ]
    }
    
    • 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

    List Shared Libraries

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

    Sample request

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

    Sample response

    
    [
        {
            "share_permission": "rw",
            "repo_id": "7460f7ac-a0ff-4585-8906-bb5a57d2e118",
            "share_type": "personal",
            "contact_email": "foo-contact@email.com",
            "user_name": "foo",
            "user_email": "foo@foo.com",
            "repo_name": "repo"
        },
        {
            "share_permission": "r",
            "repo_id": "c474a093-19dc-4ddf-b0b0-72b33214ba33",
            "share_type": "group",
            "group_name": "group",
            "group_id": 65,
            "repo_name": "seacloud.cc.124"
        }
    ]
    

    Errors

    • 500 Internal Server Error

    List Be Shared Libraries

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

    Sample request

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

    Sample response

    "[{"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

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

    Sample request

    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

    {"success": true}
    

    Errors

    • 400 Invalid argument
    • 400 Library does not exist

    Share A Library

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

    Request parameters

    • share_type ('personal', 'group' or 'public')
    • user (or users)
    • group_id
    • permission

    If share_type is 'personal' then 'user' or 'users' param are required, if share_type is 'group' then 'group_id' parameter is required. If share_type is 'public' no other params is required.

    'user' or 'users' parameters can be a comma separated list of emails, in this case the share will be done for more users at the same time. If a problem is encountered during multiple users sharing then the sharing process is aborted.

    Sample request

    curl -X PUT -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/shared-repos/7d42522b-1f6f-465d-b9c9-879f8eed7c6c/?share_type=group&user=user@example.com&group_id=1&permission=rw"
    

    Sample response

    "success"
    

    Unshare A Library

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

    Request parameters

    • share_type ('personal', 'group' or 'public')
    • user
    • group_id

    If share_type is 'personal' then 'user' param is required, if share_type is 'group' then 'group_id' parameter is required. If share_type is 'public' no other params is required.

    Sample request

    curl -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/shared-repos/7d42522b-1f6f-465d-b9c9-879f8eed7c6c/?share_type=personal&user=user@example.com&group_id=0"
    

    Sample response

    "success"
    

    Shared Folders

    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

    curl -X PUT -d "username=2@1.com&share_type=user&&perm=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

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

    Sample request for share folder to group

    curl -X PUT -d "group_id=772&share_type=group&&perm=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

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

    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

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

    Sample request

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

    Sample response

    [
        {
            "share_permission": "rw",
            "repo_id": "2deffbac-d7be-4ace-b406-efb799083ee9",
            "share_type": "personal",
            "folder_name": "asd",
            "path": "/asd",
            "user_name": "1",
            "contact_email": "contact@email.com",
            "user_email": "1@1.com"
        },
        {
            "share_permission": "r",
            "repo_id": "2deffbac-d7be-4ace-b406-efb799083ee9",
            "share_type": "group",
            "group_name": "test_group",
            "folder_name": "asd",
            "path": "/asd",
            "group_id": 1448
        }
    ]
    

    Errors

    • 500 Internal Server Error

    Update Shared Folder Permission

    POST 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

    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

    {"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

    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

    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

    {"success":true}
    

    Errors

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

    Library

    Get Default Library

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

    Sample request

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

    Sample response

    {
        "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e",
        "exists": true
    }
    

    Create Default Library

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

    Sample request

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

    Sample response

    {
        "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e",
        "exists": true
    }
    

    List Libraries

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

    Sample request

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

    Sample response

    [
    {
        "permission": "rw",
        "encrypted": false,
        "mtime": 1400054900,
        "owner": "user@mail.com",
        "id": "f158d1dd-cc19-412c-b143-2ac83f352290",
        "size": 0,
        "name": "foo",
        "type": "repo",
        "virtual": false,
        "desc": "new library",
        "root": "0000000000000000000000000000000000000000"
    },
    {
        "permission": "rw",
        "encrypted": false,
        "mtime": 1400054802,
        "owner": "user@mail.com",
        "id": "0536b11a-a5fd-4482-9314-728cb3472f54",
        "size": 0,
        "name": "foo",
        "type": "repo",
        "virtual": false,
        "desc": "new library",
        "root": "0000000000000000000000000000000000000000"
    }
    ]
    

    Get Library Info

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

    Request parameters

    • repo-id

    Sample request

    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

    {
    "encrypted": false,
    "password_need": null,
    "mtime": null,
    "owner": "self",
    "id": "632ab8a8-ecf9-4435-93bf-f495d5bfe975",
    "size": 1356155,
    "name": "org",
    "root": "b5227040de360dd22c5717f9563628fe5510cbce",
    "desc": "org file",
    "type": "repo"
    }
    

    Get Library Owner

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

    Request parameters

    • repo-id

    Sample request

    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

    {
    "owner": "user@example.com"
    }
    

    Errors

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

    Get Library History

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

    {"commits": [{"rev_file_size": 0, "rev_file_id": null, "ctime": 1398045167, "creator_name": "imwhatiam123@gmail.com", "creator": "0000000000000000000000000000000000000000", "root_id": "ca2625da6be6e211ddd584615ef3bfaa531e66aa", "rev_renamed_old_path": null, "parent_id": "205c469f0830df09b13024601524058757a43128", "new_merge": false, "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e", "desc": "Modified \"api.md\"", "id": "eb62721812e0c3122889b5facde971b353ad176b", "conflict": false, "second_parent_id": null}, {"rev_file_size": 0, "rev_file_id": null, "ctime": 1398045158, "creator_name": "imwhatiam123@gmail.com", "creator": "0000000000000000000000000000000000000000", "root_id": "0b7a31adf4ea8b29ad5a5920420b548da11dd32f", "rev_renamed_old_path": null, "parent_id": "2ba85ee6072efea51a3483843ea7de9b6d1d1eb2", "new_merge": false, "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e", "desc": "Added \"api.md\"", "id": "205c469f0830df09b13024601524058757a43128", "conflict": false, "second_parent_id": null}], "page_next": false}
    

    Get Library History Limit Days

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

    Request parameters

    • repo-id

    Sample request

    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

    {
    "keep_days": -1,
    }
    

    Errors

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

    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

    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

    {
    "keep_days": 4,
    }
    

    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

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

    Request parameters

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

    Sample request

    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

    {
    "encrypted": "",
    "enc_version": 0,
    "repo_id": "f15811fd-5c19-412c-b143-2ac83f352290",
    "magic": "",
    "relay_id": "c5e41170db250ea497075e2911104faf0105b7fb",
    "repo_version": 1,
    "relay_addr": "cloud.seafile.com",
    "token": "c1f3defe9ba408cd7964427ec276843e9d10c23b",
    "relay_port": "10001",
    "random_key": "",
    "email": "user@mail.com",
    "repo_name": "foo"
    }
    

    Success

    Response code 200 and newly created library information are returned.

    Errors

    • 400 Library name missing.
    • 520 Operation failed.

    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

    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

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

    Errors

    • 400 Argument missing
    • 500 INTERNAL SERVER ERROR

    Delete Library

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

    Sample request

    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

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

    Sample request

    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

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

    Request parameters

    • repo-id
    • owner

    Sample request

    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

    {
    "success": True
    }
    

    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

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

    Request parameters

    • password

    Sample request

    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

    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

    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

    {
        "owner_nickname": "lian",
        "permission": "rw",
        "encrypted": true,
        "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>",
        "mtime": 1464667309,
        "owner": "lian@lian.com",
        "id": "6553fd8b-bf3e-41ad-a481-90c8523d3b4a",
        "size": 0,
        "name": "test-public-repo",
        "desc": "",
        "size_formatted": "0 bytes"
    }
    

    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

    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

    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

    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

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

    Request parameters

    • repo-id
    • share_type

    Sample request

    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

    "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

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

    Request parameters

    • repo-id

    Sample request

    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

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

    Search Libraries

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

    Request parameters

    • q
    • per_page (optional)

    Sample request

    curl -G -H 'Authorization: Token 24fd3c026886e3121b2ca630805ed425c272cb96' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/search/?q=keyword
    

    Sample response

    {
        "has_more": false,
        "total": 3,
        "results": [
            {
                "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e",
                "name": "api.md",
                "oid": "8ea78453bb474359cd9d8e2c4c4d8d9cbdcef0a2",
                "last_modified": 1398045167,
                "fullpath": "/api.md",
                "size": 18939
            },
            {
                "repo_id": "c5509062-9bca-4933-a7e0-c6da1d5f82be",
                "name": "home.md",
                "oid": "dda57aaffa5179829e064c7d0c142f47a8a65d3b",
                "last_modified": 1397096831,
                "fullpath": "/home.md",
                "size": 1954
            },
            {
                "repo_id": "c5509062-9bca-4933-a7e0-c6da1d5f82be",
                "name": "\u5e38\u89c1\u5b89\u88c5\u95ee\u9898.md",
                "oid": "8573f982eeb478b932a55ec13218f4f90a7c5a27",
                "last_modified": 1397188959,
                "fullpath": "/\u5e38\u89c1\u5b89\u88c5\u95ee\u9898.md",
                "size": 1050
            }
        ]
    }
    

    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

    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

    [
        {
            "view_count": 0,
            "name": "/",
            "share_type": "d",
            "creator_name": "lian",
            "create_by": "lian@lian.com",
            "token": "105f108fb6",
            "create_time": "2016-01-18T15:03:10+0800",
            "path": "/",
            "size": ""
        },
        {
            "view_count": 3,
            "name": "1.md",
            "share_type": "f",
            "creator_name": "lian",
            "create_by": "lian@lian.com",
            "token": "a626012c1b",
            "create_time": "2016-01-19T11:27:43+0800",
            "path": "/1.md",
            "size": "4"
        }
    ]
    

    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

    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

    [
        {
            "view_count": 3,
            "name": "/",
            "creator_name": "lian",
            "create_by": "lian@lian.com",
            "token": "43340efca5",
            "create_time": "2016-01-18T15:03:12+0800",
            "path": "/"
        },
        {
            "view_count": 8,
            "name": "a&b",
            "creator_name": "lian",
            "create_by": "lian@lian.com",
            "token": "f1e49d445a",
            "create_time": "2016-01-18T15:03:18+0800",
            "path": "/a&b/"
        }
    ]
    

    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

    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

    {"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

    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

    {"success": true}
    

    Errors

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

    File

    View File Through Owa

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

    Request parameters

    • repo-id
    • path

    Sample request

    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

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

    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

    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

    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

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

    Errors

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

    Get File Detail

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

    • repo-id
    • p

    Sample request

    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

    {
    "id": "013d3d38fed38b3e8e26b21bb3463eab6831194f",
    "mtime": 1398148877,
    "type": "file",
    "name": "foo.py",
    "size": 22
    }
    

    Errors

    • 400 Path is missing
    • 520 Operation failed.

    Get File History

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

    Request parameters

    • repo-id
    • p

    Sample request

    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

    {
    "commits":
        [
            {
            "rev_file_size": 0,
            "repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4",
            "ctime": 1398149763,
            "creator_name": "user@example.com",
            "creator": "0000000000000000000000000000000000000000",
            "root_id": "b64d413d9894c9206beac3faf9c2a0d75b4a8ebf",
            "rev_renamed_old_path": null,
            "parent_id": "8e546762e1657ab22dad83e9cb1e5ea31a767c9a",
            "new_merge": false,
            "version": 1,
            "conflict": false,
            "desc": "Added \"foo.c\"",
            "id": "9464f7499bfa7363d563282361339eaf96a93318",
            "rev_file_id": "0000000000000000000000000000000000000000",
            "second_parent_id": null
            },
            {
            "rev_file_size": 0,
            "repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4",
            "ctime": 1398146059,
            "creator_name": "user@example.com",
            "creator": "0000000000000000000000000000000000000000",
            "root_id": "572413414257c76039897e00aeb35f819471206b",
            "rev_renamed_old_path": null,
            "parent_id": "f977bdb0ebb205645c3b42216c2817e511c3f68f",
            "new_merge": false,
            "version": 1,
            "conflict": false,
            "desc": "Added \"foo.c\"",
            "id": "a1ec20709675f4dc8db825cdbca296be245d189b",
            "rev_file_id": "0000000000000000000000000000000000000000",
            "second_parent_id": null
            }
        ]
    }
    

    Errors

    • 400 Path is missing
    • 404 File not found

    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

    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

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

    Errors

    • 400 Path is missing
    • 404 Revision not found

    Create File

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

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    curl -v -d "operation=create" -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

    ...
    < HTTP/1.1 201 CREATED
    ...
    "success"
    

    Success

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

    Errors

    • 403 FORBIDDEN, You do not have permission to move file
    • 520 OPERATION FAILED, fail to create file

    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

    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

    ...
    < HTTP/1.1 301 MOVED PERMANENTLY
    ...
    "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

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

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    "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

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

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    "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

    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

    curl -v -d "operation=move&dst_repo=affc837f-7fdd-4e91-b88a-32caf99897f2&dst_dir=/" -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

    ...
    < HTTP/1.1 301 MOVED PERMANENTLY
    ...
    "success"
    

    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

    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

    curl -v -d "dst_repo=73ddb2b8-dda8-471b-b7a7-ca742b07483c&dst_dir=/&file_names=foo.c" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' https://cloud.seafile.com/api2/repos/c7436518-5f46-4296-97db-2fcba4c8c8db/file/?p=/foo.c
    

    Sample response

    ...
    < HTTP/1.1 200 OK
    ...
    "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 copy file
    • 500 INTERNAL SERVER ERROR

    Revert File

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

    Request parameters

    • repo_id
    • p
    • commit_id

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    
    {"ret": 0}
    

    Success

    Response code 200(OK) is returned.
    

    Errors

    • 400 Path is missing

    Delete File

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

    Request parameters

    • repo-id
    • p

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    "success"
    

    Errors

    • 400 Path is missing
    • 520 Operation failed.

    Note

    This can also be used to delete directory.

    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

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

    Sample response

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

    Errors

    403 Permission denied.
    500 Run out of quota
    

    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.

    NOTE:

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

    Sample request

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

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

    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:

    curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -F file=@local-folder/test.txt -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
    

    Sample response

    "adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"
    

    Note

    Errors

    400 Bad request
    440 Invalid filename
    500 Internal server error
    

    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

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

    Sample response

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

    Errors

    403 Permission denied.
    500 Run out of quota
    

    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

    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

    "adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"
    

    Errors

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

    "https://cloud.seafile.com/seafhttp/upload-blks-api/569213db-7297-457a-907d-e2259a277c05"
    

    Errors

    • 403 Can not access repo
    • 520 above quota

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

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

    Errors

    • 403 Can not access repo
    • 520 above quota

    Directory

    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.

    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

    [
    {
        "id": "0000000000000000000000000000000000000000",
        "type": "file",
        "name": "test1.c",
        "size": 0
    },
    {
        "id": "e4fe14c8cda2206bb9606907cf4fca6b30221cf9",
        "type": "dir",
        "name": "test_dir"
    }
    ]
    

    Sample request

    request recursive dir list of a folder.

    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

    [{'id': u'5e307101cad46398fb5fe52d9177836f73c4bae8',
      'mtime': 1471490386,
      'name': u'123',
      'parent_dir': u'/video',
      'permission': u'rw',
      'type': 'dir'},
     {'id': u'0000000000000000000000000000000000000000',
      'mtime': 1471490391,
      'name': u'123-2',
      'parent_dir': u'/video',
      'permission': u'rw',
      'type': 'dir'},
     {'id': u'0000000000000000000000000000000000000000',
      'mtime': 1471490379,
      'name': u'456',
      'parent_dir': u'/video/123',
      'permission': u'rw',
      'type': 'dir'},
     {'id': u'0000000000000000000000000000000000000000',
      'mtime': 1471490386,
      'name': u'456-2',
      'parent_dir': u'/video/123',
      'permission': u'rw',
      'type': 'dir'},
     {'id': u'd8f5f80fbd89bf5634dcf9e21b569c487541d34e',
      'mtime': 1471490391,
      'name': u'video',
      'parent_dir': '/',
      'permission': u'rw',
      'type': 'dir'}
    ]
    

    Errors

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

    Create New Directory

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

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

    Sample request

    curl -d  "operation=mkdir" -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
    

    Sample response

    ...
    < HTTP/1.0 201 CREATED
    < Location: https://cloud.seafile.com/api2/repos/dae8cecc-2359-4d33-aa42-01b7846c4b32/dir/?p=/foo
    ...
    
    "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

    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

    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

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

    • repo-id
    • p

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    "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

    Perform the following two steps to download directory

    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

    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

    {
        "zip_token": "b2272645-35ee-44ce-8f68-07c022107015"
    }
    

    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

    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

    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.

    {
        "zipped":2,
        "total":2
    }
    

    Errors

    • 400 token invalid.
    • 500 Internal Server Error

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

    FILE_SERVER_ROOT/zip/{zip_token}
    

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

    Multiple Files / Directories

    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

    curl -d "dst_repo=73ddb2b8-dda8-471b-b7a7-ca742b07483c&dst_dir=/&file_names=foo.c:bar.c:dir1:dir2" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' https://cloud.seafile.com/api2/repos/c7436518-5f46-4296-97db-2fcba4c8c8db/fileops/copy/
    

    Sample response

    "success"
    

    Errors

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

    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

    curl -d "dst_repo=73ddb2b8-dda8-471b-b7a7-ca742b07483c&dst_dir=/&file_names=foo.c:bar.c:dir1:dir2" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' https://cloud.seafile.com/api2/repos/c7436518-5f46-4296-97db-2fcba4c8c8db/fileops/move/
    

    Sample response

    "success"
    

    Errors

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

    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

    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/
    

    Sample response

    "success"
    

    Errors

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

    Download

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

    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

    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

    {
        "zip_token": "b2272645-35ee-44ce-8f68-07c022107015"
    }
    

    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

    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

    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.

    {
        "zipped":2,
        "total":2
    }
    

    Errors

    • 400 token invalid.
    • 500 Internal Server Error

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

    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

    Get User Avatar

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

    Request parameters

    • user
    • size

    Sample request

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

    Sample response

    {
        "url": "http://127.0.0.1:8000/media/avatars/default.png",
        "is_default": true,
        "mtime": 0
    }
    

    Get Group Avatar

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

    Request parameters

    • group_id
    • size

    Sample request

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

    Sample response

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

    Devices

    Get User Devices

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

    Sample request

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

    Sample response

    [
        {
            "synced_repos": [
                {
                    "repo_id": "47945b31-dedb-4b92-a048-32bf825595ce",
                    "sync_time": 1458008928,
                    "repo_name": "wopi"
                },
                {
                    "repo_id": "78c620ee-2989-4427-8eff-7748f4fbebc0",
                    "sync_time": 1457943466,
                    "repo_name": "lib-of-lian"
                }
            ],
            "last_accessed": "2016-03-15T10:28:48+08:00",
            "device_name": "lian",
            "platform_version": "",
            "platform": "linux",
            "user": "lian@lian.com",
            "key": "99abe1a7cc7d614db0bfa19db81e42ef675abe4f",
            "client_version": "5.0.0",
            "last_login_ip": "192.168.1.16",
            "device_id": "be10980211752515053bf9036a13139375de0cc8"
        },
        {
            "last_accessed": "2016-03-15T13:59:51+08:00",
            "device_name": "PLK-AL10",
            "platform_version": "5.0.2",
            "platform": "android",
            "user": "lian@lian.com",
            "key": "067051c94163ed193f2131d48c61882daa7cb238",
            "client_version": "2.0.3",
            "last_login_ip": "192.168.1.208",
            "device_id": "4a0d62c1f27b3b74"
        }
    ]
    

    Errors

    • 401 UNAUTHORIZED

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

    Request parameters

    • platform
    • device_id

    Sample request

    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

    {"success": true}
    

    Errors

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

    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

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

    Sample response

    {'events': [{'author': u'lian@lian.com',
                 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
                 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
                 'date': '2016-05-06',
                 'etype': u'repo-delete',
                 'name': u'lian',
                 'nick': u'lian',
                 'repo_id': u'13e2ae06-8927-465b-8f57-319b3a7cfbdd',
                 'repo_name': u'2',
                 'time': 1462552942,
                 '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>'},
                {'author': u'lian@lian.com',
                 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
                 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
                 'commit_id': u'1be92d40a1b526863bbf39e8abdae7d317a1195f',
                 '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>"',
                 'date': '2016-04-25',
                 'desc': u'Modified "excel-view.xlsx"',
                 'etype': u'repo-update',
                 'more_files': False,
                 'name': u'lian',
                 'nick': u'lian',
                 'repo_encrypted': False,
                 'repo_id': u'47945b31-dedb-4b92-a048-32bf825595ce',
                 'repo_name': u'wopi',
                 'time': 1461569125,
                 '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>'}
                 ...
                 ],
     'more': True,
     'more_offset': 15}
    

    Sample request for more activities

    curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/events/?start=15"
    

    Sample response for more activities

    {'events': [{'author': u'lian@lian.com',
                 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
                 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
                 'date': '2016-05-06',
                 'etype': u'repo-delete',
                 'name': u'lian',
                 'nick': u'lian',
                 'repo_id': u'13e2ae06-8927-465b-8f57-319b3a7cfbdd',
                 'repo_name': u'2',
                 'time': 1462552942,
                 '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>'},
                {'author': u'lian@lian.com',
                 'avatar': '<img src="/media/avatars/default.png" width="36" height="36" class="avatar" />',
                 'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
                 'commit_id': u'1be92d40a1b526863bbf39e8abdae7d317a1195f',
                 '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>"',
                 'date': '2016-04-25',
                 'desc': u'Modified "excel-view.xlsx"',
                 'etype': u'repo-update',
                 'more_files': False,
                 'name': u'lian',
                 'nick': u'lian',
                 'repo_encrypted': False,
                 'repo_id': u'47945b31-dedb-4b92-a048-32bf825595ce',
                 'repo_name': u'wopi',
                 'time': 1461569125,
                 '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>'}
                 ...
                 ],
     'more': True,
     'more_offset': 30}
    

    Get Thumbnail Image

    GET https://cloud.seafile.com/api2/repos/{repo_id}/thumbnail/

    Request parameters

    • repo_id
    • p
    • size

    Sample request

    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

    GET https://cloud.seafile.com/api2/search-user/?q=foo

    Request parameters

    • q

    Sample request

    curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/search-user/?q=foo
    

    Sample response

    [
        {'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
          'contact_email': u'foo@foo.com',
          'email': u'foo@foo.com',
          'name': 'foo'},
        {'avatar_url': 'https://cloud.seafile.com/media/avatars/default.png',
         'contact_email': u'foo-bar@foo-bar.com',
         'email': u'foo-bar@foo-bar.com',
         'name': 'foo-bar'}
    ]
    

    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

    Account

    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

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

    Sample response

    [
    {
        "email": "foo@foo.com"
    },
    {
        "email": "bar@bar.com"
    }
    ]
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Get Account Info

    GET https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    Sample request

    curl -v -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/user@mail.com/
    

    Sample response

    {
    "is_staff": false,
    "is_active": true,
    "id": 2,
    "create_time": 1356061187741686,
    "usage": 651463187,
    "total": 107374182400,
    "email": "user@mail.com"
    }
    

    Errors

    • 403 Permission error, only administrator can perform this action

    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

    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

    ...
    < HTTP/1.0 201 CREATED
    < Location: https://cloud.seafile.com/api2/accounts/newaccount@gmail.com/
    ...
    
    "success"
    

    Success

    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

    PUT https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    At least one of followings:

    • password
    • is_staff
    • is_active
    • name
    • note
    • storage

    Sample request

    curl -v -X PUT -d "password=654321&is_staff=true&storage=1073741824" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/user@mail.com/
    

    Sample response

    ...
    < HTTP/1.0 200 OK
    ...
    
    "success"
    

    Success

    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

    POST https://cloud.seafile.com/api2/accounts/{email}/

    Request parameters

    • op
    • to_user this user must exist

    Sample request

    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

    ...
    < HTTP/1.0 200 OK
    ...
    
    "success"
    

    Success

    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

    DELETE https://cloud.seafile.com/api2/accounts/{email}/

    Sample request

    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

    "success"
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Devices

    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

    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

    [
        {'has_next_page': False},
        [
            {
                'last_accessed': '2016-04-11T18:24:29+08:00',
                'last_login_ip': u'192.168.1.210',
                'platform': u'linux',
                'user': u'1@1.com',
                'client_version': u'2.0.4',
                'device_name': u'PLK-AL10',
                'device_id': u'4a0d62c1f27b3b74'
            }
        ]
    ]
    

    Errors

    • 403 Permission error, only administrator can perform this action

    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

    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

    [
        {'has_next_page': False},
        [
            {
                'last_accessed': '2016-04-11T18:24:29+08:00',
                'last_login_ip': u'192.168.1.210',
                'platform': u'ios',
                'user': u'1@1.com',
                'client_version': u'2.0.4',
                'device_name': u'PLK-AL10',
                'device_id': u'4a0d62c1f27b3b74'
            }
        ]
    ]
    

    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

    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

    {"success": true}
    

    Errors

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

    Get Device Errors

    This api is only supported in pro edition.

    GET https://cloud.seafile.com/api/v2.1/admin/device-errors/

    Sample request

    curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/device-errors/
    

    Sample response

    [
        {
            'repo_id': u'47945b31-dedb-4b92-a048-32bf825595ce',
            'device_ip': u'192.168.1.124',
            'error_time': '2016-04-13T17:49:11+08:00',
            'device_name': u'lian-ubuntu-1404-64',
            'email': u'1@1.com',
            'client_version': u'5.0.6',
            'error_msg': u'No permission.',
            'repo_name': u'wopi'
        }
    ]
    

    Errors

    • 403 Feature disabled.
    • 500 Internal Server Error

    Clean Device Errors

    This api is only supported in pro edition.

    DELETE https://cloud.seafile.com/api/v2.1/admin/device-errors/

    Sample request

    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

    {"success":true}
    

    Errors

    • 403 Feature disabled.
    • 500 Internal Server Error

    Default Library

    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

    curl -H 'Authorization: Token 024692f8411a656baa2cc2d5ed4cd46177b3b3d0' "https://cloud.seafile.com/api/v2.1/admin/default-library/?user_email=foo@foo.com"
    

    Sample response

    {
        "repo_id":"9e58655f-d2a2-4df9-baa2-5ca50698ad98",
        "exists":true,
        "user_email":"lian@lian.com"
    }
    

    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

    Available for Seafile v6.0.9+

    POST https://cloud.seafile.com/api/v2.1/admin/default-library/

    Sample request

    curl -d "user_email=foo@foo.com" -H 'Authorization: Token 024692f8411a656baa2cc2d5ed4cd46177b3b3d0' "https://cloud.seafile.com/api/v2.1/admin/default-library/"
    

    Sample response

    {
        "repo_id":"9e58655f-d2a2-4df9-baa2-5ca50698ad98",
        "exists":true,
        "user_email":"lian@lian.com"
    }
    

    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

    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

    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

    {
        "page_info": {
            "current_page": 1,
            "has_next_page": true
        },
        "repos": [
            {
                "name": null,
                "encrypted": false,
                "file_count": 0,
                "owner": "lian@lian.com",
                "size_formatted": "0 bytes",
                "id": "04df5005-1dfc-4e30-ae55-95ed6559583f",
                "size": 0
            },
            {
                "name": "My Library",
                "encrypted": false,
                "file_count": 161,
                "owner": "lian@lian.com",
                "size_formatted": "25.4 MB",
                "id": "2deffbac-d7be-4ace-b406-efb799083ee9",
                "size": 26617460
            }
            ...
        ]
    }
    

    Errors

    • 403 Permission error, only administrator can perform this action

    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

    curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/libraries/?name=file
    

    Sample response

    {
        "owner": "",
        "repos": [
            {
                "name": "file-preview",
                "encrypted": false,
                "file_count": 25,
                "owner": "lian@lian.com",
                "size_formatted": "10.9 MB",
                "id": "6ce1383b-ed1c-45c7-ab31-a13b64471e64",
                "size": 11437897
            }
        ],
        "name": "file"
    }
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Search Library by Owner

    Available for Seafile v6.0.0+

    GET https://cloud.seafile.com/api/v2.1/admin/libraries/?owner=lian@lian.com

    Request parameters

    • owner

    Sample request

    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

    {
        "owner": "lian@lian.com",
        "repos": [
            {
                "name": "lib-of-lian",
                "encrypted": false,
                "file_count": 0,
                "owner": "lian@lian.com",
                "size_formatted": "16.5 KB",
                "id": "78c620ee-2989-4427-8eff-7748f4fbebc0",
                "size": 16883
            },
            {
                "name": "encrypted",
                "encrypted": true,
                "file_count": 0,
                "owner": "lian@lian.com",
                "size_formatted": "18.1 MB",
                "id": "47695bb8-3364-4274-939d-3c5a0df9710c",
                "size": 18997225
            },
            ...
        ],
        "name": ""
    }
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Delete a Library

    Available for Seafile v6.0.0+

    DELETE https://cloud.seafile.com/api/v2.1/admin/libraries/{repo_id}/

    Sample request

    curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/libraries/ee3b2d19-1a06-47f0-bbfa-554cab3bdedc/
    

    Sample response

    {"success":true}
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Transfer a Library

    Available for Seafile v6.0.0+

    PUT https://cloud.seafile.com/api/v2.1/admin/libraries/{repo_id}/

    Sample request

    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

    {
        "name": "test-repo",
        "encrypted":false,
        "file_count":0,
        "owner":"1@1.com",
        "size_formatted":"0 bytes",
        "id":"ee3b2d19-1a06-47f0-bbfa-554cab3bdedc",
        "size":0
    }
    

    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

    GET https://cloud.seafile.com/api/v2.1/admin/libraries/{repo_id}/dirents/?parent_dir={parent_dir}

    • repo-id
    • parent_dir

    Sample request

    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

    {
        "repo_id": "c474a093-19dc-4ddf-b0b0-72b33214ba33",
        "dirent_list": [
            {
                "file_size": "",
                "last_update": "2016-12-19T03:35:14+00:00",
                "is_file": false,
                "obj_name": "book"
            },
            {
                "file_size": "",
                "last_update": "2016-10-12T07:43:32+00:00",
                "is_file": false,
                "obj_name": "image"
            },
            {
                "file_size": "47.0 KB",
                "last_update": "2017-02-13T02:41:05+00:00",
                "is_file": true,
                "obj_name": "123.md"
            }
        ],
        "is_system_library": false,
        "repo_name": "seacloud.cc.124"
    }
    

    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

    Shares

    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

    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

    [
        {
            "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
            "share_type": "user",
            "permission": "r",
            "path": "/",
            "user_name": "name of user 2",
            "user_email": "2@2.com"
        }
    ]
    

    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

    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

    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

    [
        {
            "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
            "share_type": "group",
            "permission": "rw",
            "group_name": "group-of-lian-2",
            "path": "/",
            "group_id": 2
        }
    ]
    

    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

    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

    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

    {
        "failed": [
            {
                "error_msg": "User invalid@email.com not found.",
                "user_email": "invalid@email.com"
            }
        ],
        "success": [
            {
                "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
                "share_type": "user",
                "permission": "r",
                "path": "/",
                "user_name": "name of user 1",
                "user_email": "1@1.com"
            }
        ]
    }
    

    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

    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

    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

    {
        "failed": [
            {
                "group_id": 1232,
                "error_msg": "Group %s not found"
            }
        ],
        "success": [
            {
                "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
                "share_type": "group",
                "permission": "r",
                "group_name": "group-of-lian",
                "path": "/",
                "group_id": 1
            }
        ]
    }
    

    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

    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

    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

    {
        "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
        "share_type": "user",
        "permission": "rw",
        "path": "/",
        "user_name": "name of user 1",
        "user_email": "1@1.com"
    }
    

    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

    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

    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

    {
        "repo_id": "ddd42241-e003-425d-960e-0f9f7144866f",
        "share_type": "group",
        "permission": "rw",
        "group_name": "group-of-lian",
        "path": "/",
        "group_id": 1
    }
    

    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

    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

    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

    {
        "success": true
    }
    

    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

    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

    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

    {
        "success": true
    }
    

    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

    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

    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

    {
        "page_info": {
            "current_page": 1,
            "has_next_page": true
        },
        "groups": [
            {
                "owner": "test@test.com",
                "created_at": "2016-08-01T16:58:14+08:00",
                "id": 1476,
                "name": "test_group"
            },
            {
                "owner": "1@1.com",
                "created_at": "2016-08-02T16:48:14+08:00",
                "id": 1486,
                "name": "group"
            }
            ...
        ]
    }
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Delete a Group

    Available for Seafile v6.0.0+

    DELETE https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/

    Sample request

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

    Sample response

    {"success":true}
    

    Errors

    • 403 Permission error, only administrator can perform this action

    Transfer a Group

    Available for Seafile v6.0.0+

    PUT https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/

    Sample request

    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

    {
        "owner": "1@1.com",
        "created_at": "2016-08-04T17:34:05+08:00",
        "id": 1528,
        "name": "test_group"
    }
    

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 User not found.
    • 500 Internal Server Error

    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

    curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/groups/64/libraries/
    

    Sample response

    [
        {
            "repo_id":"7460f7ac-a0ff-4585-8906-bb5a57d2e118",
            "name":"My Library",
            "permission":"rw",
            "group_id":65,
            "shared_by":"lian@lian.com",
            "size":97662
        }
    ]
    

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Group not found.

    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

    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

    {"success":true}
    

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Library/Group not found.
    • 500 Internal Server Error

    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

    curl -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api/v2.1/admin/groups/64/members/
    

    Sample response

    [
        {
            "login_id":"",
            "avatar_url":"https://cloud.seafile.com/media/avatars/0/1/a72299021077701e7c522c46fdaa87/resized/80/6ad30837f69ea7ef234dc272fb15e9e9.png",
            "contact_email":"lian@lian.com",
            "name":"name of lian",
            "is_admin":true,
            "role":"Owner",
            "group_id":65,
            "email":"lian@lian.com"
        },
        {
            "login_id":"",
            "avatar_url":"https://cloud.seafile.com/media/avatars/default.png",
            "contact_email":"1@1.com",
            "name":"123",
            "is_admin":false,
            "role":"Member",
            "group_id":65,
            "email":"1@1.com"
        }
    ]
    

    Errors

    • 403 Permission error, only administrator can perform this action
    • 404 Group not found.

    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

    curl -X DELETE -H 'Authorization: Token 444d2bbf1fc78ffbeedc4704c9f41e32d926ac94' https://cloud.seafile.com/api/v2.1/admin/groups/64/members/foo@foo.com/
    

    Sample response

    {"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

    Available for Seafile v6.0.8+

    POST https://cloud.seafile.com/api/v2.1/admin/groups/{group_id}/members/

    Sample request

    curl -d "email=1@1.com&email=2@1.com" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' http://192.168.1.124:8000/api/v2.1/admin/groups/65/members/
    

    Sample response

    {
        "failed":[
            {
                "email":"2@1.com","error_msg":"User 2@1.com is already a group member."
            }
        ],
        "success":[
            {
                "login_id":"",
                "avatar_url":"http://192.168.1.124:8000/media/avatars/default.png",
                "contact_email":"8@1.com",
                "name":"name of 8",
                "is_admin":0,
                "role":"Member",
                "group_id":65,
                "email":"8@1.com"
            }
        ]
    }
    

    Errors

    • 400 email invalid.
    • 404 Group not found.

    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

    curl -X PUT -d "is_admin=true" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' http://192.168.1.124:8000/api/v2.1/admin/groups/65/members/3@1.com/
    

    Sample response

    {
        "login_id":"",
        "avatar_url":"http://192.168.1.124:8000/media/avatars/default.png",
        "contact_email":"3@1.com",
        "name":"update name of 3",
        "is_admin":1,
        "role":"Admin",
        "group_id":65,
        "email":"3@1.com"
    }
    

    Errors

    • 400 email invalid.
    • 400 is_admin invalid.
    • 404 Group/User 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

    curl -X PUT -d "is_admin=false" -H 'Authorization: Token 0eb24ce5db35a31f70171eca2f760f03f59fa09a' http://192.168.1.124:8000/api/v2.1/admin/groups/65/members/3@1.com/
    

    Sample response

    {
        "login_id":"",
        "avatar_url":"http://192.168.1.124:8000/media/avatars/default.png",
        "contact_email":"3@1.com",
        "name":"update name of 3",
        "is_admin":0,
        "role":"Member",
        "group_id":65,
        "email":"3@1.com"
    }
    

    Errors

    • 400 email invalid.
    • 400 is_admin invalid.
    • 404 Group/User not found.
    • 500 Internal Server Error

    Admin Log

    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

    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

    [
        {
            'email': u'lian@lian.com',
            'login_ip': u'192.168.1.124',
            'name': u'lian',
            'login_time': '2016-03-31T14:42:23+08:00'
        },
        {
            'email': u'org@org.com',
            'login_ip': u'192.168.1.124',
            'name': u'org',
            'login_time': '2016-03-31T14:39:08+08:00'
        }
    ]
    

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    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

    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

    [
        {
            'repo_id': u'4929d0df-8c6c-43cb-8edf-40a8489689fb',
            'time': '2016-03-31T05:46:03+08:00',
            'etype': u'file-download-web',
            'ip': u'192.168.1.124',
            'user_name': u'org',
            'file_path': u'/earth.jpg',
            'user_email': u'org@org.com',
            'repo_name': ''
        },
        {
            'repo_id': u'513cd72c-c54a-463e-a18f-841efe91bd61',
            'time': '2016-03-31T06:25:22+08:00',
            'etype': u'file-download-web',
            'ip': u'192.168.1.124',
            'user_name': u'org',
            'file_path': u'/kj.md',
            'user_email': u'org@org.com',
            'repo_name': u'new-lib-of-org-1'
        }
    ]
    

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    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

    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

    [
        {
            'commit_id': u'55ec5350b16d6c72a044b5a9cd9b2d62ad439364',
            'file_operation': u'Added "user.csv".',
            'repo_id': u'513cd72c-c54a-463e-a18f-841efe91bd61',
            'repo_name': u'new-lib-of-org-1',
            'time': '2016-03-31T06:25:15+08:00',
            'user_email': u'org@org.com',
            'user_name': u'org'
        },
        {
            'commit_id': u'6820d809481e3c9fb856d0650ac73a09b570a301',
            'file_operation': u'Added "kj.md"',
            'repo_id': u'513cd72c-c54a-463e-a18f-841efe91bd61',
            'repo_name': u'new-lib-of-org-1',
            'time': '2016-03-31T06:25:21+08:00',
            'user_email': u'org@org.com',
            'user_name': u'org'
        }
    ]
    

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    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

    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

    [
        {
            'etype': u'add-repo-perm',
            'file_path': u'/folder',
            'from_email': u'org3@org3.com',
            'from_name': u'org3',
            'permission': u'rw',
            'repo_id': u'a84544e5-0b84-459d-b1e6-0399dabc76a0',
            'repo_name': '',
            'time': '2016-03-31T06:21:50+08:00',
            'to': u'org@org.com'
        },
        {
            'etype': u'add-repo-perm',
            'file_path': u'/folder',
            'from_email': u'org3@org3.com',
            'from_name': u'org3',
            'permission': u'rw',
            'repo_id': u'a84544e5-0b84-459d-b1e6-0399dabc76a0',
            'repo_name': '',
            'time': '2016-03-31T06:21:53+08:00',
            'to': u'777'
        }
    ]
    

    Errors

    • 400 start or end date invalid.
    • 403 Feature disabled.

    Organization

    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

    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

    "success"
    

    results matching ""

      No results matching ""