---
title: "Claim Guest"
method: POST
path: "/auth/claim-guest"
---

# Claim Guest

`POST /auth/claim-guest`

Restore a guest cookie on the current device so a subsequent
authenticated request triggers the existing Case 4 merge.

Used by the cross-device magic-link flow: when Device A requests a
magic link, its guest_id is embedded in the redirect URL. Device B
hits this endpoint before completing Stytch auth, so the first
authenticated backend call carries both the new Stytch session and
the originating guest cookie — and `get_current_user_or_guest`
transfers the trips into the new authed user.

Only unconverted guests (`stytch_user_id IS NULL`) are claimable.
A converted row is already linked to a real Stytch account; letting
anyone claim it would let an attacker hijack that user's identity
on the device making the claim.

## Request body

- ClaimGuestRequest
  - `guest_id` string, required

## Response `204`

Successful Response

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/stardrift/apis/fastapi.md) · [All operations](https://skmtc.dev/stardrift/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/stardrift/fastapi/revisions/00746572572a/schema)
