---
title: "Admin-consent link for a Microsoft tenant"
method: GET
path: "/v1/connect/microsoft/admin-consent"
tags: ["Connect"]
---

# Admin-consent link for a Microsoft tenant

`GET /v1/connect/microsoft/admin-consent`

## Request

- Base URL: `https://zernio.com/api`
- URL: `https://zernio.com/api/v1/connect/microsoft/admin-consent`
- Auth: HTTP bearer

Returns the Microsoft Entra admin-consent link for the app, so a tenant administrator can grant mail or calendar access.

Some Microsoft 365 tenants let no user grant mail or calendar access themselves. The API then answers 412 `admin_consent_required` with `details.adminConsentUrl`, a ready admin-consent link.

This endpoint mints a fresh one (each is valid for one hour) and lets you choose `redirectUrl`.

### Flow

1. A tenant administrator opens the link and approves.
2. They are sent to `redirectUrl` with `adminConsent=granted&tenant=…` (or `adminConsent=denied&error=…`).
3. The grant is recorded on the account, and later requests succeed without a reconnect.

## Query parameters

- `accountId` string, required
- `redirectUrl` string, uri

## Response `200`

The link to hand to a tenant administrator

- object
  - `data` object
    - `adminConsentUrl` string, uri

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key. `code` is `missing_credentials` when no Authorization header was sent and `invalid_credentials` when the key is unknown, revoked or expired.
- `404`: Resource not found

## Changes

- **2026-10-27** `0a24331f5431`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zernio/apis/zernio-api/changes/v1/connect/microsoft/admin-consent/get.md)

---

[API](https://skmtc.dev/zernio/apis/zernio-api.md) - [All operations](https://skmtc.dev/zernio/apis/zernio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zernio/apis/zernio-api/revisions/c319eb5d95b6?raw)
