{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/Collaboration",
  "title": "Collaboration",
  "type": "object",
  "x-box-resource-id": "collaboration",
  "x-box-tag": "user_collaborations",
  "description": "Collaborations define access permissions for users and groups to files and\nfolders, similar to access control lists. A collaboration object grants a\nuser or group access to a file or folder with permissions defined by a\nspecific role.",
  "required": [
    "id",
    "type"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier for this collaboration.",
      "example": "12345678"
    },
    "type": {
      "type": "string",
      "description": "`collaboration`",
      "example": "collaboration",
      "enum": [
        "collaboration"
      ]
    },
    "item": {
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/components/schemas/File"
            },
            {
              "$ref": "#/components/schemas/Folder"
            },
            {
              "$ref": "#/components/schemas/WebLink"
            }
          ]
        },
        {
          "description": "The file or folder to which access is granted. The field is\n`null` when the collaboration `status` is `pending`."
        }
      ],
      "nullable": true
    },
    "accessible_by": {
      "allOf": [
        {
          "oneOf": [
            {
              "$ref": "#/components/schemas/User--Collaborations"
            },
            {
              "$ref": "#/components/schemas/Group--Mini"
            }
          ]
        },
        {
          "description": "The user or group that is granted access."
        }
      ]
    },
    "invite_email": {
      "type": "string",
      "nullable": true,
      "example": "john@example.com",
      "description": "The email address used to invite an unregistered collaborator, if\nthey are not a registered user."
    },
    "role": {
      "type": "string",
      "example": "editor",
      "enum": [
        "editor",
        "viewer",
        "previewer",
        "uploader",
        "previewer uploader",
        "viewer uploader",
        "co-owner",
        "owner"
      ],
      "description": "The level of access granted."
    },
    "expires_at": {
      "type": "string",
      "nullable": true,
      "format": "date-time",
      "example": "2012-12-26T10:53:43-08:00",
      "description": "When the collaboration will expire, or `null` if no expiration\ndate is set."
    },
    "is_access_only": {
      "type": "boolean",
      "example": true,
      "description": "If set to `true`, collaborators have access to\nshared items, but such items won't be visible in the\nAll Files list. Additionally, collaborators won't\nsee the the path to the root folder for the\nshared item."
    },
    "status": {
      "type": "string",
      "example": "accepted",
      "enum": [
        "accepted",
        "pending",
        "rejected"
      ],
      "description": "The status of the collaboration invitation. If the status\nis `pending`, `login` and `name` return an empty string."
    },
    "acknowledged_at": {
      "type": "string",
      "format": "date-time",
      "example": "2012-12-12T10:55:20-08:00",
      "description": "When the `status` of the collaboration object changed to\n`accepted` or `rejected`."
    },
    "created_by": {
      "allOf": [
        {
          "$ref": "#/components/schemas/User--Collaborations"
        },
        {
          "description": "The user who created the collaboration object."
        },
        {
          "example": [
            {
              "id": 33224412
            },
            {
              "type": "user"
            },
            {
              "login": "dylan@example.com"
            },
            {
              "name": "Dylan Smith"
            }
          ]
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2012-12-12T10:53:43-08:00",
      "description": "When the collaboration object was created."
    },
    "modified_at": {
      "type": "string",
      "format": "date-time",
      "example": "2012-12-12T10:53:43-08:00",
      "description": "When the collaboration object was last modified."
    },
    "acceptance_requirements_status": {
      "type": "object",
      "properties": {
        "terms_of_service_requirement": {
          "type": "object",
          "properties": {
            "is_accepted": {
              "type": "boolean",
              "nullable": true,
              "example": true,
              "description": "Whether or not the terms of service have been accepted.  The\nfield is `null` when there is no terms of service required."
            },
            "terms_of_service": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/TermsOfService--Base"
                },
                {
                  "description": "The terms of service that must be accepted before the\ncollaboration can be accepted. The field is `null` when\nthere is no terms of service required."
                }
              ]
            }
          }
        },
        "strong_password_requirement": {
          "type": "object",
          "properties": {
            "enterprise_has_strong_password_required_for_external_users": {
              "type": "boolean",
              "example": true,
              "description": "Whether or not the enterprise that owns the content requires\na strong password to collaborate on the content."
            },
            "user_has_strong_password": {
              "type": "boolean",
              "nullable": true,
              "example": true,
              "description": "Whether or not the user has a strong password set for their\naccount. The field is `null` when a strong password is not\nrequired."
            }
          }
        },
        "two_factor_authentication_requirement": {
          "type": "object",
          "properties": {
            "enterprise_has_two_factor_auth_enabled": {
              "type": "boolean",
              "example": true,
              "description": "Whether or not the enterprise that owns the content requires\ntwo-factor authentication to be enabled in order to\ncollaborate on the content."
            },
            "user_has_two_factor_authentication_enabled": {
              "type": "boolean",
              "nullable": true,
              "example": true,
              "description": "Whether or not the user has two-factor authentication\nenabled. The field is `null` when two-factor\nauthentication is not required."
            }
          }
        }
      }
    }
  }
}