# File Upload REST API Guide

## Upload file in a single part

> Uploads a file in a single part to Fiddler.

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"file-upload","description":"Endpoints related to file uploading."}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"FileUploadRequest":{"type":"object","required":["file"],"properties":{"file":{"$ref":"#/components/schemas/FileBinary"}}},"FileBinary":{"type":"string","format":"binary","description":"Binary file object"},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"FileUploadResponse":{"$ref":"#/components/schemas/FileResponse"},"FileResponse":{"required":["id","filename","type","status","created_at","updated_at","created_by","updated_by"],"allOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/FileId"},"filename":{"$ref":"#/components/schemas/FileName"},"type":{"type":"string","description":"File type","enum":["CSV","PARQUET","TAR_GZ"]},"status":{"type":"string","description":"Status of the file upload process","enum":["INITIATED","SUCCESSFUL","FAILED"]},"created_by":{"$ref":"#/components/schemas/UserCompact"},"updated_by":{"$ref":"#/components/schemas/UserCompact"}}},{"$ref":"#/components/schemas/CreateUpdateTimestamp"}]},"FileId":{"type":"string","format":"uuid","description":"Unique file identifier"},"FileName":{"type":"string","description":"Name of the file uploaded by the user."},"UserCompact":{"type":"object","title":"UserCompactV3","description":"Compact version of a user which can be included in the response of relevant APIs.\n","required":["id","email"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true,"description":"Unique identifier for the user.\n"},"full_name":{"type":"string","readOnly":true,"description":"Full name of the user.\n"},"email":{"type":"string","format":"email","description":"Email address of the user.\n"}}},"CreateUpdateTimestamp":{"type":"object","required":["created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","readOnly":true,"description":"Date and time when the object was created.\n"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"description":"Date and time when the object was last updated.\n"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/files/upload":{"post":{"tags":["file-upload"],"summary":"Upload file in a single part","description":"Uploads a file in a single part to Fiddler.","operationId":"fileUpload","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/FileUploadRequest"}}}},"responses":{"200":{"description":"File uploaded successfully.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FileUploadResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Initiate multi-part upload

> Initiates a multi-part upload process for a large file to Fiddler.

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"file-upload","description":"Endpoints related to file uploading."}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"MultiPartInitRequest":{"type":"object","required":["filename"],"properties":{"filename":{"$ref":"#/components/schemas/FileName"}}},"FileName":{"type":"string","description":"Name of the file uploaded by the user."},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"MultiPartInitResponse":{"$ref":"#/components/schemas/FileResponse"},"FileResponse":{"required":["id","filename","type","status","created_at","updated_at","created_by","updated_by"],"allOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/FileId"},"filename":{"$ref":"#/components/schemas/FileName"},"type":{"type":"string","description":"File type","enum":["CSV","PARQUET","TAR_GZ"]},"status":{"type":"string","description":"Status of the file upload process","enum":["INITIATED","SUCCESSFUL","FAILED"]},"created_by":{"$ref":"#/components/schemas/UserCompact"},"updated_by":{"$ref":"#/components/schemas/UserCompact"}}},{"$ref":"#/components/schemas/CreateUpdateTimestamp"}]},"FileId":{"type":"string","format":"uuid","description":"Unique file identifier"},"UserCompact":{"type":"object","title":"UserCompactV3","description":"Compact version of a user which can be included in the response of relevant APIs.\n","required":["id","email"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true,"description":"Unique identifier for the user.\n"},"full_name":{"type":"string","readOnly":true,"description":"Full name of the user.\n"},"email":{"type":"string","format":"email","description":"Email address of the user.\n"}}},"CreateUpdateTimestamp":{"type":"object","required":["created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","readOnly":true,"description":"Date and time when the object was created.\n"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"description":"Date and time when the object was last updated.\n"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/files/multipart-init":{"post":{"tags":["file-upload"],"summary":"Initiate multi-part upload","description":"Initiates a multi-part upload process for a large file to Fiddler.","operationId":"initiateMultiPartUpload","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiPartInitRequest"}}}},"responses":{"200":{"description":"Multi-part upload request initiated successfully.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MultiPartInitResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Upload file a part of the file

> Uploads a part of a large file to Fiddler as part of a multi-part upload process.

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"file-upload","description":"Endpoints related to file uploading."}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"PartUploadRequest":{"type":"object","required":["file","file_id","part_number"],"properties":{"file":{"$ref":"#/components/schemas/FileBinary"},"file_id":{"$ref":"#/components/schemas/FileId"},"part_number":{"$ref":"#/components/schemas/PartNumber"}}},"FileBinary":{"type":"string","format":"binary","description":"Binary file object"},"FileId":{"type":"string","format":"uuid","description":"Unique file identifier"},"PartNumber":{"type":"integer","description":"Part number of the file in multi-part upload process.","maximum":1000,"minimum":1},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"MultiPartUploadResponse":{"type":"object","required":["part_id"],"properties":{"part_id":{"$ref":"#/components/schemas/PartNumber"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/files/multipart-upload":{"post":{"tags":["file-upload"],"summary":"Upload file a part of the file","description":"Uploads a part of a large file to Fiddler as part of a multi-part upload process.","operationId":"uploadPart","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/PartUploadRequest"}}}},"responses":{"200":{"description":"File part uploaded successfully.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MultiPartUploadResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Complete multi-part upload

> Completes the multi-part upload process for a large file in Fiddler.

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"file-upload","description":"Endpoints related to file uploading."}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"MultiPartCompleteRequest":{"type":"object","properties":{"file_id":{"$ref":"#/components/schemas/FileId"},"parts":{"type":"array","items":{"$ref":"#/components/schemas/Part"}}}},"FileId":{"type":"string","format":"uuid","description":"Unique file identifier"},"Part":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the part"},"number":{"$ref":"#/components/schemas/PartNumber"}}},"PartNumber":{"type":"integer","description":"Part number of the file in multi-part upload process.","maximum":1000,"minimum":1},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"MultiPartCompleteResponse":{"$ref":"#/components/schemas/FileResponse"},"FileResponse":{"required":["id","filename","type","status","created_at","updated_at","created_by","updated_by"],"allOf":[{"type":"object","properties":{"id":{"$ref":"#/components/schemas/FileId"},"filename":{"$ref":"#/components/schemas/FileName"},"type":{"type":"string","description":"File type","enum":["CSV","PARQUET","TAR_GZ"]},"status":{"type":"string","description":"Status of the file upload process","enum":["INITIATED","SUCCESSFUL","FAILED"]},"created_by":{"$ref":"#/components/schemas/UserCompact"},"updated_by":{"$ref":"#/components/schemas/UserCompact"}}},{"$ref":"#/components/schemas/CreateUpdateTimestamp"}]},"FileName":{"type":"string","description":"Name of the file uploaded by the user."},"UserCompact":{"type":"object","title":"UserCompactV3","description":"Compact version of a user which can be included in the response of relevant APIs.\n","required":["id","email"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true,"description":"Unique identifier for the user.\n"},"full_name":{"type":"string","readOnly":true,"description":"Full name of the user.\n"},"email":{"type":"string","format":"email","description":"Email address of the user.\n"}}},"CreateUpdateTimestamp":{"type":"object","required":["created_at","updated_at"],"properties":{"created_at":{"type":"string","format":"date-time","readOnly":true,"description":"Date and time when the object was created.\n"},"updated_at":{"type":"string","format":"date-time","readOnly":true,"description":"Date and time when the object was last updated.\n"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/files/multipart-complete":{"post":{"tags":["file-upload"],"summary":"Complete multi-part upload","description":"Completes the multi-part upload process for a large file in Fiddler.","operationId":"completeMultiPartUpload","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiPartCompleteRequest"}}}},"responses":{"200":{"description":"Multi-part upload request completed successfully.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MultiPartCompleteResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```
