# Quick Ref: Syncing Outlook Pins via Microsoft Graph MAPI Properties

### Core Concept
Microsoft Graph does not have a native email pinning endpoint. Instead, the official Outlook client tracks pinned states using an underlying MAPI property called `PidTagRenewTime` (historically `PR_RenewTime2`), mapped as **`SystemTime 0x0F02`**.

* **Pinned:** Value is set to a far-future date: **`4500-01-01T00:00:00Z`**.
* **Unpinned:** Value is set back to the email's original `receivedDateTime` (or current timestamp).

---

### API Operations

#### 1. Fetching Pin Status (`GET`)
Expand the target MAPI property using an OData filter when loading messages:
```http
GET https://microsoft.com($filter=id eq 'SystemTime 0x0F02')
```

**Parsing Logic:** Check the returned `singleValueExtendedProperties` array. If an item matches `id: "SystemTime 0x0F02"` and its value starts with `4500`, flag it as **pinned** in the UI layer and anchor it to the top.

#### 2. Pinning an Email (`PATCH`)
```http
PATCH https://microsoft.com{message-id}
Content-Type: application/json

{
  "singleValueExtendedProperties": [
    {
      "id": "SystemTime 0x0F02",
      "value": "4500-01-01T00:00:00Z"
    }
  ]
}
```

#### 3. Unpinning an Email (`PATCH`)
```http
PATCH https://microsoft.com{message-id}
Content-Type: application/json

{
  "singleValueExtendedProperties": [
    {
      "id": "SystemTime 0x0F02",
      "value": "2026-09-22T14:42:00Z" 
    }
  ]
}
```

---

### Agent Warning
Official Graph SDK libraries sometimes choke when serializing the `singleValueExtendedProperties` array on a `PATCH`. If updates fail to save, bypass the high-level SDK models and perform a raw HTTP request.
