Skip to main content
curl

Authorizations

Authorization
string
header
required

A management token: ds_mgmt_ followed by 40 lowercase hexadecimal characters, created by an owner in Settings → Management tokens. Opaque: send it as is, in the Authorization header only.

Path Parameters

domain
string
required

The site's bare domain, normalized like the console form (trimmed, lowercase). www.news-site.example and news-site.example are two different sites. A domain that is not a site of this organisation — absent, another organisation's, or not a valid domain — is 404, except on PUT /v1/sites/{domain}, which creates the site and answers 422 for an invalid domain.

ref
string
required

The fragment reference, sent as one path segment: encode the whole reference once with encodeURIComponent, so every / travels as %2F (/1234567/news-site/organic/politics → %2F1234567%2Fnews-site%2Forganic%2Fpolitics). Unencoded slashes match no operation (404); a double-encoded reference (%252F…) is refused (422). A reference is case-sensitive: 1 to 200 characters among A-Z a-z 0-9 / _ - . :, and no path segment may be . or .. on its own (URL processing would remove it). The value below is the decoded reference.

Pattern: ^[A-Za-z0-9/_.:-]{1,200}$

Body

application/json

Send Content-Type: application/json and a JSON object of at most 262,144 bytes.

The fragment, as a whole: on an update, lang, description and key_values are reset to their default when absent. Only status keeps its current value when absent.

name
string
required

Required. Trimmed, and must not be blank once trimmed.

Minimum string length: 1
status
enum<string>

Exact value, not trimmed. Absent: active on creation, unchanged on update.

Available options:
active,
paused
lang
enum<string>
default:fr

Exact value, not trimmed. Absent: fr, on an update too — send it every time.

Available options:
fr,
en,
de,
es,
it
description
string

Trimmed. Absent, empty or blank: no description (null).

key_values
object

Legacy targeting key-values, {"key": ["value", …]}; {} when none. Keys match ^[a-z0-9_-]+$ exactly (not trimmed; __proto__ is refused). Each key has a non-empty list of strings; each value is trimmed, and must then be non-empty and without commas or line breaks.

Example:

Response

The fragment existed and was updated (or left unchanged).

A Fragment, plus what a paused fragment still serves.

id
string
required

Stable fragment id (frg_…). Never changes.

site_id
string
required

The site id (sit_…).

domain
string
required

The site domain.

ref
string | null
required

The fragment reference. Null for a fragment created in the console without one: it is listed, but this API cannot write it, target it with a rule, or make a card eligible on it.

name
string
required

The fragment name.

description
string | null
required

The description, or null.

lang
string
required

The fragment language: fr, en, de, es or it.

key_values
object
required

Legacy targeting key-values, {"key": ["value", …]}; {} when none. Keys match ^[a-z0-9_-]+$ exactly (not trimmed; __proto__ is refused). Each key has a non-empty list of strings; each value is trimmed, and must then be non-empty and without commas or line breaks.

Example:
status
enum<string>
required

paused: every page that resolves to this fragment answers 204 on the fragment endpoint.

Available options:
active,
paused
created_at
string<date-time>
required

Creation time, UTC.

warnings
string[]
required

For a paused fragment, what still resolves to it and therefore answers 204: "site default", "target of N rules" ("target of 1 rule"). [] for an active fragment, or a paused one nothing resolves to.