---
search:
  tags:
    - Mailboxes
    - POST
seo:
  description: >-
    Creates a single-use, short-lived URL that walks a customer through
    authorizing… Reference for the POST /mailboxes/connect endpoint in the AI
    Inbx API API.
sidebar:
  label: Create a mailbox connection URL
  badge: POST
title: Create a mailbox connection URL
type: openapi-operation
---
Creates a single-use, short-lived URL that walks a customer through authorizing their Gmail or Outlook mailbox. Redirect them to it rather than emailing it. Pass `ref` to carry your own identifier through to the `mailbox.connected` webhook, which — not the browser returning to `return_to` — is the authoritative signal that the mailbox is live. `return_to` may be any URL here, since the request is authenticated; a connect link opened from a browser is held to the app's `return_urls` instead. `space_id` files the mailbox in a space; the returned URL carries it, so a platform mints one link per customer server-side rather than handing out the bare hosted link.

<Operation source="api-endpoints" id="connect-mailbox" />
