---
title: Assign or Unassign Devices to a Device Management Service or Release Devices
framework: Apple Business API
role: symbol
role_heading: Web Service Endpoint
platforms: [apple business api 2.5+]
path: applebusinessapi/create-an-orgdeviceactivity
---

# Assign or Unassign Devices to a Device Management Service or Release Devices

Assign or unassign devices to a device management service, manage a device management service migration for devices, or release devices from an organization.

## URL

POST https://api-business.apple.com/v1/orgDeviceActivities

## Response Codes

201 Created: 400 Bad Request: An error occurred with your request. 401 Unauthorized: 403 Forbidden: Request not authorized. 409 Conflict: The request conflicts with the current state of one or more of the given resources — for example, an invalid device management service ID, an invalid device serial number, or a migration deadline outside the allowed range. 422 : 429 : Too Many Requests

## Example: Assign or Unassign Devices to a Device Management Service

Example: Assign or Unassign Devices to a Device Management Service Example: Assign Devices to a Device Management Service With a Device Management Service Migration Deadline To assign devices to a device management service and schedule a device management service migration, use the ASSIGN_DEVICES_WITH_MDM_MIGRATION_DEADLINE activity type and include activityTypeMetadata.mdmMigrationDeadlineDateTime, an ISO 8601 date and time by which the migration needs to complete. The deadline can’t be more than 90 days in the future. Example: Update a Device Management Service Migration Deadline To update the deadline for an in-progress device management service migration, use the UPDATE_MDM_MIGRATION_DEADLINE activity type. This doesn’t require a mdmServer relationship. If the new deadline is earlier than the existing one, or in the past, the device honors it without giving the user an option to delay the migration. If the request tries to update the deadline for a serial number that isn’t undergoing a device management service migration, the activity log result indicates a failure for that serial number. Example: Cancel an MDM Migration To cancel an in-progress device management service migration, use the CANCEL_MDM_MIGRATION activity type. This doesn’t require a mdmServer relationship or activityTypeMetadata. If the request tries to cancel a device management service migration for a serial number that isn’t undergoing one, the activity log result indicates a failure for that serial number. Example: Release Devices from an Organization To release devices from an organization, use RELEASE_DEVICES activity type. important: Released devices will no longer be registered to the organization and device enrollment assignments are removed. Devices will be unenrolled from the built-in device management service and removed from Blueprints.

## Topics

### Responses

- [OrgDeviceActivityResponse](applebusinessapi/orgdeviceactivityresponse.md)

## See Also

### Device Management Services

- [Get Device Management Services](applebusinessapi/get-mdm-servers.md)
- [Get Device Management Service Information](applebusinessapi/get-mdmserver-information.md)
- [Create a Device Management Service](applebusinessapi/create-an-mdmserver.md)
- [Update a Device Management Service](applebusinessapi/update-an-mdmserver.md)
- [Delete a Device Management Service](applebusinessapi/delete-an-mdmserver.md)
- [Get the Device Serial Numbers for a Device Management Service](applebusinessapi/get-all-device-ids-for-an-mdmserver.md)
- [Get the Assigned Device Management Service ID for a Device](applebusinessapi/get-the-assigned-server-id-for-an-orgdevice.md)
- [Get the Assigned Device Management Service Information for a Device](applebusinessapi/get-the-assigned-server-information-for-an-orgdevice.md)
- [Get Organization Device Activity Information](applebusinessapi/get-orgdeviceactivity-information.md)
