All URIs are relative to https://app.launchdarkly.com
Method | HTTP request | Description |
---|---|---|
deleteWebhook | DELETE /api/v2/webhooks/{id} | Delete webhook |
getAllWebhooks | GET /api/v2/webhooks | List webhooks |
getWebhook | GET /api/v2/webhooks/{id} | Get webhook |
patchWebhook | PATCH /api/v2/webhooks/{id} | Update webhook |
postWebhook | POST /api/v2/webhooks | Creates a webhook |
deleteWebhook(id)
Delete webhook
Delete a webhook by ID.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.WebhooksApi();
let id = "id_example"; // String | The ID of the webhook to delete
apiInstance.deleteWebhook(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the webhook to delete |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Webhooks getAllWebhooks()
List webhooks
Fetch a list of all webhooks.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.WebhooksApi();
apiInstance.getAllWebhooks((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Webhook getWebhook(id)
Get webhook
Get a single webhook by ID.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.WebhooksApi();
let id = "id_example"; // String | The ID of the webhook
apiInstance.getWebhook(id, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the webhook |
- Content-Type: Not defined
- Accept: application/json
Webhook patchWebhook(id, patchOperation)
Update webhook
Update a webhook's settings. Updating webhook settings uses a JSON patch representation of the desired changes. To learn more, read Updates.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.WebhooksApi();
let id = "id_example"; // String | The ID of the webhook to update
let patchOperation = [{"op":"replace","path":"/on","value":false}]; // [PatchOperation] |
apiInstance.patchWebhook(id, patchOperation, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
id | String | The ID of the webhook to update | |
patchOperation | [PatchOperation] |
- Content-Type: application/json
- Accept: application/json
Webhook postWebhook(webhookPost)
Creates a webhook
Create a new webhook.
import LaunchDarklyApi from 'launchdarkly-api';
let defaultClient = LaunchDarklyApi.ApiClient.instance;
// Configure API key authorization: ApiKey
let ApiKey = defaultClient.authentications['ApiKey'];
ApiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKey.apiKeyPrefix = 'Token';
let apiInstance = new LaunchDarklyApi.WebhooksApi();
let webhookPost = {"name":"apidocs test webhook","on":true,"sign":false,"statements":[{"actions":["*"],"effect":"allow","resources":["proj/test"]}],"tags":["example-tag"],"url":"https://example.com"}; // WebhookPost |
apiInstance.postWebhook(webhookPost, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
Name | Type | Description | Notes |
---|---|---|---|
webhookPost | WebhookPost |
- Content-Type: application/json
- Accept: application/json