Assigns directories to applications, creating an application directory association. To unassign directories in bulk, set the method query parameter to DELETE and send the unassign request body with the association uuid_url values in deleted_objects. Unassigning removes the association and the application's group associations for that directory's groups. It doesn't delete the application, the directory, or the groups. Unassign requests are all-or-nothing: if any unassignment fails, the request makes no changes.
The assign request creates one association for each application and directory pair, and responds with an array of those associations. Assigning a non-SAML directory that's already assigned returns the existing association, and an enable_mfa value in the request overwrites the existing value. If an assign request fails, no pairs are assigned, except when a directory uuid_url doesn't match a directory. In that case the response is a 400 error, but other pairs in the request can stay assigned. Application uuid_url values that don't match an application are ignored.
The request returns a 400 error if you assign a SAML directory to an application that has a cloud directory or an enterprise directory, such as Active Directory or LDAP. It also returns a 400 error if you assign any directory to an application that already has a SAML directory, if the application uses a device authentication IdP, or if the application has a manual configuration override and is deployed. An unassign request also returns a 400 error if an association doesn't exist or if the directory is used in a group-based path rewrite rule.
