All URIs are relative to https://api.segmentapis.com
Method | HTTP request | Description |
---|---|---|
add_labels_to_source | POST /sources/{sourceId}/labels | Add Labels to Source |
create_source | POST /sources | Create Source |
create_write_key_for_source | POST /sources/{sourceId}/writekey | Create Write Key for Source |
delete_source | DELETE /sources/{sourceId} | Delete Source |
get_source | GET /sources/{sourceId} | Get Source |
list_connected_destinations_from_source | GET /sources/{sourceId}/connected-destinations | List Connected Destinations from Source |
list_connected_warehouses_from_source | GET /sources/{sourceId}/connected-warehouses | List Connected Warehouses from Source |
list_schema_settings_in_source | GET /sources/{sourceId}/settings | List Schema Settings in Source |
list_sources | GET /sources | List Sources |
remove_write_key_from_source | DELETE /sources/{sourceId}/writekey/{writeKey} | Remove Write Key from Source |
replace_labels_in_source | PUT /sources/{sourceId}/labels | Replace Labels in Source |
update_schema_settings_in_source | PATCH /sources/{sourceId}/settings | Update Schema Settings in Source |
update_source | PATCH /sources/{sourceId} | Update Source |
AddLabelsToSource200Response add_labels_to_source(source_id, add_labels_to_source_v1_input)
Add Labels to Source
Adds an existing label to a Source. • When called, this endpoint may generate the Source Modified
event in the audit trail.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.add_labels_to_source200_response import AddLabelsToSource200Response
from segment_public_api.models.add_labels_to_source_v1_input import AddLabelsToSourceV1Input
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'rh5BDZp6QDHvXFCkibm1pR' # str |
add_labels_to_source_v1_input = {"labels":[{"key":"type","value":"web"}]} # AddLabelsToSourceV1Input |
try:
# Add Labels to Source
api_response = api_instance.add_labels_to_source(source_id, add_labels_to_source_v1_input)
print("The response of SourcesApi->add_labels_to_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->add_labels_to_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
add_labels_to_source_v1_input | AddLabelsToSourceV1Input |
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateSource201Response create_source(create_source_v1_input)
Create Source
Creates a new Source. • When called, this endpoint may generate the Source Created
event in the audit trail.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.create_source201_response import CreateSource201Response
from segment_public_api.models.create_source_v1_input import CreateSourceV1Input
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
create_source_v1_input = {"slug":"my-test-source-2gwoon","enabled":true,"metadataId":"IqDTy1TpoU","settings":{}} # CreateSourceV1Input |
try:
# Create Source
api_response = api_instance.create_source(create_source_v1_input)
print("The response of SourcesApi->create_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->create_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
create_source_v1_input | CreateSourceV1Input |
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateWriteKeyForSource200Response create_write_key_for_source(source_id)
Create Write Key for Source
Creates a new Write Key for the Source. • When called, this endpoint may generate the Source Modified
event in the audit trail.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.create_write_key_for_source200_response import CreateWriteKeyForSource200Response
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'idR4zzU9iGcGJgoAX891nf' # str |
try:
# Create Write Key for Source
api_response = api_instance.create_write_key_for_source(source_id)
print("The response of SourcesApi->create_write_key_for_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->create_write_key_for_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str |
CreateWriteKeyForSource200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1alpha+json, application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteSource200Response delete_source(source_id)
Delete Source
Deletes an existing Source. • When called, this endpoint may generate the Source Deleted
event in the audit trail.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.delete_source200_response import DeleteSource200Response
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'rYxTjyaPtAELCjnFE5EYfM' # str |
try:
# Delete Source
api_response = api_instance.delete_source(source_id)
print("The response of SourcesApi->delete_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->delete_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str |
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetSource200Response get_source(source_id)
Get Source
Returns a Source by its id.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.get_source200_response import GetSource200Response
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'qQEHquLrjRDN9j1ByrChyn' # str |
try:
# Get Source
api_response = api_instance.get_source(source_id)
print("The response of SourcesApi->get_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->get_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str |
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListConnectedDestinationsFromSource200Response list_connected_destinations_from_source(source_id, pagination=pagination)
List Connected Destinations from Source
Returns a list of Destinations connected to a Source.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_connected_destinations_from_source200_response import ListConnectedDestinationsFromSource200Response
from segment_public_api.models.pagination_input import PaginationInput
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'qQEHquLrjRDN9j1ByrChyn' # str |
pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Required pagination params for the request. This parameter exists in alpha. (optional)
try:
# List Connected Destinations from Source
api_response = api_instance.list_connected_destinations_from_source(source_id, pagination=pagination)
print("The response of SourcesApi->list_connected_destinations_from_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->list_connected_destinations_from_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
pagination | PaginationInput | Required pagination params for the request. This parameter exists in alpha. | [optional] |
ListConnectedDestinationsFromSource200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListConnectedWarehousesFromSource200Response list_connected_warehouses_from_source(source_id, pagination=pagination)
List Connected Warehouses from Source
Returns a list of Warehouses connected to a Source.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_connected_warehouses_from_source200_response import ListConnectedWarehousesFromSource200Response
from segment_public_api.models.pagination_input import PaginationInput
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'qQEHquLrjRDN9j1ByrChyn' # str |
pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Required pagination params for the request. This parameter exists in alpha. (optional)
try:
# List Connected Warehouses from Source
api_response = api_instance.list_connected_warehouses_from_source(source_id, pagination=pagination)
print("The response of SourcesApi->list_connected_warehouses_from_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->list_connected_warehouses_from_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
pagination | PaginationInput | Required pagination params for the request. This parameter exists in alpha. | [optional] |
ListConnectedWarehousesFromSource200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSchemaSettingsInSource200Response list_schema_settings_in_source(source_id)
List Schema Settings in Source
Retrieves the schema configuration settings for a Source. If Protocols is not enabled for the Source, the configurations specific to Protocols will have default values.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_schema_settings_in_source200_response import ListSchemaSettingsInSource200Response
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'qQEHquLrjRDN9j1ByrChyn' # str |
try:
# List Schema Settings in Source
api_response = api_instance.list_schema_settings_in_source(source_id)
print("The response of SourcesApi->list_schema_settings_in_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->list_schema_settings_in_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str |
ListSchemaSettingsInSource200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListSources200Response list_sources(pagination=pagination)
List Sources
Returns a list of Sources.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_sources200_response import ListSources200Response
from segment_public_api.models.pagination_input import PaginationInput
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Defines the pagination parameters. This parameter exists in alpha. (optional)
try:
# List Sources
api_response = api_instance.list_sources(pagination=pagination)
print("The response of SourcesApi->list_sources:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->list_sources: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
pagination | PaginationInput | Defines the pagination parameters. This parameter exists in alpha. | [optional] |
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveWriteKeyFromSource200Response remove_write_key_from_source(source_id, write_key)
Remove Write Key from Source
Removes a Write Key from a Source. • When called, this endpoint may generate the Source Modified
event in the audit trail.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.remove_write_key_from_source200_response import RemoveWriteKeyFromSource200Response
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'idR4zzU9iGcGJgoAX891nf' # str |
write_key = 'wk123' # str |
try:
# Remove Write Key from Source
api_response = api_instance.remove_write_key_from_source(source_id, write_key)
print("The response of SourcesApi->remove_write_key_from_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->remove_write_key_from_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
write_key | str |
RemoveWriteKeyFromSource200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1alpha+json, application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReplaceLabelsInSource200Response replace_labels_in_source(source_id, replace_labels_in_source_v1_input)
Replace Labels in Source
Replaces all labels in a Source.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.replace_labels_in_source200_response import ReplaceLabelsInSource200Response
from segment_public_api.models.replace_labels_in_source_v1_input import ReplaceLabelsInSourceV1Input
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'rh5BDZp6QDHvXFCkibm1pR' # str |
replace_labels_in_source_v1_input = {"labels":[{"key":"environment","value":"prod"}]} # ReplaceLabelsInSourceV1Input |
try:
# Replace Labels in Source
api_response = api_instance.replace_labels_in_source(source_id, replace_labels_in_source_v1_input)
print("The response of SourcesApi->replace_labels_in_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->replace_labels_in_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
replace_labels_in_source_v1_input | ReplaceLabelsInSourceV1Input |
ReplaceLabelsInSource200Response
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateSchemaSettingsInSource200Response update_schema_settings_in_source(source_id, update_schema_settings_in_source_v1_input)
Update Schema Settings in Source
Updates the schema configuration for a Source. If Protocols is not enabled for the Source, any updates to Protocols-specific configurations will not be applied. Config API omitted fields: - updateMask
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.update_schema_settings_in_source200_response import UpdateSchemaSettingsInSource200Response
from segment_public_api.models.update_schema_settings_in_source_v1_input import UpdateSchemaSettingsInSourceV1Input
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = 'qQEHquLrjRDN9j1ByrChyn' # str |
update_schema_settings_in_source_v1_input = {"group":{"allowTraitsOnViolations":false,"allowUnplannedTraits":false,"commonEventOnViolations":"ALLOW"},"identify":{"allowTraitsOnViolations":true,"allowUnplannedTraits":true,"commonEventOnViolations":"BLOCK"},"track":{"allowEventOnViolations":false,"allowPropertiesOnViolations":false,"allowUnplannedEventProperties":false,"allowUnplannedEvents":false,"commonEventOnViolations":"OMIT_PROPERTIES"},"forwardingViolationsTo":"rh5BDZp6QDHvXFCkibm1pR","forwardingBlockedEventsTo":"rh5BDZp6QDHvXFCkibm1pR"} # UpdateSchemaSettingsInSourceV1Input |
try:
# Update Schema Settings in Source
api_response = api_instance.update_schema_settings_in_source(source_id, update_schema_settings_in_source_v1_input)
print("The response of SourcesApi->update_schema_settings_in_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->update_schema_settings_in_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
update_schema_settings_in_source_v1_input | UpdateSchemaSettingsInSourceV1Input |
UpdateSchemaSettingsInSource200Response
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateSource200Response update_source(source_id, update_source_v1_input)
Update Source
Updates an existing Source. • When called, this endpoint may generate one or more of the following audit trail events:* Source Modified * Source Enabled * Source Settings Modified * Source Disabled Config API omitted fields: - updateMask
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.update_source200_response import UpdateSource200Response
from segment_public_api.models.update_source_v1_input import UpdateSourceV1Input
from segment_public_api.rest import ApiException
from pprint import pprint
# Configure Bearer authorization: token
configuration = segment_public_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with segment_public_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = segment_public_api.SourcesApi(api_client)
source_id = '44LMHs8Wf5vidxba4kN52J' # str |
update_source_v1_input = {"name":"My updated source","enabled":false} # UpdateSourceV1Input |
try:
# Update Source
api_response = api_instance.update_source(source_id, update_source_v1_input)
print("The response of SourcesApi->update_source:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling SourcesApi->update_source: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
source_id | str | ||
update_source_v1_input | UpdateSourceV1Input |
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Resource not found | - |
422 | Validation failure | - |
429 | Too many requests | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]