Count one landing on a referral link
const url = 'http://localhost:8000/api/partner/clicks/';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"slug":"amb-kartiki"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8000/api/partner/clicks/ \ --header 'Content-Type: application/json' \ --data '{ "slug": "amb-kartiki" }'Public: the app sends it once per page load that carries utm_source=amb-<slug>, before it strips the campaign params (#2517). It adds one to that ambassador’s count for the UTC day and keeps nothing about the visitor — no cookie, no IP, no id. 204 whether or not an ambassador carries the slug, so the endpoint reveals no codes; 400 when the body is not a slug; 429 past the per-IP rate. JSON or form-encoded (navigator.sendBeacon).
Authorizations
Section titled “Authorizations”- None
Request Bodyrequired
Section titled “Request Bodyrequired”POST /api/partner/clicks/ — one landing on a referral link.
object
The utm_source the link carried, amb-<name>.
Examples
A landing on Kartiki's link
{ "slug": "amb-kartiki"}POST /api/partner/clicks/ — one landing on a referral link.
object
The utm_source the link carried, amb-<name>.
Example generated
slug=examplePOST /api/partner/clicks/ — one landing on a referral link.
object
The utm_source the link carried, amb-<name>.
Responses
Section titled “Responses”No response body
object
Human-readable message, or a stable machine code for the cases a client branches on. The standard envelope for 400 (validation — a field-keyed object may appear instead), 401 (missing / invalid credentials), 403 (authenticated but not permitted), and 404 (absent — cross-team records are collapsed to 404 so the API never leaks the existence of another team’s data).
Example generated
{ "detail": "example"}object
429 — rate limit exceeded. Honour the Retry-After response header (seconds to wait) before retrying; it is sent on every 429.
Example generated
{ "detail": "example"}