---
title: "Create sync settings for Imap account."
method: POST
path: "/api/v1/settings/imap"
tags: ["Settings"]
---

# Create sync settings for Imap account.

`POST /api/v1/settings/imap`

## Request

- Base URL: `https://api.intheloop.io`
- URL: `https://api.intheloop.io/api/v1/settings/imap`
- Auth: API key in header `Authorization`

## Headers

- `Authorization` string

## Request body

- SyncSettingsImapSmtp: Sync settings IMAP/SMTP resource (only applicable for IMAP/SMTP users)
  - `id` string: Resource id
  - `name` string: Resource name or title
  - `revision` string: Resource revision
  - `clientId` string: Resource client id
  - `$type` string, required
  - `isEnabled` boolean: Sync is enabled
  - `isPaused` boolean: Sync is paused (only contact sync is performed, no emails are imported)
  - `importDayRange` integer: Email import day range for the past
  - `threadingMode` 'Recipient' | 'Standard': Threading mode for syncing
  - `email` string: User's email
  - `imapHost` string: User's imap server address
  - `imapPort` integer, required: User's imap server port
  - `imapUsername` string: User's imap username
  - `imapPassword` string: User's imap password (never gets sent out by the server, only set by client)
  - `smtpHost` string: User's smtp server address
  - `smtpPort` integer, required: User's smtp server port
  - `smtpUsername` string: User's smtp username
  - `smtpPassword` string: User's smtp secret (never gets sent out by the server, only set by client)
  - `sslRequired` boolean, required: Is SSL required

## Response `201`

Created

- SyncSettingsImapSmtp: Sync settings IMAP/SMTP resource (only applicable for IMAP/SMTP users)
  - `id` string: Resource id
  - `name` string: Resource name or title
  - `revision` string: Resource revision
  - `clientId` string: Resource client id
  - `$type` string, required
  - `isEnabled` boolean: Sync is enabled
  - `isPaused` boolean: Sync is paused (only contact sync is performed, no emails are imported)
  - `importDayRange` integer: Email import day range for the past
  - `threadingMode` 'Recipient' | 'Standard': Threading mode for syncing
  - `email` string: User's email
  - `imapHost` string: User's imap server address
  - `imapPort` integer, required: User's imap server port
  - `imapUsername` string: User's imap username
  - `imapPassword` string: User's imap password (never gets sent out by the server, only set by client)
  - `smtpHost` string: User's smtp server address
  - `smtpPort` integer, required: User's smtp server port
  - `smtpUsername` string: User's smtp username
  - `smtpPassword` string: User's smtp secret (never gets sent out by the server, only set by client)
  - `sslRequired` boolean, required: Is SSL required

## Other responses

- `400`: Bad request. Check fields message and error code from response body for additional information.
- `401`: Unauthorized request. Check fields message and error code from response body for additional information.
- `409`: Request failed due to conflict resource state.Check fields message and error code from response body for additional information.
- `429`: Too many requests. Check response header Retry-After indicating how long to wait before making a new request.
- `451`: Unavailable because account is not verified.

---

[API](https://skmtc.dev/intheloop/apis/loop-api.md) - [All operations](https://skmtc.dev/intheloop/apis/loop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/intheloop/apis/loop-api/revisions/0892c5ba0787?raw)
