# Accept Request

This section allows you to accept the created request's cost and upload the source video

## Accept and Upload Video Request

> Calling this endpoint reserves the estimated credits and returns signed URL(s) for \*\*multi-part upload\*\*.\
> \
> \### Video uploads\
> The Video API uses multi-part upload to receive the video file for processing. You can use a simple byte-division function to create segments for the API to receive.\
> \
> For example, if you have a 900MB video file and the system returns 3 upload URLs. You would then:\
> \
> \- Upload bytes 0-300,000,000 via HTTP PUT to \`urls\[0]\`\
> \- Upload bytes 300,000,001-600,000,000 via HTTP PUT to \`urls\[1]\`\
> \- Upload bytes 600,000,001-900,000,000 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/).\
> \
> \## Response body\
> \
> \| \*\*Property\*\*  | \*\*Type\*\*   | \*\*Description\*\*                                     |\
> \|---------------|------------|-----------------------------------------------------|\
> \| \*\*uploadId\*\*  | String     | Upload ID for multi-part upload                     |\
> \| \*\*urls\*\*      | Array      | URLs for multi-part uploads                         |<br>

```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"}}}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"PaymentRequired":{"description":"Payment required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"NotFound":{"description":"Enhancement request with the provided ID not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}},"ServiceUnavailable":{"description":"Service unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}},"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 URL(s) for **multi-part upload**.\n\n### Video uploads\nThe Video API uses multi-part upload to receive the video file for processing. You can use a simple byte-division function to create segments for the API to receive.\n\nFor example, if you have a 900MB video file and the system returns 3 upload URLs. You would then:\n\n- Upload bytes 0-300,000,000 via HTTP PUT to `urls[0]`\n- Upload bytes 300,000,001-600,000,000 via HTTP PUT to `urls[1]`\n- Upload bytes 600,000,001-900,000,000 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\n## Response body\n\n| **Property**  | **Type**   | **Description**                                     |\n|---------------|------------|-----------------------------------------------------|\n| **uploadId**  | String     | Upload ID for multi-part upload                     |\n| **urls**      | Array      | URLs for multi-part uploads                         |\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"}}}}}}
```
