# I/O Microsoft Graph [](https://docs.rs/io-msgraph/latest/io_msgraph) [](https://matrix.to/#/#pimalaya:matrix.org) [](https://fosstodon.org/@pimalaya) [](https://pimalaya.org/sponsor/)
Microsoft Graph API client library for Rust
This library is composed of 3 feature-gated layers:
- Low-level **I/O-free** coroutines: no_std-compatible state machines containing the whole Microsoft Graph REST logic, usable anywhere
- Mid-level **light client**: a standard, blocking client wrapping a stream you opened yourself
- High-level **full client**: the light client plus TCP connections and TLS negotiations handled for you
## Table of contents
- [Features](#features)
- [API coverage](#api-coverage)
- [Usage](#usage)
- [Examples](#examples)
- [AI policy](https://github.com/pimalaya/.github/blob/master/AI_POLICY.md)
- [License](#license)
- [Social](#social)
- [Contributing](./CONTRIBUTING.md)
- [Sponsoring](#sponsoring)
## Features
- **Mail**: folders, messages and attachments, raw MIME downloads, drafts and sending.
- **Contacts, calendars and To Do**: contact folders, calendars and events, task lists and their tasks.
- **Incremental sync**: delta queries return only what changed since the last round.
- **Batching**: up to 20 requests in one HTTP call.
- **iCalendar and vCard** (`ical`, `vcard` features): events and tasks as iCalendar, contacts as vCard, and back.
- **Full client**: TLS via Rustls (`rustls-ring` default, `rustls-aws`) or Native TLS (`native-tls`).
> [!TIP]
> I/O Microsoft Graph is written in [Rust](https://www.rust-lang.org/) and uses [cargo features](https://doc.rust-lang.org/cargo/reference/features.html) to gate the client layers. The default feature set is declared in [Cargo.toml](./Cargo.toml) or on [docs.rs](https://docs.rs/crate/io-msgraph/latest/features).
## API coverage
Microsoft Graph is a single API spanning many domains; io-msgraph covers it incrementally, mirroring the [Microsoft Graph v1.0 reference](https://learn.microsoft.com/en-us/graph/api/overview). Every operation below is an I/O-free coroutine.
| Resource | Operations |
|----------------------------|----------------------------------------------------------------------------------------|
| $batch | send up to 20 requests in one HTTP call |
| users | get the signed-in user profile; sendMail action (JSON and MIME form) |
| users.mailFolders | list, get, create, update, delete, move, copy, list child folders |
| users.messages | list, get, get raw MIME, create draft from JSON or MIME, update, delete, move, copy, send, track changes with delta |
| users.messages.attachments | list, create, get raw content, delete |
| users.contactFolders | list, get, create, update, delete, list child folders |
| users.contacts | list, get, create, update, delete, track changes with delta |
| users.calendars | list, get, create, update, delete |
| users.events | list, get, create, update, delete, list instances, calendar view, track changes with delta |
| users.todo.lists | list, get, create, update, delete, track changes with delta |
| users.todo.lists.tasks | list, get, create, update, delete, track changes with delta, list checklist items |
## Usage
See documentation at [docs.rs](https://docs.rs/io-msgraph/latest/io_msgraph).
## Examples
See complete examples at [./tests](./tests).
Have also a look at real-world projects built on top of this library:
- [Himalaya CLI](https://github.com/pimalaya/himalaya): CLI to manage emails
- [Cardamum CLI](https://github.com/pimalaya/cardamum): CLI to manage contacts
## License
This project is licensed under either of:
- [MIT license](LICENSE-MIT)
- [Apache License, Version 2.0](LICENSE-APACHE)
## Social
- Chat on [Matrix](https://matrix.to/#/#pimalaya:matrix.org)
- News on [Mastodon](https://fosstodon.org/@pimalaya) or [RSS](https://fosstodon.org/@pimalaya.rss)
- Mail at [pimalaya.org@posteo.net](mailto:pimalaya.org@posteo.net)
## Sponsoring
[](https://nlnet.nl/)
Special thanks to the [NLnet foundation](https://nlnet.nl/) and the [European Commission](https://www.ngi.eu/) that have been financially supporting the project for years:
- 2022 → 2023: [NGI Assure](https://nlnet.nl/project/Himalaya/)
- 2023 → 2024: [NGI Zero Entrust](https://nlnet.nl/project/Pimalaya/)
- 2024 → 2026: [NGI Zero Core](https://nlnet.nl/project/Pimalaya-PIM/)
- 2026 → 2027: [NGI Zero Commons Fund](https://nlnet.nl/project/Pimalaya-pimdir/)
This program is part of Pimalaya, free software funded entirely by grants and donations. If you find it useful, consider [sponsoring](https://pimalaya.org/sponsor/) its development:
[](https://github.com/sponsors/soywod)
[](https://ko-fi.com/pimalaya)
[](https://www.buymeacoffee.com/pimalaya)
[](https://liberapay.com/pimalaya)
[](https://thanks.dev/u/gh/soywod)
[](https://www.paypal.com/paypalme/soywod)