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

# Poll a Gmail inbox connection

> Reports pending, active (with the Gmail address), expired, or removed. connectionId is the mailbox id.



## OpenAPI

````yaml /api-reference/mobilerun-mailbox.yaml get /mailboxes/connections/{connectionId}
openapi: 3.1.0
info:
  title: Mobilerun Mailbox
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /mailboxes/connections/{connectionId}:
    get:
      tags:
        - Mailboxes
      summary: Poll a Gmail inbox connection
      description: >-
        Reports pending, active (with the Gmail address), expired, or removed.
        connectionId is the mailbox id.
      operationId: getMailboxConnection
      parameters:
        - in: path
          name: connectionId
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxConnection'
          description: Gmail connection status
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
          description: Not Found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxErrorBody'
          description: Mailboxes disabled or temporarily unavailable
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const connection = await client.mailboxes.connections.retrieve(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            console.log(connection.address);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            connection = client.mailboxes.connections.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(connection.address)
components:
  schemas:
    MailboxConnection:
      properties:
        address:
          type:
            - string
            - 'null'
        connectionId:
          format: uuid
          type: string
        mailboxId:
          format: uuid
          type: string
        redirectUrl:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/MailboxConnectionStatus'
      required:
        - connectionId
        - mailboxId
        - redirectUrl
        - status
        - address
      type: object
    ApiErrorEnvelope:
      properties:
        code:
          type: string
        details: {}
        message:
          type: string
        retryAfterSeconds:
          type: number
        traceId:
          type: string
      required:
        - code
        - message
      type: object
    MailboxErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/MailboxErrorReason'
        message:
          type: string
      required:
        - code
        - message
      type: object
    MailboxConnectionStatus:
      enum:
        - pending
        - active
        - expired
        - removed
      type: string
    MailboxErrorReason:
      description: >-
        Stable, machine-readable error reason. Values are frozen and never
        renamed; new values may be added, so treat unknown values as a generic
        failure of the same HTTP status.
      enum:
        - mailboxes_disabled
        - otp_extraction_disabled
        - idempotency_conflict
        - invalid_idempotency_key
        - idempotency_key_required
        - idempotency_key_reused
        - invalid_local_part
        - local_part_reserved
        - local_part_taken
        - mailbox_vanity_disabled
        - allocated_mailbox_limit_reached
        - awaiting_payment_limit_reached
        - vanity_awaiting_payment_limit_reached
        - daily_allocation_limit_reached
        - billing_not_configured
        - included_capacity_unavailable
        - mailbox_not_active
        - uncancel_not_allowed
        - backend_rate_limited
        - backend_rejected
        - backend_unavailable
        - assistant_checkout_return_unavailable
        - custom_domains_disabled
        - domain_not_disableable
        - invalid_domain
        - domain_reserved
        - domain_unavailable
        - domain_not_active
        - domain_limit_reached
        - domain_verification_expired
        - domain_claim_superseded
        - dns_check_rate_limited
        - gmail_already_connected
        - connection_pending
        - connection_expired
        - connection_removed
        - message_too_large
        - external_cancel_not_allowed
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

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