PATCH Conventions

In general, we use PATCH as the preferred way to update items. The PATCH operations allow for partial update of underlying data whereas a PUT is for full replacement. For example if you only want to change the name of a file or the description of a file, a PATCH will allow you to do that without concern of impacting any other metadata of the item. This allows for great forward and backward compatibility, since only the elements specified will be updated and any new elements added in the future are not impacted.
For more information about PATCH take a look at the following resources:

Examples of PATCH in action

The following examples show the PATCH body for a call to /teamsites/:teamsiteId/files/:libraryContentId

❗️

If you do not see a related patch example it means the object is NOT supported for update via PATCH.

{
    "name" : "the new file name"
}

Use the special keyword "root" to move items to the root folder.

{
    "parentFolderId" : "9ff027bc-77a1-4984-a198-2cd8f26af869"
}
{
    "description" : "The new description"
}
{
    "properties": [{
        "id": "b09a9677-b49d-4c53-8dfe-1fcd1eb4aab0",
        "values": [
            "Pitch"
        ]
    }]
}
{
    "experts": [{
        "id": "b09a9677-b49d-4c53-8dfe-1fcd1eb4aab0",
        "type": "user"
    }]
}
{
    "ownerId": "b09a9677-b49d-4c53-8dfe-1fcd1eb4aab0"
}
{
    "expiresAt": "2020-01-31"
}
{
    "externalId": "b09a9677-b49d-4c53-8dfe-1fcd1eb4aab0"
}
{
    "externalConnectionId": "b09a9677-b49d-4c53-8dfe-1fcd1eb4aab0"
}
{
    "url": {
        "url": "https://example.com",
        "openInNewWindow": true
    }
}

Below are examples of the supported methods to clear values via PATCH

❗️

Clearing values is not supported on the follow objects:

  1. name
  2. ownerId
  3. parentFolderId
  4. url.url
  5. url.openInNewWindow
{
    "description": "",
    "externalId": "",
    "externalConnectionId": "",
    "experts": [],
    "expiresAt": "",
    "properties": [{
        "id": "c1912805-be1c-4ec8-b4ed-e48859a05438",
        "name": "test property name",
        "values": []
    }]
}