Finish uploading a file
const url = 'https://example.com/v1/example/files/complete';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"uploadId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/example/files/complete \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "uploadId": "example" }'Checks the file was uploaded as the upload allowed, and adds it to the space’s files under its path.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project ID of the space
Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "uploadId": "example"}Responses
Section titled “Responses”The file
object
Example generated
{ "path": "example", "key": "example", "url": "example", "size": 1, "contentType": "example"}The upload id isn’t valid, has expired or is for another space (invalidUpload)
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token is missing or invalid.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token has no access to this space.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The file hasn’t been uploaded (notUploaded), or isn’t the one the upload was for (uploadMismatch)
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Too many requests. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream failed.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The space is moving between servers. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream timed out.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}