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 time
import launchdarkly_api
from launchdarkly_api.api import webhooks_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
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'] = 'YOUR_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 = webhooks_api.WebhooksApi(api_client)
id = "id_example" # str | The ID of the webhook to delete
# example passing only required values which don't have defaults set
try:
# Delete webhook
api_instance.delete_webhook(id)
except launchdarkly_api.ApiException 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 time
import launchdarkly_api
from launchdarkly_api.api import webhooks_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.webhooks import Webhooks
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'] = 'YOUR_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 = webhooks_api.WebhooksApi(api_client)
# example, this endpoint has no required or optional parameters
try:
# List webhooks
api_response = api_instance.get_all_webhooks()
pprint(api_response)
except launchdarkly_api.ApiException 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 time
import launchdarkly_api
from launchdarkly_api.api import webhooks_api
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.webhook import Webhook
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'] = 'YOUR_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 = webhooks_api.WebhooksApi(api_client)
id = "id_example" # str | The ID of the webhook
# example passing only required values which don't have defaults set
try:
# Get webhook
api_response = api_instance.get_webhook(id)
pprint(api_response)
except launchdarkly_api.ApiException 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, json_patch)
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 time
import launchdarkly_api
from launchdarkly_api.api import webhooks_api
from launchdarkly_api.model.json_patch import JSONPatch
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.not_found_error_rep import NotFoundErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.webhook import Webhook
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'] = 'YOUR_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 = webhooks_api.WebhooksApi(api_client)
id = "id_example" # str | The ID of the webhook to update
json_patch = JSONPatch([
PatchOperation(
op="replace",
path="/exampleField",
value=None,
),
]) # JSONPatch |
# example passing only required values which don't have defaults set
try:
# Update webhook
api_response = api_instance.patch_webhook(id, json_patch)
pprint(api_response)
except launchdarkly_api.ApiException 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 | |
json_patch | JSONPatch |
- 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 time
import launchdarkly_api
from launchdarkly_api.api import webhooks_api
from launchdarkly_api.model.webhook_post import WebhookPost
from launchdarkly_api.model.invalid_request_error_rep import InvalidRequestErrorRep
from launchdarkly_api.model.forbidden_error_rep import ForbiddenErrorRep
from launchdarkly_api.model.rate_limited_error_rep import RateLimitedErrorRep
from launchdarkly_api.model.unauthorized_error_rep import UnauthorizedErrorRep
from launchdarkly_api.model.webhook import Webhook
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'] = 'YOUR_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 = webhooks_api.WebhooksApi(api_client)
webhook_post = WebhookPost(
name="Example hook",
url="http://www.example.com",
secret="frobozz",
statements=StatementPostList([
StatementPost(
resources=["proj/*:env/*:flag/*;testing-tag"],
not_resources=[
"not_resources_example",
],
actions=["*"],
not_actions=[
"not_actions_example",
],
effect="allow",
),
]),
sign=True,
on=True,
tags=[],
) # WebhookPost |
# example passing only required values which don't have defaults set
try:
# Creates a webhook
api_response = api_instance.post_webhook(webhook_post)
pprint(api_response)
except launchdarkly_api.ApiException 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]