Appearance
Files API
All URIs are relative to https://api.syntheticusers.com/api/v1
| Method | HTTP request | Description |
|---|---|---|
| createFile | POST /files | Create File |
| deleteFile | DELETE /files/ | Delete File |
| getFile | GET /files/ | Get File |
| getFileDownloadUrl | POST /files/{file_id}/download | Get File Download Url |
| listFiles | GET /files | List Files |
| startProcessing | POST /files/{file_id}/process | Start Processing |
| uploadFileProxy | POST /files/{file_id}/upload | Upload File Proxy |
createFile
FileWithPresignedURL createFile(fileCreate)
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiCreateFileRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiCreateFileRequest = {
fileCreate: {
filename: "filename_example",
uses: "uses_example",
projectId: "projectId_example",
},
};
const data = await apiInstance.createFile(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| fileCreate | FileCreate |
Return type
FileWithPresignedURL
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
deleteFile
any deleteFile()
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiDeleteFileRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiDeleteFileRequest = {
fileId: "file_id_example",
};
const data = await apiInstance.deleteFile(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | [string] | defaults to undefined |
Return type
any
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
getFile
any getFile()
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiGetFileRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiGetFileRequest = {
fileId: "file_id_example",
};
const data = await apiInstance.getFile(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | [string] | defaults to undefined |
Return type
any
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
getFileDownloadUrl
FileDownloadURL getFileDownloadUrl()
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiGetFileDownloadUrlRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiGetFileDownloadUrlRequest = {
fileId: "file_id_example",
};
const data = await apiInstance.getFileDownloadUrl(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | [string] | defaults to undefined |
Return type
FileDownloadURL
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
listFiles
PageFile listFiles()
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiListFilesRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiListFilesRequest = {
// Comma-separated list of file IDs (optional)
id: "id_example",
// Filter by file usage (optional)
uses: "uses_example",
// Comma-separated list of project IDs (optional)
projectId: "projectId_example",
// Page number (optional)
page: 1,
// Page size (optional)
size: 50,
};
const data = await apiInstance.listFiles(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | [string] | Comma-separated list of file IDs | (optional) defaults to undefined |
| uses | [string] | Filter by file usage | (optional) defaults to undefined |
| projectId | [string] | Comma-separated list of project IDs | (optional) defaults to undefined |
| page | [number] | Page number | (optional) defaults to 1 |
| size | [number] | Page size | (optional) defaults to 50 |
Return type
PageFile
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
startProcessing
any startProcessing()
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiStartProcessingRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiStartProcessingRequest = {
fileId: "file_id_example",
};
const data = await apiInstance.startProcessing(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | [string] | defaults to undefined |
Return type
any
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |
[Back to top] [Back to API list] [Back to SDK]
uploadFileProxy
any uploadFileProxy()
Proxy endpoint for file uploads when clients cannot access S3 directly. This endpoint mimics S3 presigned POST behavior, accepting form data with the file blob.
Example
typescript
import { createConfiguration, FilesApi } from '';
import type { FilesApiUploadFileProxyRequest } from '';
const configuration = createConfiguration();
const apiInstance = new FilesApi(configuration);
const request: FilesApiUploadFileProxyRequest = {
fileId: "file_id_example",
file: { data: Buffer.from(fs.readFileSync('/path/to/file', 'utf-8')), name: '/path/to/file' },
};
const data = await apiInstance.uploadFileProxy(request);
console.log('API called successfully. Returned data:', data);Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| fileId | [string] | defaults to undefined | |
| file | [HttpFile] | (optional) defaults to undefined |
Return type
any
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 422 | Validation Error | - |