Sample - Box Platform API
PUT/collaborations/{collaboration_id}

Update collaboration

Updates a collaboration. Can be used to change the owner of an item, or to accept collaboration invites. In case of accepting collaboration invite, role is not required.

1 parameter · 4 body fields
collaboration_idstringrequired
The ID of the collaboration.
rolestringoptional
The level of access granted.
Allowed:editorviewerprevieweruploaderpreviewer uploaderviewer uploaderco-ownerowner
statusstringoptional
Set the status of a `pending` collaboration invitation, effectively accepting, or rejecting the invite.
Allowed:pendingacceptedrejected
expires_atstringoptional
Update the expiration date for the collaboration. At this date, the collaboration will be automatically removed from the item. This feature will only work if the **Automatically remove invited collaborators: Allow folder owners to extend the expiry date** setting has been enabled in the **Enterprise Settings** of the **Admin Console**. When the setting is not enabled, collaborations can not have an expiry date and a value for this field will be result in an error. Additionally, a collaboration can only be given an expiration if it was created after the **Automatically remove invited collaborator** setting was enabled.
can_view_pathbooleanoptional
Determines if the invited users can see the entire parent path to the associated folder. The user will not gain privileges in any parent folder and therefore can not see content the user is not collaborated on. Be aware that this meaningfully increases the time required to load the invitee's **All Files** page. We recommend you limit the number of collaborations with `can_view_path` enabled to 1,000 per user. Only an owner or co-owners can invite collaborators with a `can_view_path` of `true`. Only an owner can update `can_view_path` on existing collaborations. `can_view_path` can only be used for folder collaborations. When you delete a folder with `can_view_path=true`, collaborators may still see the parent path. For instructions on how to remove this, see [Even though a folder invited via can_view_path is deleted, the path remains displayed](https://support.box.com/hc/en-us/articles/37472814319891-Even-though-a-folder-invited-via-can-view-path-is-deleted-the-path-remains-displayed).

4 status codes
200Returns an updated collaboration object unless the owner has changed.
idstringrequired
The unique identifier for this collaboration.
typestringrequired
The value will always be `collaboration`.
Allowed:collaboration
itemobjectoptional
app_itemobjectoptional
accessible_byobjectoptional
The user or group that is granted access.
invite_emailstringoptional
The email address used to invite an unregistered collaborator, if they are not a registered user.
rolestringoptional
The level of access granted.
Allowed:editorviewerprevieweruploaderpreviewer uploaderviewer uploaderco-ownerowner
expires_atstringoptional
When the collaboration will expire, or `null` if no expiration date is set.
is_access_onlybooleanoptional
If set to `true`, collaborators have access to shared items, but such items won't be visible in the All Files list. Additionally, collaborators won't see the path to the root folder for the shared item.
statusstringoptional
The status of the collaboration invitation. If the status is `pending`, `name` returns an empty string.
Allowed:acceptedpendingrejected
acknowledged_atstringoptional
When the `status` of the collaboration object changed to `accepted` or `rejected`.
created_byobjectoptional
created_atstringoptional
When the collaboration object was created.
modified_atstringoptional
When the collaboration object was last modified.
acceptance_requirements_statusobjectoptional
204If the role is changed to `owner`, the collaboration is deleted and a new collaboration is created. The previous `owner` of the old collaboration will be a `co-owner` on the new collaboration.
403Returns an error if the authenticated user does not have the right permissions to update the collaboration. Additionally, this error may occur when attempting to update the `expires_at` field for the collaboration without the **Automatically remove invited collaborators: Allow folder owners to extend the expiry date** setting enabled in the admin dashboard of the enterprise.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.
defaultAn unexpected client error.
typestringoptional
The value will always be `error`.
Allowed:error
statusintegeroptional
The HTTP status of the response.
codestringoptional
A Box-specific error code.
Allowed:createdacceptedno_contentredirectnot_modifiedbad_requestunauthorizedforbiddennot_foundmethod_not_allowedconflictprecondition_failed
messagestringoptional
A short message describing the error.
context_infoobjectoptional
A free-form object that contains additional context about the error. The possible fields are defined on a per-endpoint basis. `message` is only one example.
help_urlstringoptional
A URL that links to more information about why this error occurred.
request_idstringoptional
A unique identifier for this response, which can be used when contacting Box support.

Error handling

A 403 is returned: Returns an error if the authenticated user does not have the right permissions to update the collaboration.

Additionally, this error may occur when attempting to update the expires_at field for the collaboration without the Automatically remove invited collaborators: Allow folder owners to extend the expiry date setting enabled in the admin dashboard of the enterprise. Any other status is an error: An unexpected client error.