---
title: "Register User"
method: POST
path: "/register-web"
tags: ["users"]
---

# Register User

`POST /register-web`

Register the authenticated user's Google OAuth refresh token.

Only browser-session (JWT) callers are accepted. A valid hCaptcha token
is required in non-local environments to prevent automated registration.

The user identity (email, full name) is sourced from the immutable
Supabase auth identity inside :func:`register_user_core`. The request
body intentionally only carries the OAuth refresh token plus optional
profile links — any email/full_name fields a client sends are ignored
by the Pydantic schema (ENG-1214).

Args:
    http_request: The incoming FastAPI request.
    request: Registration request with the OAuth refresh token.
    auth: Authenticated user context (JWT-validated).

Returns:
    UserRegistrationResponse with success status and connection info.

## Request body

- UserRegistrationRequest — Request for user registration with Google OAuth. The user's email and full name are intentionally NOT accepted from the client — the brain always sources them from the immutable Supabase auth identity (JWT email + ``auth.users.user_metadata``). Accepting them from the request body was a phishing primitive (ENG-1214) that allowed any authenticated user to overwrite ``public.users.email`` for their own row with an arbitrary string, e.g. another user's address.
  - `refresh_token` string, required
  - `twitter_url` string, nullable
  - `linkedin_url` string, nullable
  - `captcha_token` string, nullable

## Response `200`

Successful Response

- UserRegistrationResponse — Response for user registration.
  - `success` boolean, required
  - `message` string, required
  - `connection_id` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/pioneer/apis/brain-api.md) · [All operations](https://skmtc.net/pioneer/apis/brain-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pioneer/brain-api/revisions/31dfe831e079/schema)
