MailboxesStart connecting a Microsoft mailbox

Start connecting a Microsoft mailbox

Returns the consent URL to open in a browser. After the user grants access, the mailbox is created with inbox sync enabled and the browser is redirected back to the dashboard. You bring your own OAuth app: register https://api.supasend.io/v1/mailboxes/oauth/microsoft/callback as a redirect URI on it and pass its client ID and secret here.

curl -X POST "https://api.supasend.io/v1/mailboxes/oauth/microsoft/start" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
  "email": "user@example.com",
  "display_name": "John Doe",
  "client_id": "example_string",
  "client_secret": "example_string",
  "tenant_id": "example_string"
}'
{
  "auth_url": "example_string"
}
POST
/v1/mailboxes/oauth/microsoft/start
POST
Base URLstring

Target server for requests. Edit to use your own host.

API Key (header: X-API-Key)
X-API-Keystring
Required

API key in the format sk_live_<64 hex characters>

API key in the format sk_live_<64 hex characters>
Content-Typestring
Required

The media type of the request body

Options: application/json
emailstring
Required

Address of the mailbox being connected

Format: email
display_namestring

Name shown to recipients in the From header

client_idstring
Required

Your OAuth app's client ID

client_secretstring
Required

Your OAuth app's client secret (stored encrypted)

tenant_idstring

Microsoft only. Defaults to common.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
X-API-Keystring
Required

API Key for authentication. API key in the format sk_live_\<64 hex characters\>

Body

application/json
emailstring
Required

Address of the mailbox being connected

display_namestring

Name shown to recipients in the From header

client_idstring
Required

Your OAuth app's client ID

client_secretstring
Required

Your OAuth app's client secret (stored encrypted)

tenant_idstring

Microsoft only. Defaults to common.

Responses

auth_urlstring