All URIs are relative to https://api.segmentapis.com
Method | HTTP request | Description |
---|---|---|
create_destination | POST /destinations | Create Destination |
create_destination_subscription | POST /destinations/{destinationId}/subscriptions | Create Destination Subscription |
delete_destination | DELETE /destinations/{destinationId} | Delete Destination |
get_destination | GET /destinations/{destinationId} | Get Destination |
get_subscription_from_destination | GET /destinations/{destinationId}/subscriptions/{id} | Get Subscription from Destination |
list_delivery_metrics_summary_from_destination | GET /destinations/{destinationId}/delivery-metrics | List Delivery Metrics Summary from Destination |
list_destinations | GET /destinations | List Destinations |
list_subscriptions_from_destination | GET /destinations/{destinationId}/subscriptions | List Subscriptions from Destination |
remove_subscription_from_destination | DELETE /destinations/{destinationId}/subscriptions/{id} | Remove Subscription from Destination |
update_destination | PATCH /destinations/{destinationId} | Update Destination |
update_subscription_for_destination | PATCH /destinations/{destinationId}/subscriptions/{id} | Update Subscription for Destination |
CreateDestination200Response create_destination(create_destination_v1_input)
Create Destination
Creates a new Destination. • When called, this endpoint may generate the Integration Created
event in the audit trail.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.create_destination200_response import CreateDestination200Response
from segment_public_api.models.create_destination_v1_input import CreateDestinationV1Input
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.DestinationsApi(api_client)
create_destination_v1_input = {"sourceId":"rh5BDZp6QDHvXFCkibm1pR","metadataId":"54521fd525e721e32a72ee91","name":"my destination v1","settings":{"apiKey":"3cb9b589437d3904f19b2b791c2cdada","retarget":true}} # CreateDestinationV1Input |
try:
# Create Destination
api_response = api_instance.create_destination(create_destination_v1_input)
print("The response of DestinationsApi->create_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->create_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
create_destination_v1_input | CreateDestinationV1Input |
- 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]
CreateDestinationSubscription200Response create_destination_subscription(destination_id, create_destination_subscription_alpha_input)
Create Destination Subscription
Creates a new Destination subscription. • This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.create_destination_subscription200_response import CreateDestinationSubscription200Response
from segment_public_api.models.create_destination_subscription_alpha_input import CreateDestinationSubscriptionAlphaInput
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.DestinationsApi(api_client)
destination_id = 'fP7qoQw2HTWt9WdMr718gn' # str |
create_destination_subscription_alpha_input = {"name":"Example Subscription","actionId":"jiMz7MfHNeHmUckzRnUGkU","trigger":"type = \"track\"","enabled":false} # CreateDestinationSubscriptionAlphaInput |
try:
# Create Destination Subscription
api_response = api_instance.create_destination_subscription(destination_id, create_destination_subscription_alpha_input)
print("The response of DestinationsApi->create_destination_subscription:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->create_destination_subscription: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
create_destination_subscription_alpha_input | CreateDestinationSubscriptionAlphaInput |
CreateDestinationSubscription200Response
- Content-Type: application/vnd.segment.v1alpha+json
- 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]
DeleteDestination200Response delete_destination(destination_id)
Delete Destination
Deletes an existing Destination. • When called, this endpoint may generate the Integration Deleted
event in the audit trail. Config API omitted fields: - catalogId
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.delete_destination200_response import DeleteDestination200Response
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.DestinationsApi(api_client)
destination_id = '65c2bdbede6f2d8297f943db' # str |
try:
# Delete Destination
api_response = api_instance.delete_destination(destination_id)
print("The response of DestinationsApi->delete_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->delete_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_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]
GetDestination200Response get_destination(destination_id)
Get Destination
Returns a Destination by its id. Config API omitted fields: - catalogId
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.get_destination200_response import GetDestination200Response
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.DestinationsApi(api_client)
destination_id = 'qtiZHLLqqsHmpvLXNtP5du' # str |
try:
# Get Destination
api_response = api_instance.get_destination(destination_id)
print("The response of DestinationsApi->get_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->get_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_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]
GetSubscriptionFromDestination200Response get_subscription_from_destination(destination_id, id)
Get Subscription from Destination
Gets a Destination subscription by id. • This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.get_subscription_from_destination200_response import GetSubscriptionFromDestination200Response
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.DestinationsApi(api_client)
destination_id = 'fP7qoQw2HTWt9WdMr718gn' # str |
id = 'kyMKN6LUgMvF8dwRMEz3cX' # str |
try:
# Get Subscription from Destination
api_response = api_instance.get_subscription_from_destination(destination_id, id)
print("The response of DestinationsApi->get_subscription_from_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->get_subscription_from_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
id | str |
GetSubscriptionFromDestination200Response
- 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]
ListDeliveryMetricsSummaryFromDestination200Response list_delivery_metrics_summary_from_destination(destination_id, source_id, start_time=start_time, end_time=end_time, granularity=granularity)
List Delivery Metrics Summary from Destination
Get an event delivery metrics summary from a Destination. Based on the granularity chosen, there are restrictions on the time range you can query: Minute: - Max time range: 4 hours - Oldest possible start time: 48 hours in the past Hour: - Max Time range: 7 days - Oldest possible start time: 7 days in the past Day: - Max time range: 14 days - Oldest possible start time: 14 days in the past
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_delivery_metrics_summary_from_destination200_response import ListDeliveryMetricsSummaryFromDestination200Response
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.DestinationsApi(api_client)
destination_id = 'fP7qoQw2HTWt9WdMr718gn' # str |
source_id = 'rh5BDZp6QDHvXFCkibm1pR' # str | The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in beta.
start_time = '2006-01-02T15:04:05.000Z' # str | Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in beta. (optional)
end_time = '2006-01-02T15:04:05.000Z' # str | Filter events that happened before this time. Defaults to now if not set. This parameter exists in beta. (optional)
granularity = 'DAY' # str | The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in beta. (optional)
try:
# List Delivery Metrics Summary from Destination
api_response = api_instance.list_delivery_metrics_summary_from_destination(destination_id, source_id, start_time=start_time, end_time=end_time, granularity=granularity)
print("The response of DestinationsApi->list_delivery_metrics_summary_from_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->list_delivery_metrics_summary_from_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
source_id | str | The id of the Source linked to the Destination. Config API note: analogous to `parent`. This parameter exists in beta. | |
start_time | str | Filter events that happened after this time. Defaults to: - 1 hour ago if granularity is `MINUTE`. - 7 days ago if granularity is `HOUR`. - 30 days ago if granularity is `DAY`. This parameter exists in beta. | [optional] |
end_time | str | Filter events that happened before this time. Defaults to now if not set. This parameter exists in beta. | [optional] |
granularity | str | The granularity to filter metrics to. Either `MINUTE`, `HOUR` or `DAY`. Defaults to `MINUTE` if not set. This parameter exists in beta. | [optional] |
ListDeliveryMetricsSummaryFromDestination200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1beta+json, 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]
ListDestinations200Response list_destinations(pagination=pagination)
List Destinations
Returns a list of Destinations.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_destinations200_response import ListDestinations200Response
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.DestinationsApi(api_client)
pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Required pagination params for the request. This parameter exists in v1. (optional)
try:
# List Destinations
api_response = api_instance.list_destinations(pagination=pagination)
print("The response of DestinationsApi->list_destinations:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->list_destinations: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
pagination | PaginationInput | Required pagination params for the request. This parameter exists in v1. | [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]
ListSubscriptionsFromDestination200Response list_subscriptions_from_destination(destination_id, pagination=pagination)
List Subscriptions from Destination
Lists subscriptions for a Destination. • This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.list_subscriptions_from_destination200_response import ListSubscriptionsFromDestination200Response
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.DestinationsApi(api_client)
destination_id = 'fP7qoQw2HTWt9WdMr718gn' # str |
pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | Pagination options. This parameter exists in alpha. (optional)
try:
# List Subscriptions from Destination
api_response = api_instance.list_subscriptions_from_destination(destination_id, pagination=pagination)
print("The response of DestinationsApi->list_subscriptions_from_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->list_subscriptions_from_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
pagination | PaginationInput | Pagination options. This parameter exists in alpha. | [optional] |
ListSubscriptionsFromDestination200Response
- 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]
RemoveSubscriptionFromDestination200Response remove_subscription_from_destination(destination_id, id)
Remove Subscription from Destination
Deletes an existing Destination subscription. • This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.remove_subscription_from_destination200_response import RemoveSubscriptionFromDestination200Response
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.DestinationsApi(api_client)
destination_id = 'fP7qoQw2HTWt9WdMr718gn' # str |
id = 'zXCqmEMHJojkD45GcBAPt' # str |
try:
# Remove Subscription from Destination
api_response = api_instance.remove_subscription_from_destination(destination_id, id)
print("The response of DestinationsApi->remove_subscription_from_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->remove_subscription_from_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
id | str |
RemoveSubscriptionFromDestination200Response
- 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]
UpdateDestination200Response update_destination(destination_id, update_destination_v1_input)
Update Destination
Updates an existing Destination. Note: if you attempt to update read-only settings for your destination you'll encounter the following behavior: * If only read-only properties are being updated, the endpoint will return an HTTP 400 error. * If there's a mix of writable and read-only properties in the payload, the request will be accepted, the writable properties will be updated and the read-only properties ignored. • When called, this endpoint may generate the Integration Disabled
event in the audit trail. Config API omitted fields: - updateMask
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.update_destination200_response import UpdateDestination200Response
from segment_public_api.models.update_destination_v1_input import UpdateDestinationV1Input
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.DestinationsApi(api_client)
destination_id = 'qtiZHLLqqsHmpvLXNtP5du' # str |
update_destination_v1_input = {"enabled":false} # UpdateDestinationV1Input |
try:
# Update Destination
api_response = api_instance.update_destination(destination_id, update_destination_v1_input)
print("The response of DestinationsApi->update_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->update_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
update_destination_v1_input | UpdateDestinationV1Input |
- 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]
UpdateSubscriptionForDestination200Response update_subscription_for_destination(destination_id, id, update_subscription_for_destination_alpha_input)
Update Subscription for Destination
Updates an existing Destination subscription. • This endpoint is in Alpha testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Destination Subscriptions feature enabled. Please reach out to your customer success manager for more information. The rate limit for this endpoint is 5 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See Rate Limiting for more information.
- Bearer Authentication (token):
import time
import os
import segment_public_api
from segment_public_api.models.update_subscription_for_destination200_response import UpdateSubscriptionForDestination200Response
from segment_public_api.models.update_subscription_for_destination_alpha_input import UpdateSubscriptionForDestinationAlphaInput
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.DestinationsApi(api_client)
destination_id = 'qtiZHLLqqsHmpvLXNtP5du' # str |
id = 'pJtn52LjrcD1TrQcm2ZSwp' # str |
update_subscription_for_destination_alpha_input = {"input":{"name":"Updated name"}} # UpdateSubscriptionForDestinationAlphaInput |
try:
# Update Subscription for Destination
api_response = api_instance.update_subscription_for_destination(destination_id, id, update_subscription_for_destination_alpha_input)
print("The response of DestinationsApi->update_subscription_for_destination:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling DestinationsApi->update_subscription_for_destination: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
destination_id | str | ||
id | str | ||
update_subscription_for_destination_alpha_input | UpdateSubscriptionForDestinationAlphaInput |
UpdateSubscriptionForDestination200Response
- Content-Type: application/vnd.segment.v1alpha+json
- 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]