# MailInitDelta

### Summary

* Retrieves the current Microsoft Graph delta token for a mailbox or folder so clients can start change tracking from "now".

### Graph Endpoint

* `GET /me/messages/delta`

### Parameters

#### Optional

* `folder: string` — Mail folder ID or well-known name (e.g., `Inbox`). When omitted, the entire mailbox is used.

### Usage (app.businessFunction)

#### Minimal

```js
app.businessFunction({
  functionName: 'MicrosoftGraph',
  methodName: 'Mail',
  operation: 'InitDelta',
  parameters: {}
})
```

#### With options

```js
app.businessFunction({
  functionName: 'MicrosoftGraph',
  methodName: 'Mail',
  operation: 'InitDelta',
  parameters: {
    folder: 'Inbox'
  }
})
```

### Response

* Returns the delta token plus simple diagnostics about how many pages/items were scanned to obtain it.

```json
{
  "deltaLink": "https://graph.microsoft.com/v1.0/me/messages/delta?$deltatoken=...",
  "pagesFetched": 1,
  "itemsFetched": 12
}
```

### Notes

* The operation uses a high `$top` value and a minimal projection for efficiency. It follows `@odata.nextLink` until Microsoft Graph emits `@odata.deltaLink`, with a safety limit to prevent runaway loops.
* If your tenant does not support change tracking on the mailbox root, provide a folder (for example, `Inbox`).
