Skip to content

Update Team Folder

It update Team Folder members or invite new members into it.

Endpoint

http
PATCH /api/v1/teams/folders/{folder_id}

Parameters

Path parameters

ParameterTypeRequiredDescription
folder_idstringyes-

Body parameters

ParameterTypeRequiredDescription
invitationsarrayyesThe array of actual invitations. If you'd like to invite new member, include it in invitations array. If you'd like to remove invitation, just void the member in invitations array. The backend synchronize the list.
membersarrayyesThe array of actual members. If you void some actual member in the list, the member will be detached from the members of the team folder. The backend synchronize the list.
invitations.*.emailstringyesThe email address of the user
invitations.*.permissionstringyesThe permission for the user. Can be can-edit or can-view
invitations.*.typestringyesThe type of the object, invitation value is required
members.*.iduuidyesThe email address of the user
members.*.permissionstringyesThe permission for the user. Can be can-edit or can-view

Request example

sh
curl --location --request PATCH 'https://files.ro/api/v1/teams/folders/{folder_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
  "invitations": [
    {
      "email": "jane@doe.com",
      "permission": "can-view",
      "type": "invitation"
    },
    {
      "email": "pepe@doe.com",
      "permission": "can-view",
      "type": "invitation"
    }
  ],
  "members": [
    {
      "permission": "can-edit",
      "id": "{user_id}"
    }
  ]
}'

Response

json
{
  "data": {
    "id": "folder_123",
    "type": "folder",
    "attributes": {
      "name": "Projects",
      "color": "#00BC7E",
      "emoji": null,
      "filesize": 12345678,
      "isTeamFolder": false,
      "items": 12,
      "trashed_items": 0,
      "created_at": "01. Jan. 2024",
      "updated_at": "02. Jan. 2024",
      "deleted_at": null
    },
    "relationships": {
      "shared": {
        "data": {
          "id": "share_123",
          "type": "shared",
          "attributes": {
            "permission": "editor",
            "protected": false,
            "item_id": "item_123",
            "expire_in": 24,
            "token": "share_token",
            "link": "https://files.ro/share/share_token",
            "type": "folder"
          }
        }
      },
      "parent": {
        "data": {
          "type": "folder",
          "id": "folder_root",
          "attributes": {
            "name": "Root"
          }
        }
      },
      "user": {
        "data": {
          "type": "user",
          "id": "user_123",
          "attributes": {
            "name": "Jane Doe",
            "avatar": "https://files.ro/storage/avatars/jane.png",
            "color": "#00BC7E"
          }
        }
      }
    }
  }
}
json
{
  "type": "error",
  "message": "You exceed your members limit."
}
json
{
  "message": "This action is unauthorized."
}
json
{
  "type": "error",
  "message": "You are not authorized"
}
json
{
  "message": "The given data was invalid.",
  "errors": {
    "field": [
      "The field is required."
    ]
  }
}