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

# Intramail sync status

> Whether the user (see `X-Session-Token`) turned intramail sync on (in their Max settings; it is off by default), and their mailboxes: one per live personal ModMed login in this organization, with when each was last synced. Pass a mailbox's `id` as `mailboxId` on the other routes to act on it; without one they use the mailbox marked `isDefault`. Sync runs every 5 minutes and reads the newest 100 messages of each folder.



## OpenAPI

````yaml /openapi-v4.json get /intramail/status
openapi: 3.0.0
info:
  title: Max AI Public API
  description: API for third-party marketplace apps
  version: '4.0'
  contact: {}
servers:
  - url: https://api.maxcare.ai/v4
security: []
tags: []
paths:
  /intramail/status:
    get:
      tags:
        - Intramail
      summary: Intramail sync status
      description: >-
        Whether the user (see `X-Session-Token`) turned intramail sync on (in
        their Max settings; it is off by default), and their mailboxes: one per
        live personal ModMed login in this organization, with when each was last
        synced. Pass a mailbox's `id` as `mailboxId` on the other routes to act
        on it; without one they use the mailbox marked `isDefault`. Sync runs
        every 5 minutes and reads the newest 100 messages of each folder.
      operationId: IntramailPublicController_status
      parameters:
        - name: x-session-token
          required: false
          in: header
          description: >-
            The App Bridge token of the logged-in user (`maxcare.appToken()`),
            verified for this app and organization. With it the request reaches
            that user's own mail; without it, the mail of the API key's creator.
            A token that does not verify is `401 authorizer_unverified`. Sent as
            a header so GET requests keep it out of URLs.
          schema:
            type: string
        - name: X-Organization-Id
          in: header
          required: true
          schema:
            type: string
          description: Target clinic organization ID
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntramailStatusSuccessResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiUnauthorizedResponse'
        '403':
          description: Insufficient scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiForbiddenResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiRateLimitResponse'
      security:
        - api-key: []
components:
  schemas:
    IntramailStatusSuccessResponse:
      type: object
      properties:
        code:
          type: string
          description: Response code
          example: success
        data:
          $ref: '#/components/schemas/ExternalIntramailStatus'
      required:
        - code
        - data
    PublicApiUnauthorizedResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: unauthorized
        message:
          type: string
          description: Human-readable error message
          example: Invalid or missing API key
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiForbiddenResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: forbidden
        message:
          type: string
          description: Human-readable error message
          example: Insufficient scope
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    PublicApiRateLimitResponse:
      type: object
      properties:
        code:
          type: string
          description: Error code
          example: rate_limit_exceeded
        message:
          type: string
          description: Human-readable error message
          example: Rate limit exceeded. Maximum 1000 requests per 60 seconds.
        trace_id:
          type: string
          description: Trace ID for debugging
          example: 550e8400-e29b-41d4-a716-446655440000
      required:
        - code
        - message
        - trace_id
    ExternalIntramailStatus:
      type: object
      properties:
        actingFor:
          $ref: '#/components/schemas/ExternalIntramailActingFor'
        syncEnabled:
          type: boolean
          description: >-
            Whether that user turned intramail sync on in their Max settings.
            While it is off, every other intramail route answers
            `intramail_unavailable`.
        mailboxes:
          description: >-
            That user's live personal ModMed logins in this organization,
            default first
          type: array
          items:
            $ref: '#/components/schemas/ExternalIntramailMailbox'
      required:
        - actingFor
        - syncEnabled
        - mailboxes
    ExternalIntramailActingFor:
      type: object
      properties:
        via:
          type: string
          enum:
            - session_token
            - key_creator
          description: >-
            Whose mail: the user the `X-Session-Token` proves, or (without one)
            the API key's creator
        name:
          type: string
          nullable: true
          description: That user's name in Max
      required:
        - via
        - name
    ExternalIntramailMailbox:
      type: object
      properties:
        id:
          type: string
          description: Mailbox ID (`imb_…`), passed as `mailboxId`
          example: imb_5f1c0000000040000000000000000003
        label:
          type: string
          description: The login's name in Max
          example: ModMed (WNasir)
        username:
          type: string
          nullable: true
          description: EHR login name
        ehrHost:
          type: string
          description: EHR tenant host
          example: dccderm.ema.md
        instanceId:
          type: string
          description: EHR instance of this login
        isDefault:
          type: boolean
          description: >-
            The mailbox a request uses when it names none: the primary login,
            otherwise the oldest
        lastSyncedAt:
          type: string
          nullable: true
          description: ISO 8601. Last complete sync
        lastAttemptAt:
          type: string
          nullable: true
          description: ISO 8601. Last attempt, successful or not
        lastError:
          type: string
          nullable: true
      required:
        - id
        - label
        - username
        - ehrHost
        - instanceId
        - isDefault
        - lastSyncedAt
        - lastAttemptAt
        - lastError
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Marketplace API key

````

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