• Web API
  • Seafile Web API V2" level="1">Seafile Web API V2
    • API Basics" level="2">API Basics
    • Status Code" level="2">Status Code
    • Quick Start" level="2">Quick Start
    • Account" level="2">Account
      • List Accounts" level="3">List Accounts
      • Get Account Info" level="3">Get Account Info
      • Check Account Info" level="3">Check Account Info
      • Create Account" level="3">Create Account
      • Update Account" level="3">Update Account
      • Migrate Account" level="3">Migrate Account
      • Delete Account" level="3">Delete Account
      • Get Server Information" level="3">Get Server Information
    • Starred Files" level="2">Starred Files
      • List starred files" level="3">List starred files
      • Star A File" level="3">Star A File
      • Unstar A File" level="3">Unstar A File
    • Group" level="2">Group
      • List Groups" level="3">List Groups
      • Add A Group" level="3">Add A Group
      • Delete Group" level="3">Delete Group
      • Rename Group" level="3">Rename Group
      • Group Member" level="3">Group Member
        • Add A Group Member" level="4">Add A Group Member
        • Delete A Group Member" level="4">Delete A Group Member
      • Group Message" level="3">Group Message
        • Get Group Messages" level="4">Get Group Messages
        • Get Group Message Detail" level="4">Get Group Message Detail
        • Send A Group Message" level="4">Send A Group Message
        • Reply A Group Message" level="4">Reply A Group Message
        • Get Group Message Replies" level="4">Get Group Message Replies
    • Share" level="2">Share
      • File Share Link" level="3">File Share Link
        • List File Share Links" level="4">List File Share Links
        • Create File Share Link" level="4">Create File Share Link
        • Delete File Share Link" level="4">Delete File Share Link
        • Send Share Link Email" level="4">Send Share Link Email
        • Send Upload Link Email" level="4">Send Upload Link Email
        • List Direntry in Dir Download Link" level="4">List Direntry in Dir Download Link
      • Shared Libraries" level="3">Shared Libraries
        • List Shared Libraries" level="4">List Shared Libraries
        • List Be Shared Libraries" level="4">List Be Shared Libraries
        • Share A Library" level="4">Share A Library
        • Unshare A Library" level="4">Unshare A Library
    • Library" level="2">Library
      • Library" level="3">Library
        • Get Default Library" level="4">Get Default Library
        • Create Default Library" level="4">Create Default Library
        • List Libraries" level="4">List Libraries
        • Get Library Info" level="4">Get Library Info
        • Get Library Owner" level="4">Get Library Owner
        • Get Library History" level="4">Get Library History
        • Create Library" level="4">Create Library
        • Check/Create Sub Library" level="4">Check/Create Sub Library
        • Delete Library" level="4">Delete Library
        • Rename Library" level="4">Rename Library
        • Decrypt Library" level="4">Decrypt Library
        • Create Public Library" level="4">Create Public Library
        • Remove Public Library" level="4">Remove Public Library
        • Fetch library download info" level="4">Fetch library download info
        • List Virtual Libraries" level="4">List Virtual Libraries
        • Search Libraries" level="4">Search Libraries
      • File" level="3">File
        • View File Through Owa" level="4">View File Through Owa
        • Download File" level="4">Download File
        • Get File Detail" level="4">Get File Detail
        • Get File History" level="4">Get File History
        • Download File From a Revision" level="4">Download File From a Revision
        • Create File" level="4">Create File
        • Rename File" level="4">Rename File
        • Lock File" level="4">Lock File
        • Unlock File" level="4">Unlock File
        • Move File" level="4">Move File
        • Copy File" level="4">Copy File
        • Revert File" level="4">Revert File
        • Delete File" level="4">Delete File
        • Upload File" level="4">Upload File
          • Get Upload Link" level="5">Get Upload Link
          • Upload File" level="5">Upload File
        • Update file" level="4">Update file
          • Get Update Link" level="5">Get Update Link
          • Update File" level="5">Update File
        • Get Upload Blocks Link" level="4">Get Upload Blocks Link
        • Get Update Blocks Link" level="4">Get Update Blocks Link
      • Directory" level="3">Directory
        • List Directory Entries" level="4">List Directory Entries
        • Create New Directory" level="4">Create New Directory
        • Rename Directory" level="4">Rename Directory
        • Delete Directory" level="4">Delete Directory
        • Download Directory" level="4">Download Directory
        • Share Directory" level="4">Share Directory
      • Multiple Files / Directories" level="3">Multiple Files / Directories
        • Copy" level="4">Copy
        • Move" level="4">Move
        • Delete" level="4">Delete
    • Avatar" level="2">Avatar
      • Get User Avatar" level="3">Get User Avatar
      • Get Group Avatar" level="3">Get Group Avatar
      • Get File Activities" level="3">Get File Activities
      • Get Thumbnail Image" level="3">Get Thumbnail Image
    • Add Organization" level="2">Add Organization

    Web API






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

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

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

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

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

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

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

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

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

    ping

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

    obtain auth token

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

    If two-factor authentication is enabled in your account, you should add one-time token in the request header, otherwise you will get error response {"non_field_errors":["Two factor auth token is missing."]}.

    1. curl --header "X-SEAFILE-OTP:585971" -d "username=username@example.com&password=123456" https://cloud.seafile.com/api2/auth-token/
    2. {"token":"dd9dbeeebc927c9f289a9e9a9d940eddf8c1ffd5"}

    auth ping

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

    Account" class="reference-link">Account

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

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

    Request parameters

    • start (default to 0)
    • limit (default to 100)
    • scope (default None, accepted values: ‘LDAP’ or ‘DB’)

    To retrieve all users, just set both start and limit to -1.

    If scope parameter is passed then accounts will be searched inside the specific scope, otherwise it will be used the old approach: first LDAP and, if no account is found, DB.

    Sample request

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

    Sample response

    1. [
    2. {
    3. "email": "foo@foo.com"
    4. },
    5. {
    6. "email": "bar@bar.com"
    7. }
    8. ]

    Errors

    • 403 Permission error, only administrator can perform this action

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

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

    Request parameters

    Sample request

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

    Sample response

    1. {
    2. "is_staff": false,
    3. "is_active": true,
    4. "id": 2,
    5. "create_time": 1356061187741686,
    6. "usage": 651463187,
    7. "total": 107374182400,
    8. "email": "user@mail.com"
    9. }

    Errors

    • 403 Permission error, only administrator can perform this action

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

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

    Sample request

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

    Sample response

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

    Errors

    • 403 Invalid token

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

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

    Request parameters

    • password
    • is_staff (defaults to False)
    • is_active (defaults to True)

    Sample request

    1. curl -v -X PUT -d "password=123456" -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/newaccount@gmail.com/

    Sample response

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

    Success

    1. Response code 201(Created) is returned and the Location header provides shared link.

    Errors

    • 403 Permission error, only administrator can perform this action

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

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

    Request parameters

    At least one of followings:

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

    Sample request

    1. 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

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

    Success

    1. Response code 200(OK) is returned.

    Errors

    • 400 Bad Request, keyword password is required
    • 403 Permission error, only administrator can perform this action

    Migrate Account" class="reference-link">Migrate Account

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

    Request parameters

    • op
    • to_user this user must exist

    Sample request

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

    Sample response

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

    Success

    1. Response code 200(OK) is returned.

    Errors

    • 400 Bad Request, arguments are missing or invalid
    • 403 Permission error, only administrator can perform this action

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

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

    Sample request

    1. curl -v -X DELETE -H "Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/accounts/newaccount@gmail.com/

    Sample response

    1. "success"

    Errors

    • 403 Permission error, only administrator can perform this action

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

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

    Note:

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

    Sample request

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

    Sample response

    Sample response from a seafile community edition server:

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

    Sample response from a seafile pro edition server:

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

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

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

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

    Sample request

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

    Sample response

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

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

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

    Request parameters

    • repo_id (post)
    • p (post)

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

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

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

    Request parameters

    • repo_id
    • p

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

    Group" class="reference-link">Group

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

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

    Sample request

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

    Sample response

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

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

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

    Request parameters

    • group_name

    Sample request

    1. curl -X PUT -d "group_name=newgroup" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/"

    Sample response

    1. {"group_id": 3, "success": true}

    Errors

    • 400 There is already a group with that name.

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

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

    Request parameters

    None

    Sample request

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

    Success

    200 if everything is fine.

    Errors

    • 400 if ad group id format
    • 404 if Group not found
    • 403 if Forbid to delete group
    • 520 if Failed to remove group (generic error)

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

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

    Request parameters

    • operation (value must be ‘rename’)
    • newname (the new name for the group)

    Sample request

    1. curl -d "operation=rename&newname=pinkfloyd_lovers" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/1/"

    Success

    200 if everything is fine.

    Errors

    • 404 if Group not found
    • 403 if Forbid to rename group
    • 400 if Newname is missing or if Group name is not valid of if There is already a group with that name or Operation can only be rename.

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

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

    PUT https://cloud.seafile.com/api2/groups/{group_id}/members/

    Request parameters

    • user_name

    Sample request

    1. curl -X PUT -d "user_name=user@example.com"-H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/1/members/"

    Sample response

    1. {"success": true}

    Errors

    • 400 invalid group id
    • 403 only administrators can add group members
    • 404 unable to find group

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

    DELETE https://cloud.seafile.com/api2/groups/{group_id}/members/

    Request parameters

    • user_name

    Sample request

    1. curl -X DELETE -d "user_name=user@example.com" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/groups/1/members/"

    Sample response

    1. {"success": true}

    Errors

    • 400 invalid group id
    • 403 only administrators can remove group members
    • 404 unable to find group

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

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

    GET https://cloud.seafile.com/api2/group/msgs/{group_id}/

    Request parameters

    • group_id

    Sample request

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

    Sample response

    1. {
    2. "next_page": -1,
    3. "msgs": [
    4. {
    5. "reply_cnt": 0,
    6. "timestamp": 1398230602,
    7. "replies": [],
    8. "from_email": "user@example.com",
    9. "msgid": 1,
    10. "msg": "test discuss",
    11. "nickname": "user"
    12. }
    13. ]
    14. }

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

    GET https://cloud.seafile.com/api2/group/{group_id}/msg/{msg_id}/

    Request parameters

    • group_id
    • msg_id

    Sample request

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

    Sample response

    1. {
    2. "reply_cnt": 2,
    3. "timestamp": 1398230602,
    4. "replies": [
    5. {
    6. "msg": "this is another test",
    7. "timestamp": 1398232319,
    8. "nickname": "user",
    9. "msgid": 1,
    10. "from_email": "user@example.com"
    11. },
    12. {
    13. "msg": "this is another test",
    14. "timestamp": 1398232508,
    15. "nickname": "user",
    16. "msgid": 3,
    17. "from_email": "user@example.com"
    18. }
    19. ],
    20. "from_email": "user@example.com",
    21. "msgid": 1,
    22. "msg": "test discuss",
    23. "nickname": "user"
    24. }

    Errors

    • 404 message not found

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

    POST https://cloud.seafile.com/api2/group/msgs/{group_id}/

    Request parameters

    • message
    • group_id
    • repo_id(optional)
    • path(optional)

    Sample request

    1. curl -d "message=this is another test&repo_id=c7436518-5f46-4296-97db-2fcba4c8c8db&path=/123.md" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/group/msgs/1/"

    Sample response

    1. {
    2. "msgid": 3
    3. }

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

    POST https://cloud.seafile.com/api2/group/{group_id}/msg/{msg_id}

    Request parameters

    • group_id
    • msg_id
    • message

    Sample request

    1. curl -d "message=this is a reply" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/group/1/msg/1/"

    Sample response

    1. {
    2. "msgid": 3
    3. }

    Errors

    • 404 message not found

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

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

    Sample request

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

    Sample response

    1. [
    2. {
    3. "reply_cnt": 1,
    4. "timestamp": 1398231100,
    5. "replies": [
    6. {
    7. "msg": "@user test reply",
    8. "timestamp": 1398234493,
    9. "nickname": "123",
    10. "msgid": 5,
    11. "from_email": "user@example.com"
    12. }
    13. ],
    14. "from_email": "user@example.com",
    15. "att": {
    16. "repo": "c7436518-5f46-4296-97db-2fcba4c8c8db",
    17. "path": "/123.md",
    18. "type": "file",
    19. "src": "recommend"
    20. },
    21. "msgid": 3,
    22. "msg": "this is another test",
    23. "nickname": "user"
    24. }
    25. ]

    Share" class="reference-link">Share

    GET https://cloud.seafile.com/api2/shared-links/

    Sample request

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

    Sample response

    1. {"fileshares": [{"username": "user@example.com", "repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4", "ctime": null, "s_type": "d", "token": "e410827494", "view_cnt": 0, "path": "/123/"}, {"username": "user@example.com", "repo_id": "affc837f-7fdd-4e91-b88a-32caf99897f2", "ctime": null, "s_type": "f", "token": "0ae587a7d1", "view_cnt": 0, "path": "/lian123.md"}]}

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

    Request parameters

    • repo-id
    • p (Path to the file)
    • share_type (optional, download or upload, default download)
    • password (optional)
    • expire (optional)

    Sample request

    Create download link for file

    1. curl -v -X PUT -d "p=/foo.md" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/afc3b694-7d4c-4b8a-86a4-89c9f3261b12/file/shared-link/

    Create download link for directory with password and expire date

    1. curl -v -X PUT -d "password=password&expire=6&p=/123/" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/afc3b694-7d4c-4b8a-86a4-89c9f3261b12/file/shared-link/

    Create upload link for directory

    1. curl -v -X PUT -d "share_type=upload&p=/123/" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/afc3b694-7d4c-4b8a-86a4-89c9f3261b12/file/shared-link/

    Sample response

    1. ...
    2. < HTTP/1.0 201 CREATED
    3. < Location: https://cloud.seafile.com/f/9b437a7e55/
    4. ...

    Success

    1. Response code 201(Created) is returned and the Location header provides shared link.

    Errors

    • 400 Path is missing
    • 400 Password(if link is encrypted) is missing
    • 500 Internal server error

    DELETE https://cloud.seafile.com/api2/shared-links/?t=0ae587a7d1

    Request parameters

    • t

    Sample request

    1. curl -v -X DELETE -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/shared-links/?t=0ae587a7d1"

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...

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

    Request parameters

    • token
    • email
    • extra_msg (not necessary)

    Sample request

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

    Sample response

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

    Errors

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

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

    Request parameters

    • token
    • email
    • extra_msg (not necessary)

    Sample request

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

    Sample response

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

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

    Request parameters

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

    Sample request

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

    Sample response

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

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

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

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

    Sample request

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

    Sample response

    1. [{"repo_id": "7d42522b-1f6f-465d-b9c9-879f8eed7c6c", "share_type": "personal", "permission": "rw", "encrypted": false, "user": "user@example.com", "last_modified": 1361072500, "repo_desc": "ff", "group_id": 0, "repo_name": "\u6d4b\u8bd5\u4e2d\u6587pdf"}, {"repo_id": "79bb29cd-b683-4844-abaf-433952723ca5", "share_type": "group", "permission": "rw", "encrypted": false, "user": "user@example.com", "last_modified": 1359182468, "repo_desc": "test", "group_id": 1, "repo_name": "test_enc"}]

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

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

    Sample request

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

    Sample response

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

    Share A Library" class="reference-link">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

    1. 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

    1. "success"

    Unshare A Library" class="reference-link">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

    1. 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

    1. "success"

    Library" class="reference-link">Library

    Library" class="reference-link">Library

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

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

    Sample request

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

    Sample response

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

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

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

    Sample request

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

    Sample response

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

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

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

    Sample request

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

    Sample response

    1. [
    2. {
    3. "permission": "rw",
    4. "encrypted": false,
    5. "mtime": 1400054900,
    6. "owner": "user@mail.com",
    7. "id": "f158d1dd-cc19-412c-b143-2ac83f352290",
    8. "size": 0,
    9. "name": "foo",
    10. "type": "repo",
    11. "virtual": false,
    12. "desc": "new library",
    13. "root": "0000000000000000000000000000000000000000"
    14. },
    15. {
    16. "permission": "rw",
    17. "encrypted": false,
    18. "mtime": 1400054802,
    19. "owner": "user@mail.com",
    20. "id": "0536b11a-a5fd-4482-9314-728cb3472f54",
    21. "size": 0,
    22. "name": "foo",
    23. "type": "repo",
    24. "virtual": false,
    25. "desc": "new library",
    26. "root": "0000000000000000000000000000000000000000"
    27. }
    28. ]

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

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

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

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

    Errors

    • 403 Permission error, only administrator can perform this action

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

    1. {"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}

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

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

    Request parameters

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

    Sample request

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

    Sample response

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

    Success

    Response code 200 and newly created library information are returned.

    Errors

    • 400 Library name missing.
    • 520 Operation failed.

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

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

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

    Request parameters

    • repo-id
    • p
    • name

    Sample request

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

    Sample response

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

    Errors

    • 400 Argument missing
    • 500 INTERNAL SERVER ERROR

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

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

    Sample request

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

    Sample response

    “success”

    Errors

    • 400 Library does not exist.

    • 403 Only library owner can perform this operation.

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

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

    Sample request

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

    Sample response

    “success”

    Errors

    • 404 Library not found.

    • 403 You do not have permission to rename this library.

    • 500 Unable to rename library

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

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

    Request parameters

    • password

    Sample request

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

    Sample response

    “success”

    Errors

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

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...

    Success

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

    Errors

    • 404 Repo not found
    • 403 Forbid to access this repo
    • 500 INTERNAL SERVER ERROR, Unable to make repo public

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

    1. ...
    2. < HTTP/1.0 200 OK
    3. ...

    Success

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

    Errors

    • 404 Repo not found
    • 403 Forbid to access this repo
    • 500 INTERNAL SERVER ERROR, Unable to remove public repo

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

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

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

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

    Sample request

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

    Sample response

    1. {"virtual-repos":
    2. [
    3. {"virtual_perm": "rw", "store_id": null, "worktree_invalid": false, "encrypted": false, "origin_repo_name": "lian", "last_modify": 0, "no_local_history": false, "head_branch": null, "last_sync_time": 0, "id": "51344de8-456f-4dc7-ac08-718827994252", "size": 0, "share_permission": null, "worktree_changed": false, "worktree_checktime": 0, "origin_path": "/lian", "is_virtual": true, "origin_repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4", "version": 1, "random_key": null, "is_original_owner": true, "shared_email": null, "enc_version": 0, "head_cmmt_id": "bc666fdc60d2352b9f6a0324ac64168d43724eed", "desc": null, "index_corrupted": false, "magic": null, "name": "lian", "worktree": null, "auto_sync": false, "relay_id": null},
    4. {"virtual_perm": "rw", "store_id": null, "worktree_invalid": false, "encrypted": false, "origin_repo_name": "lian", "last_modify": 0, "no_local_history": false, "head_branch": null, "last_sync_time": 0, "id": "c0a3283c-013c-4a7c-8f68-006f06fa6dec", "size": 0, "share_permission": null, "worktree_changed": false, "worktree_checktime": 0, "origin_path": "/", "is_virtual": true, "origin_repo_id": "a582d3bc-bcf5-421e-9125-741fa56d18d4", "version": 1, "random_key": null, "is_original_owner": true, "shared_email": null, "enc_version": 0, "head_cmmt_id": "ff18229aadc9acc73ad481278d5b4c42b3353aa0", "desc": null, "index_corrupted": false, "magic": null, "name": "123", "worktree": null, "auto_sync": false, "relay_id": null}
    5. ]
    6. }

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

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

    Request parameters

    • q
    • per_page (optional)

    Sample request

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

    Sample response

    1. {
    2. "has_more": false,
    3. "total": 3,
    4. "results": [
    5. {
    6. "repo_id": "691b3e24-d05e-43cd-a9f2-6f32bd6b800e",
    7. "name": "api.md",
    8. "oid": "8ea78453bb474359cd9d8e2c4c4d8d9cbdcef0a2",
    9. "last_modified": 1398045167,
    10. "fullpath": "/api.md",
    11. "size": 18939
    12. },
    13. {
    14. "repo_id": "c5509062-9bca-4933-a7e0-c6da1d5f82be",
    15. "name": "home.md",
    16. "oid": "dda57aaffa5179829e064c7d0c142f47a8a65d3b",
    17. "last_modified": 1397096831,
    18. "fullpath": "/home.md",
    19. "size": 1954
    20. },
    21. {
    22. "repo_id": "c5509062-9bca-4933-a7e0-c6da1d5f82be",
    23. "name": "\u5e38\u89c1\u5b89\u88c5\u95ee\u9898.md",
    24. "oid": "8573f982eeb478b932a55ec13218f4f90a7c5a27",
    25. "last_modified": 1397188959,
    26. "fullpath": "/\u5e38\u89c1\u5b89\u88c5\u95ee\u9898.md",
    27. "size": 1050
    28. }
    29. ]
    30. }

    Errors

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

    File" class="reference-link">File

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

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

    Request parameters

    • repo-id
    • path

    Sample request

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

    Sample response

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

    After get response

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

    For more info, you can see this official docs.

    Errors

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

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

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

    Request parameters

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

    Sample request

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

    Sample response

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

    Errors

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

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

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

    • repo-id
    • p

    Sample request

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

    Sample response

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

    Errors

    • 400 Path is missing
    • 520 Operation failed.

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

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

    Request parameters

    • repo-id
    • p

    Sample request

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

    Sample response

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

    Errors

    • 400 Path is missing
    • 404 File not found

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

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

    Request parameters

    • repo-id
    • p
    • commit_id

    Sample request

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

    Sample response

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

    Errors

    • 400 Path is missing
    • 404 Revision not found

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

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

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

    1. 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

    1. ...
    2. < HTTP/1.1 201 CREATED
    3. ...
    4. "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" class="reference-link">Rename File

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

    Request parameters

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

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

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

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

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

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

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

    Request parameters

    • repo-id
    • p
    • operation

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

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

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

    Request parameters

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

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

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

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

    Request parameters

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

    Sample request

    1. curl -v -d "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

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

    Success

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

    Errors

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

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

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

    Request parameters

    • repo_id
    • p
    • commit_id

    Sample request

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

    Sample response

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

    Success

    1. Response code 200(OK) is returned.

    Errors

    • 400 Path is missing

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

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

    Request parameters

    • repo-id
    • p

    Sample request

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

    Sample response

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

    Errors

    • 400 Path is missing
    • 520 Operation failed.

    Note

    This can also be used to delete directory.

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

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

    Request parameters

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

    Sample request

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

    Sample response

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

    Errors

    1. 403 Permission denied.
    2. 500 Run out of quota
    Upload File" class="reference-link">Upload File

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

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

    Errors

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

    Sample request

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

    Sample response

    1. "adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"

    Note

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

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

    Request parameters

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

    Sample request

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

    Sample response

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

    Errors

    1. 403 Permission denied.
    2. 500 Run out of quota
    Update File" class="reference-link">Update File

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

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

    Request parameters

    • target_file

    Sample request

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

    Returns

    The id of the updated file

    Sample response

    1. "adc83b19e793491b1c6ea0fd8b46cd9f32e592fc"

    Errors

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

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

    Request parameters

    • repo-id

    Sample request

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

    Sample response

    1. "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

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

    Sample response

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

    Errors

    • 403 Can not access repo
    • 520 above quota

    Directory" class="reference-link">Directory

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

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

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

    Sample request

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

    Sample response

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

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

    Errors

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

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

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

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

    Sample request

    1. curl -d "operation=mkdir" -v -H 'Authorization: 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

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

    Success

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

    Errors

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

    Notes

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

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

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

    Parameters

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

    Sample request

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

    Success

    Response code 200 if everything is ok

    Errors

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

    Notes

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

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

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

    • repo-id
    • p

    Sample request

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

    Sample response

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

    Success

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

    Errors

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

    Note

    This can also be used to delete file.

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

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

    • repo-id
    • p

    Sample request

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

    Sample response

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

    Errors

    • 400 Path is missing or invalid(e.g. p=/), or unable to download directory, size is too large
    • 404 Repo(path) not found(exist)
    • 520 Operation failed.

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

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

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

    Sample request for share folder to user

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

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

    Sample request for share folder to group

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

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

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

    Copy" class="reference-link">Copy

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

    Request parameters

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

    Sample request

    1. curl -d "dst_repo=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

    1. "success"

    Errors

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

    Move" class="reference-link">Move

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

    Request parameters

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

    Sample request

    1. curl -d "dst_repo=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

    1. "success"

    Errors

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

    Delete" class="reference-link">Delete

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

    Request parameters

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

    Sample request

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

    Sample response

    1. "success"

    Errors

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

    Avatar" class="reference-link">Avatar

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

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

    Request parameters

    • user
    • size

    Sample request

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

    Sample response

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

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

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

    Request parameters

    • group_id
    • size

    Sample request

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

    Sample response

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

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

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

    Request parameters

    this api will only return first 15 records of activities. if want get more, pass start parameter

    • start (default 0)

    Sample request

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

    Sample response

    1. {"more_offset": 15, "events":[{"repo_id": "6f3d28a4-73ae-4d01-a727-26774379dcb9", "author": "mysnowls@163.com", "nick": "lins05", "time": 1398078909, "etype": "repo-update", "repo_name": "Downloads", "desc": "Added \"seafile-cli_3.0.2_i386.tar.gz\"."},{"repo_id": "6f3d28a4-73ae-4d01-a727-26774379dcb9", "author": "mysnowls@163.com", "nick": "lins05", "time": 1398075540, "etype": "repo-update", "repo_name": "Downloads", "desc": "Added \"seafile-server_3.0.0_x86-64.tar.gz\"."}], "more": false}

    Sample request for more activities

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

    Sample response for more activities

    1. {"more_offset": 30, "events":[{"repo_id": "6f3d28a4-73ae-4d01-a727-26774379dcb9", "author": "mysnowls@163.com", "nick": "lins05", "time": 1398078909, "etype": "repo-update", "repo_name": "Downloads", "desc": "Added \"seafile-cli_3.0.2_i386.tar.gz\"."},{"repo_id": "6f3d28a4-73ae-4d01-a727-26774379dcb9", "author": "mysnowls@163.com", "nick": "lins05", "time": 1398075540, "etype": "repo-update", "repo_name": "Downloads", "desc": "Added \"seafile-server_3.0.0_x86-64.tar.gz\"."}], "more": false}

    Get Thumbnail Image" class="reference-link">Get Thumbnail Image

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

    Request parameters

    • repo_id
    • p
    • size

    Sample request

    1. curl -H 'Authorization: Token 40f9a510a0629430865dc199a3880898ad2e48fc' https://cloud.seafile.com/api2/repos/fbead5d0-4817-4446-92f3-7ac8e6a8e5f5/thumbnail/?p=/5.jpg\&size=123 > thumbnail.png

    Add Organization" class="reference-link">Add Organization

    This API is only used internally to create an organization account in seacloud.cc.

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

    Request parameters

    • username
    • password
    • org_name
    • prefix
    • quota
    • member_limit

    Sample request

    1. curl -v -X POST -d "username=example@example.com&password=example&org_name=example&prefix=example&quota=100&member_limit=10" -H "Authorization: Token ccdff90e4d1efe76b2b3d91c06b027a5cff189d4" -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/organization/

    Sample response

    1. "success"