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

---

[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-service-production.skmtc.workers.dev/v1/apis/helloaxel/client-api-gateway/revisions/d3c4c29fede7/schema)
