> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/a/apple-business-manager.md).

# Apple Business Manager

Apple Business Manager is the portal for buying and assigning Apple devices. OctoXLabs reads the organization device inventory through the Business API.

## Use cases

* Find devices that Apple Business Manager reports but your EDR does not cover.

```
Adapters = apple-business-manager AND NOT Adapters = falcon-crowdstrike
```

* Review devices that Apple Business Manager has not seen recently.

```
Adapters = apple-business-manager AND NOT LastSeen last now-30d/d
```

* Check what one Apple Business Manager connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination                                           | Port | Protocol |
| ------------------- | ----------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | api-business.apple.com (default, configurable Domain) | 443  | HTTPS    |
| OctoXLabs connector | account.apple.com (token service)                     | 443  | HTTPS    |

### Required permissions

The key pair must be uploaded to Apple Business Manager as an API key. Roles are not documented. Not verified.

## Create credentials in Apple Business Manager

{% stepper %}
{% step %}

### Generate a key pair

Generate an ES256 (P-256 elliptic curve) key pair.
{% endstep %}

{% step %}

### Upload the public key

In Apple Business Manager, go to **Settings** > **API Keys** and upload the public key.
{% endstep %}

{% step %}

### Copy the identifiers

Copy the Client ID (prefixed `BUSINESSAPI.` plus a UUID), the Team ID (also prefixed `BUSINESSAPI.`) and the Key ID (a UUID).
{% endstep %}

{% step %}

### Keep the private key

Keep the matching private key in PEM format. You paste it into the connection form.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter   | Required | Type    | Default                | Description                                                           |
| ----------- | -------- | ------- | ---------------------- | --------------------------------------------------------------------- |
| Domain      | Yes      | String  | api-business.apple.com | API domain of Apple Business Manager.                                 |
| Client ID   | Yes      | String  | None                   | Client ID received when the public key was uploaded.                  |
| Team ID     | Yes      | String  | None                   | Organization identifier in Apple Business Manager.                    |
| Key ID      | Yes      | String  | None                   | UUID of the uploaded public key.                                      |
| Private Key | Yes      | String  | None                   | ES256 private key in PEM format.                                      |
| Proxy       | No       | String  | None                   | Proxy address. The connector sends requests through `http://<value>`. |
| Timeout     | No       | Integer | 30                     | Time in seconds to wait for API responses.                            |

## Troubleshooting

| Error message                                                          | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Request to failed after 5 retries (last status: `)`                    | The API kept answering 401 or 429.                                     | Check the Client ID, Team ID, Key ID and private key.                                                                                         |
| Status Code: `, followed by the URL, the method and the response body` | The API answered with a status other than the one the adapter expects. | Read the code and body. 401 or 403 usually points to wrong credentials or missing permissions. Check the address, port and Is Secure setting. |

## Change history

{% hint style="info" %}
Available starting from version 6.3.2.
{% endhint %}
