Skip to content

Projects API

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

MethodHTTP requestDescription
get_projectGET /projects/Get Project
list_projectsGET /projectsList Projects
stream_eventsGET /projects/{project_id}/streamStream Events

get_project

Project get_project(project_id)

Get Project

This method fetches and returns a list of all workspaces where the user is active.

The list that is returned also includes all the data included in the workspaces.

Returns:

  • List[WorkspaceSchema]: A list of all workspaces and its data where the user is active.

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.project import Project
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.ProjectsApi(api_client)
    project_id = 'project_id_example' # str | 

    try:
        # Get Project
        api_response = api_instance.get_project(project_id)
        print("The response of ProjectsApi->get_project:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectsApi->get_project: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_idstr

Return type

Project

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_projects

PageProject list_projects(page=page, size=size)

List Projects

This method fetches and returns a list of all workspaces where the user is active.

The list that is returned also includes all the data included in the workspaces.

Returns:

  • List[WorkspaceSchema]: A list of all workspaces and its data where the user is active.

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.page_project import PageProject
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.ProjectsApi(api_client)
    page = 1 # int | Page number (optional) (default to 1)
    size = 50 # int | Page size (optional) (default to 50)

    try:
        # List Projects
        api_response = api_instance.list_projects(page=page, size=size)
        print("The response of ProjectsApi->list_projects:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectsApi->list_projects: %s\n" % e)

Parameters

NameTypeDescriptionNotes
pageintPage number[optional] [default to 1]
sizeintPage size[optional] [default to 50]

Return type

PageProject

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]

stream_events

object stream_events(project_id)

Stream Events

SSE endpoint for streaming model events.

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.ProjectsApi(api_client)
    project_id = 'project_id_example' # str | 

    try:
        # Stream Events
        api_response = api_instance.stream_events(project_id)
        print("The response of ProjectsApi->stream_events:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProjectsApi->stream_events: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_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]

Released under the MIT License.