К содержанию
TelegaFirst

Для AI-агентов: markdown этой страницы — /docs/api-op-declaresiteform.mdиндекс документации — /llms.txt

declareSiteForm

Обновлено

POST /api/v1/tools/site/forms

Declare or redeclare a site form

Авторизация и права

Scopes: ALL. Auth alternatives: OR; scopes внутри альтернативы: ALL.

ПолеЗначение
security.0.hubApiKey[]
security.1.hubBearer[]
securitySchemes.hubApiKey.in"header"
securitySchemes.hubApiKey.name"X-Api-Key"
securitySchemes.hubApiKey.type"apiKey"
securitySchemes.hubBearer.scheme"bearer"
securitySchemes.hubBearer.type"http"
x-required-scopes["site:write"]

Параметры запроса

ПолеЗначение
0.description"Tenant, credential and handler-bound byte-shape replay key"
0.in"header"
0.name"Idempotency-Key"
0.requiredtrue
0.schema0.schema

Тело запроса

ПолеЗначение
content.application/json.schemaSiteFormDeclareRequest
requiredtrue

Ответы

ПолеЗначение
201.content.application/json.schemaSiteForm
201.description"Tenant site control-plane result"
201.headers.X-Bot-Username.description"Active bot username, when resolved"
201.headers.X-Bot-Username.schema201.headers.X-Bot-Username.schema
201.headers.X-Client-Slug.description"Active tenant slug, when resolved"
201.headers.X-Client-Slug.schema201.headers.X-Client-Slug.schema
201.headers.X-RateLimit-Limit.description"Effective request budget"
201.headers.X-RateLimit-Limit.schema201.headers.X-RateLimit-Limit.schema
201.headers.X-RateLimit-Remaining.description"Remaining request budget"
201.headers.X-RateLimit-Remaining.schema201.headers.X-RateLimit-Remaining.schema
201.headers.X-RateLimit-Reset.description"Unix window reset in seconds"
201.headers.X-RateLimit-Reset.schema201.headers.X-RateLimit-Reset.schema

Ошибки

ПолеЗначение
400.content.application/problem+json.schemaProblemDetails
400.description"Invalid strict declaration or missing replay key"
400.x-error-codes["VALIDATION_ERROR","IDEMPOTENCY_KEY_REQUIRED"]
401.content.application/problem+json.schemaProblemDetails
401.description"Missing, invalid, revoked or conflicting credential; surface JWT is refused"
401.x-error-codes["INVALID_API_KEY"]
403.content.application/problem+json.schemaProblemDetails
403.description"Missing scope, prohibited publishable credential or absent active bot"
403.x-error-codes["INSUFFICIENT_SCOPE","PUBLISHABLE_KEY_NOT_ALLOWED","NO_ACTIVE_BOT"]
409.content.application/problem+json.schemaProblemDetails
409.description"Typed domain conflict or request in flight"
409.x-error-codes["CONFLICT"]
413.content.application/problem+json.schemaProblemDetails
413.description"Resource policy size or item-count limit exceeded"
413.x-error-codes["PAYLOAD_TOO_LARGE","ITEM_COUNT_EXCEEDED"]
422.content.application/problem+json.schemaProblemDetails
422.description"Replay key reused for different input; after_submit.redirect_url leads off the business's own hosts; a webhook or external_api destination has no exact https origin, or its origin is not in the egress origins; a variants[].when is not a valid predicate array; or order_mode auto/manual lacks catalog_id or meets funnel_outcome checkout"
422.x-error-codes["IDEMPOTENCY_KEY_MISMATCH","FORM_REDIRECT_HOST_NOT_ALLOWED","FORM_ORDER_MODE_NEEDS_CATALOG","FORM_ORDER_MODE_CONFLICTS_CHECKOUT","INVALID_INPUT","FAILED_PRECONDITION"]
429.content.application/problem+json.schemaProblemDetails
429.description"Resource rate budget exceeded or unavailable"
429.headers.Retry-After.description"Retry delay in seconds, when supplied by the limiter"
429.headers.Retry-After.schema429.headers.Retry-After.schema
429.x-error-codes["RATE_LIMIT_EXCEEDED","RATE_LIMIT_UNAVAILABLE"]
500.content.application/problem+json.schemaProblemDetails
500.description"Unexpected internal failure"
500.x-error-codes["INTERNAL_ERROR"]

Дополнительные условия

ПолеЗначение
description"Owner-only site:write. Uses the canonical complete declaration, not a patch: omitted optionals resolve in the facade. The form `id` and every `step_id` are tenant ids; the public form address remains client_slug plus opaque code. Redeclaration preserves that address. Both ru and com are supported. enabled:false stops acceptance; there is no form DELETE. No secret approval gate. after_submit decides what the visitor sees after sending: auto shows the declared title/text (zone defaults when omitted) and the continue action, labelled by button_label (at most 32 characters; zone default when omitted), redirect sends the visitor to redirect_url, which must lead to the business's own site address, a connected custom domain or an allowed_origins origin. Each variants entry carries exactly one of when (funnel_mode deterministic, first match by sort wins) or hint (funnel_mode ai_agent). when is a non-empty array of at most 20 predicates that all must match, e.g. [{\"op\":\"eq\",\"field\":\"budget_band\",\"value\":\"high\"}]; op is eq or neq (any text, number or boolean value), gt, gte, lt or lte (number value), contains (text value), in (values list), exists or absent (no value); field is a dotted answer name of at most 5 segments; an OR is another variants entry. order_mode (none, auto, manual) is what a submission does to orders: auto creates an order for the catalog_id product at once, manual lets the operator create it from the request card; both need catalog_id and funnel_outcome content. order_mode and catalog_id are kept when omitted, because the CRM edits them too; a funnel_outcome checkout declaration must name catalog_id."
operationId"declareSiteForm"
summary"Declare or redeclare a site form"
tags["site"]
x-idempotency.conflictStatus422
x-idempotency.implementation"global-cache"
x-idempotency.replayStatus201
x-idempotency.requiredtrue
x-idempotency.scope["client","credential","controller-handler","key"]
x-idempotency.ttlSeconds86400
x-pagination.queryParameters[]
x-pagination.supportedfalse
x-scope-semantics"ALL"