Skip to content
campaiDeveloper
campai.com

Misc · Drive

POST/{organizationId}/misc/drive/folders/{folderId}/shares

Share folder

Replaces the shares for a folder using the supplied organization ID, folder ID and shares. Users, contacts, contact segments, contact types and teams can access the folder and its subfolders in the Connect app; teams can only view. The endpoint returns no content.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • Organization access with the drive.edit permission is required.
  • Callers with assigned-only access to drive cannot share folders.

Request

Path parameters

  • organizationIdidrequired
  • folderIdidrequired

Body

Content-Type: application/json

  • sharesobject[]required

    at most 200 items

    4 properties
    • typestringrequired
      user contact segment contactType team
    • idstringrequired

      1–64 characters

    • namestringrequired

      1–200 characters

    • accessstringrequired
      view add submit
Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/misc/drive/folders/YOUR_FOLDER_ID/shares' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

No response body is specified.

What else happens

  • After the share checks pass, the endpoint replaces the matching folder's shares.

Errors

Other errors

StatusErrorWhen
400One of the contacts was not foundIf a shared contact is not found in the organization, the endpoint returns HTTP 400 with routes.misc.drive.invalidShare.
400Teams can only view shared foldersIf a team share requests access other than view, the endpoint returns HTTP 400 with routes.misc.drive.teamShareViewOnly.
400Folders can only be shared with teams, not with subteamsIf a shared team is not found as a top-level team in the organization, the endpoint returns HTTP 400 with routes.misc.drive.invalidTeamShare.
403You cannot share foldersAssigned-only access to drive returns HTTP 403 with routes.misc.drive.noSharing.
404The folder was not foundIf the folder is not found in the organization, the endpoint returns HTTP 404 with routes.misc.drive.noFolder.

Errors nearly every request can meet are listed under Errors.