---
title: "Start Gmail Import"
method: POST
path: "/gmail/import/start"
tags: ["gmail"]
---

# Start Gmail Import

`POST /gmail/import/start`

Start Gmail import flow - returns OAuth URL for frontend to redirect.

This endpoint is called by the frontend to initiate Gmail account linking.
It calls the travel_email service to generate an OAuth URL, which the
frontend uses to redirect the user to Google for authorization.

Returns:
    GmailImportStartResponse with auth_url on success, error_message on failure

## Request body

- StartGmailImportBody — Request body for starting Gmail import (user_id comes from auth).
  - `success_path` string, required — Path to redirect to on OAuth success, e.g. /dash?from=gmail&state=success
  - `failure_path` string, required — Path to redirect to on OAuth failure, e.g. /dash?from=gmail&state=failure

## Response `200`

Successful Response

- GmailImportStartResponse — Response schema for Gmail import start endpoint. Returns the auth URL for the gateway to redirect the user to Google OAuth, or a failure redirect URL if something went wrong.
  - `success` boolean, required
  - `auth_url` string, nullable
  - `credential_id` string, nullable
  - `failure_redirect_url` string, nullable
  - `error_message` string, nullable

## Other responses

- `422` — Validation Error

## Changes

> 17 revisions in range; 1 not diffed.

- **2026-09-11** `106d2d712b27` — 1 info
  - endpoint added
- **2026-09-02** `7ffb16b1c40d` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/helloaxel/apis/client-api-gateway/changes/gmail/import/start/post.md)

---

[API](https://skmtc.dev/helloaxel/apis/client-api-gateway.md) · [All operations](https://skmtc.dev/helloaxel/apis/client-api-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/helloaxel/apis/client-api-gateway/revisions/b7b1f6448378?raw)
