Skip to content

Files API

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

MethodHTTP requestDescription
create_filePOST /filesCreate File
delete_fileDELETE /files/Delete File
get_fileGET /files/Get File
get_file_download_urlPOST /files/{file_id}/downloadGet File Download Url
list_filesGET /filesList Files
start_processingPOST /files/{file_id}/processStart Processing
upload_file_proxyPOST /files/{file_id}/uploadUpload File Proxy

create_file

FileWithPresignedURL create_file(file_create)

Create File

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file_create import FileCreate
from syntheticusers.models.file_with_presigned_url import FileWithPresignedURL
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    file_create = syntheticusers.FileCreate() # FileCreate | 

    try:
        # Create File
        api_response = api_instance.create_file(file_create)
        print("The response of FilesApi->create_file:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->create_file: %s\n" % e)

Parameters

NameTypeDescriptionNotes
file_createFileCreate

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]

delete_file

object delete_file(file_id)

Delete File

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    file_id = 'file_id_example' # str | 

    try:
        # Delete File
        api_response = api_instance.delete_file(file_id)
        print("The response of FilesApi->delete_file:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->delete_file: %s\n" % e)

Parameters

NameTypeDescriptionNotes
file_idstr

Return type

object

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]

get_file

File get_file(file_id)

Get File

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file import File
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    file_id = 'file_id_example' # str | 

    try:
        # Get File
        api_response = api_instance.get_file(file_id)
        print("The response of FilesApi->get_file:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->get_file: %s\n" % e)

Parameters

NameTypeDescriptionNotes
file_idstr

Return type

File

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]

get_file_download_url

FileDownloadURL get_file_download_url(file_id)

Get File Download Url

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file_download_url import FileDownloadURL
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    file_id = 'file_id_example' # str | 

    try:
        # Get File Download Url
        api_response = api_instance.get_file_download_url(file_id)
        print("The response of FilesApi->get_file_download_url:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->get_file_download_url: %s\n" % e)

Parameters

NameTypeDescriptionNotes
file_idstr

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]

list_files

PageFile list_files(id=id, uses=uses, project_id=project_id, page=page, size=size)

List Files

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.page_file import PageFile
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    id = 'id_example' # str | Comma-separated list of file IDs (optional)
    uses = 'uses_example' # str | Filter by file usage (optional)
    project_id = 'project_id_example' # str | Comma-separated list of project IDs (optional)
    page = 1 # int | Page number (optional) (default to 1)
    size = 50 # int | Page size (optional) (default to 50)

    try:
        # List Files
        api_response = api_instance.list_files(id=id, uses=uses, project_id=project_id, page=page, size=size)
        print("The response of FilesApi->list_files:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->list_files: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrComma-separated list of file IDs[optional]
usesstrFilter by file usage[optional]
project_idstrComma-separated list of project IDs[optional]
pageintPage number[optional] [default to 1]
sizeintPage size[optional] [default 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]

start_processing

File start_processing(file_id)

Start Processing

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.file import File
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    file_id = 'file_id_example' # str | 

    try:
        # Start Processing
        api_response = api_instance.start_processing(file_id)
        print("The response of FilesApi->start_processing:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->start_processing: %s\n" % e)

Parameters

NameTypeDescriptionNotes
file_idstr

Return type

File

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]

upload_file_proxy

object upload_file_proxy(file_id, file=file)

Upload File Proxy

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

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.syntheticusers.com/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = syntheticusers.Configuration(
    host = "https://api.syntheticusers.com/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: HTTPBearer
configuration = syntheticusers.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with syntheticusers.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = syntheticusers.FilesApi(api_client)
    file_id = 'file_id_example' # str | 
    file = None # bytearray |  (optional)

    try:
        # Upload File Proxy
        api_response = api_instance.upload_file_proxy(file_id, file=file)
        print("The response of FilesApi->upload_file_proxy:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling FilesApi->upload_file_proxy: %s\n" % e)

Parameters

NameTypeDescriptionNotes
file_idstr
filebytearray[optional]

Return type

object

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.