---
title: "Affiliate link entry (GEN-1317)"
method: POST
path: "/v1/web-users/affiliate/start"
tags: ["Web Users"]
---

# Affiliate link entry (GEN-1317)

`POST /v1/web-users/affiliate/start`

Creates an anonymous Firebase user, web user (funnel type + UTM/ad attribution) and acquisition session, resolves the model by public slug, and returns a Firebase custom token so the visitor lands straight in the chat.

## Headers

- `origin` string, required

## Request body

- AffiliateStartDto
  - `modelSlug` string — Public slug of the model to open a chat with. Omitted by the home-screen entry (`/aff`, GEN-1561): the visitor picks a character in the catalog instead.
  - `affiliateId` string — Alias of `utm_source` for partner links written as `?affid=` (GEN-1561). Used only when the link carries no utm_source of its own — the reports know one partner field, not two.
  - `funnelType` string — Funnel type recorded on the web user / acquisition session. Defaults to "aff_1".
  - `attribution` AcquisitionAttributionDto
    - `utmSource` string, nullable
    - `utmMedium` string, nullable
    - `utmCampaign` string, nullable
    - `utmContent` string, nullable
    - `utmTerm` string, nullable
    - `fbclid` string, nullable
    - `gclid` string, nullable
    - `ttclid` string, nullable
    - `referrer` string, nullable
    - `adMetadata` object — Additional ad/campaign metadata captured from the landing URL — all values are strings
  - `locale` string
  - `userAgent` string
  - `amplitudeDeviceId` string

## Response `200`

Affiliate entry successful

- AffiliateStartResponseDto
  - `firebaseCustomToken` string, required — Firebase custom token for anonymous auth
  - `modelId` string, nullable, required — Resolved model ID for the chat, or null when the link carried no model slug (home-screen entry).

## Other responses

- `404` — Model not found by slug

---

[API](https://skmtc.dev/miaai/apis/backend-template-api.md) · [All operations](https://skmtc.dev/miaai/apis/backend-template-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/miaai/backend-template-api/revisions/2a8d88a5124f/schema)
