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

# Get the tenant admin-consent URL

> Admin only. The Microsoft URL an organisation's admin opens to approve the Mail app for the tenant.



## OpenAPI

````yaml /api-reference/endpoint/m365/openapi.json get /m365/mail/consent-url
openapi: 3.0.3
info:
  title: quiva.ai Microsoft 365 API
  description: >-
    Outlook mail connection, mail filing into space folders, and mail
    automations. All routes act on the caller's own mailbox unless marked admin.
    The `/m365/rules` routes were withdrawn. Files and SharePoint sync routes
    are not part of this spec.
  version: 1.0.0
  contact:
    name: quiva.ai Support
    url: https://app.quiva.ai
servers:
  - url: https://api.quiva.ai
    description: Production API server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Mail
    description: The caller's Outlook mailbox connection
  - name: Mail filing
    description: Filing mail from a mailbox into space folders
  - name: Mail automations
    description: Actions that run on each filed message
  - name: Files connection
    description: Connecting a Microsoft 365 tenant for SharePoint files
  - name: SharePoint browse
    description: Browsing sites, libraries and folders with a setup session
  - name: SharePoint sync sources
    description: Syncing a SharePoint library folder into a space
paths:
  /m365/mail/consent-url:
    get:
      tags:
        - Mail
      summary: Get the tenant admin-consent URL
      description: >-
        Admin only. The Microsoft URL an organisation's admin opens to approve
        the Mail app for the tenant.
      operationId: getMailConsentUrl
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  consent_url:
                    type: string
                  state:
                    type: string
                  expires_in:
                    type: integer
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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