---
title: "Sync User"
method: POST
path: "/api/v1/auth/sync"
tags: ["auth"]
---

# Sync User

`POST /api/v1/auth/sync`

Sync the authenticated Supabase user to the local database.

Extracts ``sub`` and ``email`` from the JWT, then calls
``AuthService.get_or_create_user``.  Optional profile fields
(first_name, last_name, company) can be supplied in the request body.

## Request body

- SyncUserRequest — Optional profile fields sent during POST /auth/sync. These supplement the ``sub`` (supabase_user_id) and ``email`` that are always extracted from the JWT itself.
  - `first_name` string, nullable
  - `last_name` string, nullable
  - `company` string, nullable

## Response `200`

Successful Response

- UserResponse — Public representation of a customer user.
  - `id` string, uuid, required
  - `email` string, required
  - `first_name` string, required
  - `last_name` string, required
  - `phone` string, nullable
  - `company` string, nullable
  - `status` string, required
  - `created_at` string, date-time, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/prototyping/apis/prototyping-io-api.md) · [All operations](https://skmtc.dev/prototyping/apis/prototyping-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/prototyping/prototyping-io-api/revisions/f4a0079fbb57/schema)
