---
title: "Update a traffic source"
method: PATCH
path: "/v1/traffic-sources/{id}"
tags: ["Traffic sources"]
---

# Update a traffic source

`PATCH /v1/traffic-sources/{id}`

## Request

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

## Path parameters

- `id` integer, required

## Request body

- TrafficSourceUpdate: Provide at least one field.
  - `name` string: Name of the traffic source; a default is shown when unset.
  - `referer` string: 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 `200`

The updated 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`.
- `404`: Resource not found (or not owned by the caller).
- `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)
