hosting

PATCH /v1/sites/{siteId}/cdn/budget

Set this site's metered CDN spend ceiling.

Все эндпоинты hosting

Вся документация для разработчиков

Аутентификация

Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение hosting.cdn.manage; ключ без него отклоняется с кодом 403, а не 404.

Этот эндпоинт не принимает идентификатор организации. Ваш ключ уже определяет организацию, к которой он принадлежит, и ответ ограничивается ее рамками.

Попробовать

Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.

curl -X PATCH https://api.zinndigital.com/v1/sites/{siteId}/cdn/budget \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "cap_minor": <integer> }'

Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли

Подробнее

cap_minor: 0 means no per-site ceiling — the account cap alone applies — and is the default. Any other value must be at least the platform minimum; a cap of a few cents is a site that pauses on its first visitor and reads as broken hosting rather than as a budget working. Raising the cap above what the site has already spent resumes it. Leaving it paused would require a second, undiscoverable action and would read as the setting not working. A site paused by staff is not resumed by this — that pause is not the customer's to lift. Requires hosting.cdn.manage.

Параметры

ИмяТипОбязательноЧто это
siteId (path)UuidДаSite ID (UUIDv7).

Тело запроса

ИмяТипОбязательноЧто это
cap_minorintegerДа0 for no per-site ceiling, otherwise at least the platform minimum.

Ответ

ИмяТипОбязательноЧто это
cap_minorintegerДаThis site's ceiling in integer minor units. 0 means no per-site ceiling — the account cap alone applies.
spent_period_minorintegerДа
statestring<active, paused_cap, paused_standing, paused_admin>ДаFour states rather than a boolean, because the remedy differs: the customer's own cap is self-service, a standing lapse needs a payment, and a staff pause needs staff.
paused_reasonstringНет
meteredbooleanДаWhether this site is on the tier that pays per gigabyte.
servingbooleanНетWhether the metered CDN is serving right now. Reads both this site's state and its account's, because either can pause it. ⛔ Absent entirely when metered is false,…
currencystringНетISO code denominating cap_minor and spent_period_minor (§2.8). ⛔ Absent when the org has not opened metered credit, because minor units without an exponent are unreadable: a…

Ошибки, которые может возвращать этот эндпоинт

401 · 403 · 404 · 422 · 429