---
title: "Create a traffic source"
method: POST
path: "/v1/traffic-sources"
tags: ["Traffic sources"]
---

# Create a traffic source

`POST /v1/traffic-sources`

## Request

- Base URL: `https://api.feelingsurf.fr`
- URL: `https://api.feelingsurf.fr/v1/traffic-sources`
- Auth: HTTP bearer

Exceeding the per-account source cap returns 403 `limit_reached`.

## Request body

- TrafficSourceCreate
  - `name` string, required: Name of the traffic source; a default is shown when unset.
  - `referer` string, required: The referer to report to the target site (a domain or full URL, e.g. `https://www.google.com/`); the scheme is stripped on save.

## Response `201`

The created traffic source.

- TrafficSource: A traffic source (custom referer) a site can report visits as coming from.
  - `id` integer: Unique identifier.
  - `name` string, nullable: Name of the traffic source; a default is shown when unset.
  - `referer` string: The referer reported to the target site. Only the scheme is removed, so `https://www.google.com/` is stored as `www.google.com/`.
  - `premium` boolean: Whether this source is gated to Premium. Premium sources (your custom ones, plus some shared ones) are unassigned from your sites if your subscription lapses.
  - `custom` boolean: True for your own sources, false for shared/built-in ones. Independent of `premium`, since some shared sources are Premium-gated too.
  - `created_at` string, date-time, nullable: When it was created (UTC), or null.

## Other responses

- `400`: The request body was missing or not a JSON object.
- `401`: Missing or invalid API key.
- `403`: The request is not allowed. A banned or disabled account is rejected with `forbidden`; a site setting your plan does not include is rejected with `premium_required`.
- `422`: The request body failed validation.
- `429`: Too many requests — the per-account, per-minute rate limit was exceeded. Wait the number of seconds given in the `Retry-After` response header, then retry.

---

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