---
title: "Set Attribution"
method: POST
path: "/api/v1/profile/attribution"
tags: ["Profile"]
---

# Set Attribution

`POST /api/v1/profile/attribution`

## Request

- Base URL: `https://api.gemstoneaiapp.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.gemstoneaiapp.com/api/v1/profile/attribution`
- Auth: HTTP bearer

POST /api/v1/profile/attribution — persist first-touch install attribution.

Write-once: after attribution_captured_at is set the record is immutable,
so re-syncs from the app (or replays) can't overwrite first-touch.

## Request body

- AttributionPayload
  - `source` string, nullable: utm_source / referrer source
  - `medium` string, nullable: utm_medium
  - `campaign` string, nullable: utm_campaign / ct token
  - `ref` string, nullable: ref shortcode from deep links
  - `captured_at` string, date-time, nullable: When the client first captured this

## Response `200`

Successful Response

- AttributionResponse
  - `captured` boolean, required
  - `attribution_source` string, nullable
  - `attribution_medium` string, nullable
  - `attribution_campaign` string, nullable
  - `attribution_ref` string, nullable
  - `attribution_captured_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/gemstoneaiapp/apis/gemstoneai-api.md) · [All operations](https://skmtc.dev/gemstoneaiapp/apis/gemstoneai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gemstoneaiapp/apis/gemstoneai-api/revisions/fcb441f55161?raw)
