All URIs are relative to https://app.launchdarkly.com
| Method | HTTP request | Description |
|---|---|---|
| delete_webhook | DELETE /api/v2/webhooks/{id} | Delete webhook |
| get_all_webhooks | GET /api/v2/webhooks | List webhooks |
| get_webhook | GET /api/v2/webhooks/{id} | Get webhook |
| patch_webhook | PATCH /api/v2/webhooks/{id} | Update webhook |
| post_webhook | POST /api/v2/webhooks | Creates a webhook |
delete_webhook(id)
Delete webhook
Delete a webhook by ID.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# 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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.WebhooksApi(api_client)
id = 'id_example' # str | The ID of the webhook to delete
try:
# Delete webhook
api_instance.delete_webhook(id)
except Exception as e:
print("Exception when calling WebhooksApi->delete_webhook: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the webhook to delete |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 204 | Action succeeded | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Webhooks get_all_webhooks()
List webhooks
Fetch a list of all webhooks.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.webhooks import Webhooks
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# 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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.WebhooksApi(api_client)
try:
# List webhooks
api_response = api_instance.get_all_webhooks()
print("The response of WebhooksApi->get_all_webhooks:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling WebhooksApi->get_all_webhooks: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Webhooks response | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Webhook get_webhook(id)
Get webhook
Get a single webhook by ID.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.webhook import Webhook
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# 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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.WebhooksApi(api_client)
id = 'id_example' # str | The ID of the webhook
try:
# Get webhook
api_response = api_instance.get_webhook(id)
print("The response of WebhooksApi->get_webhook:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling WebhooksApi->get_webhook: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the webhook |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Webhook response | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Webhook patch_webhook(id, patch_operation)
Update webhook
Update a webhook's settings. Updating webhook settings uses a JSON patch representation of the desired changes. To learn more, read Updates.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.patch_operation import PatchOperation
from launchdarkly_api.models.webhook import Webhook
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# 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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.WebhooksApi(api_client)
id = 'id_example' # str | The ID of the webhook to update
patch_operation = [{"op":"replace","path":"/on","value":false}] # List[PatchOperation] |
try:
# Update webhook
api_response = api_instance.patch_webhook(id, patch_operation)
print("The response of WebhooksApi->patch_webhook:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling WebhooksApi->patch_webhook: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| id | str | The ID of the webhook to update | |
| patch_operation | List[PatchOperation] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Webhook response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 404 | Invalid resource identifier | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Webhook post_webhook(webhook_post)
Creates a webhook
Create a new webhook.
- Api Key Authentication (ApiKey):
import launchdarkly_api
from launchdarkly_api.models.webhook import Webhook
from launchdarkly_api.models.webhook_post import WebhookPost
from launchdarkly_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://app.launchdarkly.com
# See configuration.py for a list of all supported configuration parameters.
configuration = launchdarkly_api.Configuration(
host = "https://app.launchdarkly.com"
)
# 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 API key authorization: ApiKey
configuration.api_key['ApiKey'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKey'] = 'Bearer'
# Enter a context with an instance of the API client
with launchdarkly_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = launchdarkly_api.WebhooksApi(api_client)
webhook_post = {"name":"apidocs test webhook","on":true,"sign":false,"statements":[{"actions":["*"],"effect":"allow","resources":["proj/test"]}],"tags":["example-tag"],"url":"https://example.com"} # WebhookPost |
try:
# Creates a webhook
api_response = api_instance.post_webhook(webhook_post)
print("The response of WebhooksApi->post_webhook:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling WebhooksApi->post_webhook: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| webhook_post | WebhookPost |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Webhook response | - |
| 400 | Invalid request | - |
| 401 | Invalid access token | - |
| 403 | Forbidden | - |
| 429 | Rate limited | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]