> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ravenna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Setup

> Connect Apple School Manager or Apple Business to Ravenna with an API account's Client ID, Key ID and private key.

> [!NOTE]
>
> Connect to Apple School Manager or Apple Business using an API account and its private key

This guide walks you through creating an API account in Apple School Manager or Apple Business and connecting it to Ravenna.

## Prerequisites

Before you begin, ensure you have:

* An Apple School Manager or Apple Business account
* The **Administrator** role in Apple School Manager, or the **Organization Administrator** role in Apple Business, to create the API account
* Organization Admin access in Ravenna

> [!NOTE]
>
> Apple School & Business Manager is organization-scoped. Each Ravenna organization can connect one Apple account.

## Setup guide

### Create an API account

**1. Open the API settings**

In Apple School Manager or Apple Business, open your account name, then **Preferences**, then **API**.

**2. Create an API account**

Create an API account for Ravenna and download its private key (`.pem`). Apple offers the download only once, so keep the file.

**3. Copy the IDs**

Copy the **Client ID** and **Key ID** shown on the API account.

> [card] [Apple School and Business Manager API documentation](https://developer.apple.com/documentation/apple-school-and-business-manager-api/implementing-oauth-for-the-apple-school-manager-and-apple-business-api)
>
> Learn more about API accounts and keys in Apple School Manager and Apple Business.

### Add integration

**1. Navigate to integrations**

1. Go to **Settings > Integrations**
2. Find **Apple School & Business Manager** in the Device Management section

**2. Select Apple School & Business Manager**

Click **Connect** on the Apple School & Business Manager integration card

**3. Enter the API account**

Provide the following information:

**Product** `string` *required*

The Apple product your API account was created in: **Apple Business** or **Apple School Manager**.

**Client ID** `string` *required*

The Client ID shown on the API account, for example `BUSINESSAPI.xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`.

**Key ID** `string` *required*

The Key ID shown on the same API account.

**Private key (.pem)** `string` *required*

The whole `.pem` file Apple generated for the API account, from `-----BEGIN PRIVATE KEY-----` to `-----END PRIVATE KEY-----`.

**4. Complete setup**

Click **Connect**. Ravenna requests an access token from Apple with the API account, then reads your MDM servers to test the connection.

[Asset sync](https://docs.ravenna.ai/integrations/apple-business-manager/asset-sync.md) is on by default, so the first sync starts as soon as the connection is created, unless the integration is paused. After that it runs every 12 hours. Change the cadence with **Sync Interval** on the integration's settings.

## Troubleshooting

> [accordion] This API account can't use the Apple Business API
>
> **Cause**: **Product** doesn't match the product the API account was created in.
>
> **Solution**: Choose the other **Product** and connect again. A Client ID starting with `BUSINESSAPI.` belongs to Apple Business. When the Client ID looks like the other product's, the error says so.

> [accordion] Rejected the credentials
>
> **Cause**: The Client ID, Key ID and private key don't match an active API account, or the key was revoked.
>
> **Solution**:
>
> * Check that all three come from the same API account, with no extra spaces
> * Paste the whole `.pem` file, including the `BEGIN` and `END` lines
> * If the key was revoked, create a new one in Apple School Manager or Apple Business and connect again

> [accordion] The API account can't read MDM servers
>
> **Cause**: The API account doesn't have access to the API.
>
> **Solution**: Check the API account's access in Apple School Manager or Apple Business under **Preferences > API**.

> [accordion] Couldn't reach Apple
>
> **Cause**: Apple didn't answer.
>
> **Solution**: Try again in a few minutes.

> [accordion] A sync fails after it worked before
>
> **Cause**: Apple no longer accepts the connection's API account, usually because its key was revoked, or the API account lost access.
>
> **Solution**: Create a new key in Apple School Manager or Apple Business and reconnect with it. If the API account lost access, check it under **Preferences > API**.


## Related topics

- [Setup](https://docs.ravenna.ai/integrations/okta/setup/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.