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

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

requestSiteUpload

Обновлено

POST /api/v1/tools/site/request-upload

Request staged bundle upload URLs

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

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.schemaSiteUploadRequest
requiredtrue

Ответы

ПолеЗначение
201.content.application/json.schemaSiteUploadTicket
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 upload 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"]
404.content.application/problem+json.schemaProblemDetails
404.description"Host is not a live tenant UGC or verified custom domain"
404.x-error-codes["NOT_FOUND"]
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 mismatch; a source the allowlist or the address screening refuses (INVALID_INPUT, the public MEDIA_* code of the refusal in its message), or one without a size the server can prove; a path outside the permitted publication prefix or reserved on a tenant site host; a video over the per-video size of the plan (details.path, details.limit_bytes); a bundle over the site size of the plan (details.limit_bytes) or over the technical cap of 10000 bundle files, counting HTML, assets and private fragments on every plan, separately from published pages (details.limit_files)"
422.x-error-codes["IDEMPOTENCY_KEY_MISMATCH","SITE_PATH_OUTSIDE_PUBLISHABLE_PREFIX","SITE_PATH_RESERVED","SITE_VIDEO_TOO_LARGE","SITE_BUNDLE_TOO_LARGE","SITE_TOO_MANY_FILES","INVALID_INPUT"]
429.content.application/problem+json.schemaProblemDetails
429.description"Resource rate budget exceeded or unavailable, or the daily upload budget of the plan is spent: tickets, one per request whatever its file count (details.limit_tickets, details.remaining_tickets), and declared bytes (details.limit_bytes, details.remaining_bytes); details.retry_after is the reset at UTC midnight. With remaining_tickets 0 only that reset helps; with tickets left, a declaration within remaining_bytes is issued today"
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","MINT_QUOTA_EXCEEDED"]
500.content.application/problem+json.schemaProblemDetails
500.description"Unexpected internal failure"
500.x-error-codes["INTERNAL_ERROR"]
503.content.application/problem+json.schemaProblemDetails
503.description"The daily upload budget could not be checked; no ticket was issued. Repeat after Retry-After"
503.headers.Retry-After.description"Retry delay in seconds, when supplied by the limiter"
503.headers.Retry-After.schema503.headers.Retry-After.schema
503.x-error-codes["MINT_QUOTA_UNAVAILABLE"]

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

ПолеЗначение
description"Owner-only site:write. Canonical UGC host ({slug}.{ugc zone} in either zone) or connected verified custom host; tenant UGC on the main platform host is prohibited. Nonempty declared files; each includes path, content_type, optional references and either integer nonnegative size_bytes (a file the caller PUTs) or a source. A source ({url, byte_length?, sha256?}, the same form as media import sources) makes the server fetch the file itself, for a caller that cannot reach the storage host: an https address on an allowed file host, or a data:<mime>;base64 file with byte_length; size_bytes may then be omitted, and an https source without it is sized by its Content-Length before the ticket is priced. A source the allowlist or the address screening refuses is a 422 naming the file and the public code. Each upload in the reply carries status: awaiting_put with a put_url, or fetching with a null put_url and null expires_at (do not PUT it). Both kinds mix in one ticket, and publish waits for the fetching ones. mode defaults to merge: omitted bio, binary assets and references are preserved. Explicit replace declares a complete snapshot and removes omitted files. Access rules are not part of a bundle: a ticket never changes them (set them with PUT /api/v1/tools/site/access-rules), and a bundle that lists tgf-gate.json is refused at publish. The issuer pins canonical host, mode and server-owned base_manifest_digest; caller base/client fields are forbidden. The facade checks tenant host, safe paths, dependencies, each video file against the per-video size of the plan (by the served type of its extension, before the bundle total), the full effective site byte cap, the technical cap of 10000 files (HTML, assets and private fragments, the same on every plan), and the daily upload budget before minting. Published HTML pages have a separate per-host plan limit: Free 10, Starter 100, AI Manager 500, AI Coach 1000, Enterprise unlimited; trial and its 24-hour grace period use AI Manager (500). Hidden pages, assets, private HTML fragments and autogenerated platform pages do not count toward that page limit. Excess pages are retained with published:false by deterministic selection, rather than rejecting the whole bundle for its page count. Bundle byte limits remain Free/Starter/AI Manager/AI Coach/Enterprise 10/10/50/100/200 MiB. Each .ru, .com and custom host has independent limits; publication does not automatically copy a site to .com. Video files (.mp4, .webm) are accepted up to 5 MiB per file on Free and 10 MiB on other plans and trial, within the total bundle byte cap. Every refusal names its limit in details. Signed PUTs target staging and bind Content-Length. Expire in 300 seconds. There is no separate status call: POST /api/v1/tools/site/publish with the upload_id is the status check. No secret approval gate."
operationId"requestSiteUpload"
summary"Request staged bundle upload URLs"
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"