Skip to content

Files API ​

All URIs are relative to https://api.syntheticusers.com/api/v1

MethodHTTP requestDescription
createFilePOST /filesCreate File
deleteFileDELETE /files/Delete File
getFileGET /files/Get File
getFileDownloadUrlPOST /files/{file_id}/downloadGet File Download Url
listFilesGET /filesList Files
startProcessingPOST /files/{file_id}/processStart Processing
uploadFileProxyPOST /files/{file_id}/uploadUpload 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 ​

NameTypeDescriptionNotes
fileCreateFileCreate

Return type ​

FileWithPresignedURL

Authorization ​

HTTPBearer

HTTP request headers ​

  • Content-Type: application/json
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation 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 ​

NameTypeDescriptionNotes
fileId[string]defaults to undefined

Return type ​

any

Authorization ​

HTTPBearer

HTTP request headers ​

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation 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 ​

NameTypeDescriptionNotes
fileId[string]defaults to undefined

Return type ​

any

Authorization ​

HTTPBearer

HTTP request headers ​

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation 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 ​

NameTypeDescriptionNotes
fileId[string]defaults to undefined

Return type ​

FileDownloadURL

Authorization ​

HTTPBearer

HTTP request headers ​

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation 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 ​

NameTypeDescriptionNotes
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 ​

HTTPBearer

HTTP request headers ​

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation 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 ​

NameTypeDescriptionNotes
fileId[string]defaults to undefined

Return type ​

any

Authorization ​

HTTPBearer

HTTP request headers ​

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation 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 ​

NameTypeDescriptionNotes
fileId[string]defaults to undefined
file[HttpFile](optional) defaults to undefined

Return type ​

any

Authorization ​

HTTPBearer

HTTP request headers ​

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details ​

Status codeDescriptionResponse headers
200Successful Response-
422Validation Error-

[Back to top] [Back to API list] [Back to SDK]

Released under the MIT License.