---
title: "Record Attribution"
method: PUT
path: "/api/workspace/attribution"
tags: ["workspace"]
---

# Record Attribution

`PUT /api/workspace/attribution`

## Request

- Base URL: `https://api.heymetra.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.heymetra.com/api/workspace/attribution`
- Auth: none declared

Store the ad click ids the workspace arrived with.

Called by the app once a session resolves, because the values live in
first-party cookies the browser holds and the webhook that later confirms a
subscription has no browser to read them from.

Written once and never overwritten. Any member of the workspace may call it
— this is not privileged data and the first user through the door is
usually the one who clicked the ad. A call carrying nothing is a no-op
rather than an error: most sessions have no click ids to report.

Beside the click ids it keeps what an ad platform needs to match a
conversion the server reports (ZEISO-526 §2.5): the browser's user agent
and IP, read from the request itself and never from the body, so the
browser cannot claim them; the consent the site recorded; and who
captured it. A ``sign_up`` still waiting for these is completed and sent.

## Headers

- `authorization` string, nullable
- `x-workspace-id` string, nullable

## Request body

- AttributionIn: How the workspace found us, read by the app from first-party cookies.
  - `client_id` string, nullable
  - `click_ids` object

## Response `204`

Successful Response

## Other responses

- `422`: Validation Error

---

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