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

# Create sync settings for Gmail account.

`POST /api/v1/settings/gmail`

## Request

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

## Headers

- `Authorization` string

## Request body

- SyncSettingsGmail: Sync settings Gmail resource (only applicable for Gmail 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
  - `authCode` string: Google authentication code
  - `refreshToken` string: Google refresh token
  - `email` string: User's email address

## Response `201`

Created

- SyncSettingsGmail: Sync settings Gmail resource (only applicable for Gmail 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
  - `authCode` string: Google authentication code
  - `refreshToken` string: Google refresh token
  - `email` string: User's email address

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