Complete File Upload

Complete File Upload

Validates that all bytes of the file have been uploaded, and that the content type is supported by Nightfall.

POSThttps://api.nightfall.ai/v3/upload/{fileId}/finish
Authorization
Path parameters
fileId*string (uuid)

a file ID returned from a previous file creation request

Response

Success

Headers
Body
idstring (uuid)

a UUID to uniquely identify a particular file upload

fileSizeBytesinteger

the size of the file in bytes

chunkSizeinteger

the number of bytes to upload in each chunk upload request

mimeTypestring

an RFC2045 media type that describes the underlying content type

Request
const response = await fetch('https://api.nightfall.ai/v3/upload/{fileId}/finish', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer <token>"
    },
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "mimeType": "text"
}

Last updated