> For the complete documentation index, see [llms.txt](https://developer.topazlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.topazlabs.com/reference/video/accept-request/accept-and-upload-video-request.md).

# Accept and Upload Video Request

Calling this endpoint reserves the estimated credits and returns signed upload URL(s).

#### Video uploads

A **single** upload URL is returned when `source.size` is at or under **500 MB**, or when `source.frameCount` is 1,000 or fewer. PUT the whole file to `urls[0]`; there are no part numbers or ETags to collect in that case.

Every larger source uses multi-part upload. The number of URLs returned is `source.size` divided by the **500 MB** segment size, rounded up — always at least 2 on this path — and capped at 150 URLs. Split the file into `max(500 MB, ceil(source.size / urls.length))`-byte segments and PUT them in order, one per URL: that is a plain 500 MB byte division for anything up to 75 GB, and larger segments for the sources above it where the 150-URL cap binds.

For example, a 1.2 GB video file returns 3 upload URLs, so 500 MB segments cover it exactly:

* Upload bytes 0-499,999,999 via HTTP PUT to `urls[0]`
* Upload bytes 500,000,000-999,999,999 via HTTP PUT to `urls[1]`
* Upload bytes 1,000,000,000-1,199,999,999 via HTTP PUT to `urls[2]`

If one of the uploads fail, you may reuse the same URL to retry - the action overwrites any partially uploaded data.

A successful response from the PUT request returns an `ETag` value in the header for each segment. Retain the part number and ETag pair for the next step (PATCH /video/{requestId}/complete-upload/).

If the request was created with `source.external`, there is nothing to upload: this endpoint reserves credits, starts processing, and returns `202` with a `message` instead of upload URLs.

Calling this endpoint again after the URLs have been issued returns the same `uploadId` and `urls`.

### Response body

| **Property** | **Type** | **Description**                                               |
| ------------ | -------- | ------------------------------------------------------------- |
| **uploadId** | String   | Upload ID for completing the upload                           |
| **urls**     | Array    | Upload URLs                                                   |
| **message**  | String   | Returned instead of the above when `source.external` was used |

```json
{"openapi":"3.0.3","info":{"title":"Video API","version":"1.0.0"},"tags":[{"name":"Accept Request","description":"This section allows you to accept the created request's cost and upload the source video\n"}],"servers":[{"url":"https://api.topazlabs.com","description":"Production API base URL"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"AcceptResponse":{"type":"object","properties":{"uploadId":{"type":"string","description":"Upload ID for completing multi-part upload"},"urls":{"type":"array","description":"URLs to PUT the parts to. The source video should be split into urls.length number of byte ranges.","items":{"type":"string"}},"message":{"type":"string","description":"The endpoint will return message only if the video will be sourced from an external storage provider"}}}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]},"errors":{"type":"array","description":"Present when the request failed schema validation. One entry per offending field.","items":{"type":"object","properties":{"type":{"type":"string"},"path":{"type":"string"},"location":{"type":"string"},"msg":{"type":"string"},"value":{}}}}}}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]}}}}}},"PaymentRequired":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]}}}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]}}}}}},"NotFound":{"description":"Enhancement request with the provided ID not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]}}}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]}}}}}},"ServiceUnavailable":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"errorCode":{"type":"string","enum":["INSUFFICIENT_CREDITS","INVALID_INPUT","FORBIDDEN","UNAUTHORIZED","SERVER_MAINTENANCE","SERVER_ERROR","UNKNOWN"]}}}}}}}},"paths":{"/video/{requestId}/accept":{"patch":{"tags":["Accept Request"],"summary":"Accept and Upload Video Request","operationId":"AcceptVideoRequest","description":"Calling this endpoint reserves the estimated credits and returns signed upload URL(s).\n\n### Video uploads\nA **single** upload URL is returned when `source.size` is at or under **500 MB**, or when `source.frameCount` is 1,000 or fewer. PUT the whole file to `urls[0]`; there are no part numbers or ETags to collect in that case.\n\nEvery larger source uses multi-part upload. The number of URLs returned is `source.size` divided by the **500 MB** segment size, rounded up — always at least 2 on this path — and capped at 150 URLs. Split the file into `max(500 MB, ceil(source.size / urls.length))`-byte segments and PUT them in order, one per URL: that is a plain 500 MB byte division for anything up to 75 GB, and larger segments for the sources above it where the 150-URL cap binds.\n\nFor example, a 1.2 GB video file returns 3 upload URLs, so 500 MB segments cover it exactly:\n\n- Upload bytes 0-499,999,999 via HTTP PUT to `urls[0]`\n- Upload bytes 500,000,000-999,999,999 via HTTP PUT to `urls[1]`\n- Upload bytes 1,000,000,000-1,199,999,999 via HTTP PUT to `urls[2]`\n\nIf one of the uploads fail, you may reuse the same URL to retry - the action overwrites any partially uploaded data.\n\nA successful response from the PUT request returns an `ETag` value in the header for each segment. Retain the part number and ETag pair for the next step (PATCH /video/{requestId}/complete-upload/).\n\nIf the request was created with `source.external`, there is nothing to upload: this endpoint reserves credits, starts processing, and returns `202` with a `message` instead of upload URLs.\n\nCalling this endpoint again after the URLs have been issued returns the same `uploadId` and `urls`.\n\n## Response body\n\n| **Property**  | **Type**   | **Description**                                     |\n|---------------|------------|-----------------------------------------------------|\n| **uploadId**  | String     | Upload ID for completing the upload                 |\n| **urls**      | Array      | Upload URLs                                         |\n| **message**   | String     | Returned instead of the above when `source.external` was used |\n","parameters":[{"in":"path","name":"requestId","schema":{"type":"string","format":"uuid"},"required":true}],"responses":{"202":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"500":{"$ref":"#/components/responses/InternalServerError"},"503":{"$ref":"#/components/responses/ServiceUnavailable"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developer.topazlabs.com/reference/video/accept-request/accept-and-upload-video-request.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
