---
title: "Set IMAP connection"
method: POST
path: "/api/v1/imap/connection"
---

# Set IMAP connection

`POST /api/v1/imap/connection`

## Request

- Base URL: `https://localhost:3000`
- URL: `https://localhost:3000/api/v1/imap/connection`
- Auth: OAuth 2 (authorization code, authorization URL `/oauth/authorize`, token URL `/oauth/token`)

Save IMAP connection settings for the authenticated user and validate connectivity.

## Request body

- ImapSetConnectionRequest
  - `preset` string: Optional preset: icloud, gmail, outlook, yahoo, custom
  - `host` string: Required for custom preset
  - `port` integer
  - `username` string, required
  - `password` string, required
  - `use_ssl` boolean

## Response `200`

Connection saved

- ImapConnectionResponse
  - `configured` boolean
  - `connector_id` string
  - `session_user` string
  - `credential_identity` string, nullable
  - `host` string, nullable
  - `port` integer, nullable
  - `username` string, nullable
  - `use_ssl` boolean, nullable
  - `password_set` boolean
  - `source` string, nullable

## Other responses

- `400`: Invalid payload or missing required fields
- `401`: Authentication required
- `500`: Internal server error

---

[API](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api.md) · [All operations](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api/revisions/e25648ba6027?raw)
