Skip to content

Audiences API

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

MethodHTTP requestDescription
create_audiencePOST /audiencesCreate Audience
delete_audienceDELETE /audiences/Delete Audience
edit_audiencePATCH /audiences/Edit Audience
extend_audiencePOST /audiences/{audience_id}/extendExtend Audience
generate_audiencePOST /audiences/{audience_id}/generateGenerate Audience
get_audienceGET /audiences/Get Audience
list_audiencesGET /audiencesList Audiences

create_audience

Audience create_audience(audience_create)

Create Audience

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience import Audience
from syntheticusers.models.audience_create import AudienceCreate
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.AudiencesApi(api_client)
    audience_create = syntheticusers.AudienceCreate() # AudienceCreate | 

    try:
        # Create Audience
        api_response = api_instance.create_audience(audience_create)
        print("The response of AudiencesApi->create_audience:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AudiencesApi->create_audience: %s\n" % e)

Parameters

NameTypeDescriptionNotes
audience_createAudienceCreate

Return type

Audience

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_audience

object delete_audience(audience_id)

Delete Audience

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.AudiencesApi(api_client)
    audience_id = 'audience_id_example' # str | 

    try:
        # Delete Audience
        api_response = api_instance.delete_audience(audience_id)
        print("The response of AudiencesApi->delete_audience:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AudiencesApi->delete_audience: %s\n" % e)

Parameters

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

edit_audience

Audience edit_audience(audience_id, audience_update)

Edit Audience

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience import Audience
from syntheticusers.models.audience_update import AudienceUpdate
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.AudiencesApi(api_client)
    audience_id = 'audience_id_example' # str | 
    audience_update = syntheticusers.AudienceUpdate() # AudienceUpdate | 

    try:
        # Edit Audience
        api_response = api_instance.edit_audience(audience_id, audience_update)
        print("The response of AudiencesApi->edit_audience:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AudiencesApi->edit_audience: %s\n" % e)

Parameters

NameTypeDescriptionNotes
audience_idstr
audience_updateAudienceUpdate

Return type

Audience

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]

extend_audience

object extend_audience(audience_id, audience_extend)

Extend Audience

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience_extend import AudienceExtend
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.AudiencesApi(api_client)
    audience_id = 'audience_id_example' # str | 
    audience_extend = syntheticusers.AudienceExtend() # AudienceExtend | 

    try:
        # Extend Audience
        api_response = api_instance.extend_audience(audience_id, audience_extend)
        print("The response of AudiencesApi->extend_audience:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AudiencesApi->extend_audience: %s\n" % e)

Parameters

NameTypeDescriptionNotes
audience_idstr
audience_extendAudienceExtend

Return type

object

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]

generate_audience

List[str] generate_audience(audience_id, audience_generate)

Generate Audience

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience_generate import AudienceGenerate
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.AudiencesApi(api_client)
    audience_id = 'audience_id_example' # str | 
    audience_generate = syntheticusers.AudienceGenerate() # AudienceGenerate | 

    try:
        # Generate Audience
        api_response = api_instance.generate_audience(audience_id, audience_generate)
        print("The response of AudiencesApi->generate_audience:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AudiencesApi->generate_audience: %s\n" % e)

Parameters

NameTypeDescriptionNotes
audience_idstr
audience_generateAudienceGenerate

Return type

List[str]

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]

get_audience

Audience get_audience(audience_id)

Get Audience

Example

  • Bearer Authentication (HTTPBearer):
python
import syntheticusers
from syntheticusers.models.audience import Audience
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.AudiencesApi(api_client)
    audience_id = 'audience_id_example' # str | 

    try:
        # Get Audience
        api_response = api_instance.get_audience(audience_id)
        print("The response of AudiencesApi->get_audience:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AudiencesApi->get_audience: %s\n" % e)

Parameters

NameTypeDescriptionNotes
audience_idstr

Return type

Audience

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_audiences

PageAudience list_audiences(id=id, project_id=project_id, page=page, size=size)

List Audiences

Example

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

Parameters

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

Return type

PageAudience

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.