---
title: "Register this device's AppsFlyer id against the current user"
method: POST
path: "/api/marketing/device"
tags: ["Marketing Attribution"]
---

# Register this device's AppsFlyer id against the current user

`POST /api/marketing/device`

## Request

- Base URL: `https://api.rewritelifestyle.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.rewritelifestyle.ai/api/marketing/device`
- Auth: HTTP bearer

Additive, idempotent — upserts on (user_id, appsflyer_id) and flushes any marketing events that were waiting on this identity (AppsFlyer S2S plan §3.3).

## Request body

- RegisterDeviceDto
  - `appsflyerId` string, required
  - `platform` 'ios' | 'android', required
  - `appVersion` string
  - `bundleId` string

## Response `200`

## Changes

- **2026-09-09** `88a4b30d991d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api/changes/api/marketing/device/post.md)

---

[API](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api.md) - [All operations](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api/llms.txt) - [OpenAPI document](https://skmtc.dev/rewritelifestyle/apis/rewrite-lifestyle-api/revisions/28695827f27a?raw)
