Skip to content

Plans API

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

MethodHTTP requestDescription
create_planPOST /plansCreate Plan
delete_planDELETE /plans/Delete Plan
get_planGET /plans/Get Plan
list_plansGET /plansList Plans
update_planPATCH /plans/Update Plan

create_plan

Plan create_plan(plan_create)

Create Plan

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.plan import Plan
from syntheticusers.models.plan_create import PlanCreate
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.PlansApi(api_client)
    plan_create = syntheticusers.PlanCreate() # PlanCreate | 

    try:
        # Create Plan
        api_response = api_instance.create_plan(plan_create)
        print("The response of PlansApi->create_plan:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PlansApi->create_plan: %s\n" % e)

Parameters

NameTypeDescriptionNotes
plan_createPlanCreate

Return type

Plan

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_plan

object delete_plan(plan_id)

Delete Plan

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.PlansApi(api_client)
    plan_id = 'plan_id_example' # str | 

    try:
        # Delete Plan
        api_response = api_instance.delete_plan(plan_id)
        print("The response of PlansApi->delete_plan:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PlansApi->delete_plan: %s\n" % e)

Parameters

NameTypeDescriptionNotes
plan_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_plan

Plan get_plan(plan_id)

Get Plan

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.plan import Plan
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.PlansApi(api_client)
    plan_id = 'plan_id_example' # str | 

    try:
        # Get Plan
        api_response = api_instance.get_plan(plan_id)
        print("The response of PlansApi->get_plan:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PlansApi->get_plan: %s\n" % e)

Parameters

NameTypeDescriptionNotes
plan_idstr

Return type

Plan

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_plans

PagePlan list_plans(id=id, project_id=project_id, page=page, size=size)

List Plans

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.page_plan import PagePlan
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.PlansApi(api_client)
    id = 'id_example' # str | Comma-separated list of plans IDs (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 Plans
        api_response = api_instance.list_plans(id=id, project_id=project_id, page=page, size=size)
        print("The response of PlansApi->list_plans:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PlansApi->list_plans: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idstrComma-separated list of plans IDs[optional]
project_idstrComma-separated list of project IDs[optional]
pageintPage number[optional] [default to 1]
sizeintPage size[optional] [default to 50]

Return type

PagePlan

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]

update_plan

Plan update_plan(plan_id, plan_update)

Update Plan

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.plan import Plan
from syntheticusers.models.plan_update import PlanUpdate
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.PlansApi(api_client)
    plan_id = 'plan_id_example' # str | 
    plan_update = syntheticusers.PlanUpdate() # PlanUpdate | 

    try:
        # Update Plan
        api_response = api_instance.update_plan(plan_id, plan_update)
        print("The response of PlansApi->update_plan:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PlansApi->update_plan: %s\n" % e)

Parameters

NameTypeDescriptionNotes
plan_idstr
plan_updatePlanUpdate

Return type

Plan

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]

Released under the MIT License.