> ## 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.

# Unlink a Gmail inbox

> Removes only this mailbox link. The Gmail connection used by your agents stays in place.



## OpenAPI

````yaml /api-reference/mobilerun-mailbox.yaml post /mailboxes/{mailboxId}/disconnect
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/{mailboxId}/disconnect:
    post:
      tags:
        - Mailboxes
      summary: Unlink a Gmail inbox
      description: >-
        Removes only this mailbox link. The Gmail connection used by your agents
        stays in place.
      operationId: disconnectMailbox
      parameters:
        - in: path
          name: mailboxId
          required: true
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Mailbox'
                required:
                  - data
                type: object
          description: Gmail mailbox unlinked
        '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
      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 response = await
            client.mailboxes.disconnect('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(response.data);
        - 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
            )
            response = client.mailboxes.disconnect(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.data)
components:
  schemas:
    Mailbox:
      properties:
        address:
          example: mx_7k3q9p2m4v8d@inbox.example
          type:
            - string
            - 'null'
        billingMode:
          $ref: '#/components/schemas/MailboxBillingMode'
        cancelAtPeriodEnd:
          type: boolean
        checkoutExpiresAt:
          format: date-time
          type:
            - string
            - 'null'
        checkoutUrl:
          type:
            - string
            - 'null'
        createdAt:
          format: date-time
          type: string
        currentPeriodEnd:
          format: date-time
          type:
            - string
            - 'null'
        domainId:
          format: uuid
          type:
            - string
            - 'null'
        id:
          format: uuid
          type: string
        inboundMessages:
          $ref: '#/components/schemas/MailboxInboundMessagesUsage'
        label:
          maxLength: 100
          type:
            - string
            - 'null'
        provider:
          $ref: '#/components/schemas/MailboxProvider'
        status:
          $ref: '#/components/schemas/MailboxStatus'
      required:
        - id
        - provider
        - domainId
        - address
        - label
        - status
        - billingMode
        - cancelAtPeriodEnd
        - checkoutUrl
        - checkoutExpiresAt
        - currentPeriodEnd
        - createdAt
        - inboundMessages
      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
    MailboxBillingMode:
      enum:
        - rent
        - included
        - domain
        - external
      type: string
    MailboxInboundMessagesUsage:
      properties:
        exhausted:
          type: boolean
        included:
          minimum: 0
          type: integer
        resetsAt:
          format: date-time
          type:
            - string
            - 'null'
        used:
          minimum: 0
          type: integer
      required:
        - used
        - included
        - exhausted
        - resetsAt
      type: object
    MailboxProvider:
      enum:
        - matix
        - gmail
      type: string
    MailboxStatus:
      enum:
        - provisioning
        - awaiting_payment
        - active
        - cancel_scheduled
        - archived
        - billing_error
        - pending_connection
        - connection_expired
        - connection_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.