# finalizeMediaUpload

Source: <https://telegafirst.com/docs/api-op-finalizemediaupload>
Locale: ru
releaseGitSha: ea133cd4ad87fe549ef000b139be145be9bd1717
sourceContentDigest: 769b3b4dc0ec3e0e201633c41418bf76ebbf80cceacc3e829ff4eafd83b2f9ef
Version: 2

# finalizeMediaUpload

`POST /api/v1/media/uploads/{uploadId}/finalize`

finalizeMediaUpload

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

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 | \["content:write"] |

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

| Поле | Значение |
| - | - |
| 0.description | "Optional 24-hour HTTP replay key for this bodyless POST" |
| 0.in | "header" |
| 0.name | "Idempotency-Key" |
| 0.required | false |
| 0.schema | [0.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 1.in | "path" |
| 1.name | "uploadId" |
| 1.required | true |
| 1.schema | [1.schema](https://telegafirst.com/docs/schema-7913aab91941f4d0e4c6de0879a8ea46fbdfb95dfcbd1bb51ee036b1b0378be7) |

## Тело запроса

| Поле | Значение |
| - | - |
| Тело запроса | null |

## Ответы

| Поле | Значение |
| - | - |
| 200.content.application/json.schema | [200.content.application/json.schema](https://telegafirst.com/docs/schema-69bb6de436d52836acd3cc81661aac5b95dd9d48a3a8aa0f72b6c5659ea432c0) |
| 200.description | "Promoted and committed immutable media references" |
| 200.headers.X-Bot-Username.description | "Authenticated public bot username, when available" |
| 200.headers.X-Bot-Username.schema | [200.headers.X-Bot-Username.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 200.headers.X-Client-Slug.description | "Authenticated tenant slug, when available" |
| 200.headers.X-Client-Slug.schema | [200.headers.X-Client-Slug.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 200.headers.X-RateLimit-Limit.description | "Effective request budget" |
| 200.headers.X-RateLimit-Limit.schema | [200.headers.X-RateLimit-Limit.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 200.headers.X-RateLimit-Remaining.description | "Remaining budget or unknown" |
| 200.headers.X-RateLimit-Remaining.schema | [200.headers.X-RateLimit-Remaining.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |
| 200.headers.X-RateLimit-Reset.description | "Window reset Unix seconds" |
| 200.headers.X-RateLimit-Reset.schema | [200.headers.X-RateLimit-Reset.schema](https://telegafirst.com/docs/schema-00404e686415370f1711c4d7acfa2905444d3cf23cef2e10c47d445ebe690f96) |

## Ошибки

| Поле | Значение |
| - | - |
| 401.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 401.description | "Missing or invalid API key" |
| 403.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 403.description | "Scope or resource policy refused the request" |
| 404.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 404.description | "Upload does not exist for the authenticated tenant" |
| 409.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 409.description | "CONFLICT: durable outcome differs or HTTP replay key is processing" |
| 413.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 413.description | "PAYLOAD\_TOO\_LARGE or ITEM\_COUNT\_EXCEEDED: per-tool resource limits" |
| 422.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 422.description | "VALIDATION\_ERROR: invalid upload id or uncommittable state; IDEMPOTENCY\_KEY\_MISMATCH: different path under the same HTTP key" |
| 429.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 429.description | "RATE\_LIMIT\_EXCEEDED or RATE\_LIMIT\_UNAVAILABLE: resource budget refusal" |
| 429.headers.Retry-After.description | "Retry delay in seconds, when supplied by the limiter" |
| 429.headers.Retry-After.schema | [429.headers.Retry-After.schema](https://telegafirst.com/docs/schema-f0765dbf409c74f001806c446f2cf171d8c46b5b15779d54423dde921a4b0670) |
| 500.content.application/problem+json.schema | [ProblemDetails](https://telegafirst.com/docs/schema-c4113f3de00d728702a8663612e2074cbe3e8b3bb70d2b0dee6f3503fe89bd41) |
| 500.description | "INTERNAL\_ERROR: unexpected failure; no internal payload is exposed" |

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

| Поле | Значение |
| - | - |
| operationId | "finalizeMediaUpload" |
| tags | \["media"] |
| x-idempotency | "http-cache" |
