# \WebhooksApi

All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_webhook**](WebhooksApi.md#create_webhook) | **POST** /api/v1/webhooks | Create webhook.
[**delete_webhook**](WebhooksApi.md#delete_webhook) | **DELETE** /api/v1/webhooks/{id} | Delete webhook
[**disable_webhook**](WebhooksApi.md#disable_webhook) | **POST** /api/v1/webhooks/{id}/disable | Disable webhook
[**enable_webhook**](WebhooksApi.md#enable_webhook) | **POST** /api/v1/webhooks/{id}/enable | Enable webhook
[**get_webhook**](WebhooksApi.md#get_webhook) | **GET** /api/v1/webhooks/{id} | Get webhook by ID
[**list_deliveries**](WebhooksApi.md#list_deliveries) | **GET** /api/v1/webhooks/{id}/deliveries | List webhook deliveries
[**list_webhooks**](WebhooksApi.md#list_webhooks) | **GET** /api/v1/webhooks | List webhooks
[**redeliver**](WebhooksApi.md#redeliver) | **POST** /api/v1/webhooks/{id}/deliveries/{delivery_id}/redeliver | Redeliver a failed webhook
[**rotate_webhook_secret**](WebhooksApi.md#rotate_webhook_secret) | **POST** /api/v1/webhooks/{id}/rotate-secret | Rotate the signing secret for a webhook.
[**test_webhook**](WebhooksApi.md#test_webhook) | **POST** /api/v1/webhooks/{id}/test | Test webhook by sending a test payload



## create_webhook

> models::WebhookSecretCreatedResponse create_webhook(create_webhook_request)
Create webhook.

Generates a fresh signing secret (or accepts a caller-supplied one), encrypts it at rest, and returns the raw secret in the response body **once**. After this call, GET on the webhook returns only `secret_digest`, never the raw secret.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**create_webhook_request** | [**CreateWebhookRequest**](CreateWebhookRequest.md) |  | [required] |

### Return type

[**models::WebhookSecretCreatedResponse**](WebhookSecretCreatedResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## delete_webhook

> delete_webhook(id)
Delete webhook

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## disable_webhook

> disable_webhook(id)
Disable webhook

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## enable_webhook

> enable_webhook(id)
Enable webhook

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## get_webhook

> models::WebhookResponse get_webhook(id)
Get webhook by ID

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |

### Return type

[**models::WebhookResponse**](WebhookResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## list_deliveries

> models::DeliveryListResponse list_deliveries(id, status, page, per_page)
List webhook deliveries

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |
**status** | Option<**String**> |  |  |
**page** | Option<**i32**> |  |  |
**per_page** | Option<**i32**> |  |  |

### Return type

[**models::DeliveryListResponse**](DeliveryListResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## list_webhooks

> models::WebhookListResponse list_webhooks(repository_id, enabled, page, per_page)
List webhooks

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**repository_id** | Option<**uuid::Uuid**> |  |  |
**enabled** | Option<**bool**> |  |  |
**page** | Option<**i32**> |  |  |
**per_page** | Option<**i32**> |  |  |

### Return type

[**models::WebhookListResponse**](WebhookListResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## redeliver

> models::DeliveryResponse redeliver(id, delivery_id)
Redeliver a failed webhook

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |
**delivery_id** | **uuid::Uuid** | Delivery ID | [required] |

### Return type

[**models::DeliveryResponse**](DeliveryResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## rotate_webhook_secret

> models::RotateWebhookSecretResponse rotate_webhook_secret(id)
Rotate the signing secret for a webhook.

Generates a new raw secret, encrypts it, moves the existing `secret_encrypted` into `secret_previous_encrypted`, and stamps an expiry 24 hours in the future. The new raw secret is returned in the response body **once**. The HMAC signing path (added in a later ticket) signs deliveries with both secrets while the previous one is within its expiry window so consumers can rotate without dropped events.  If a previous-secret window is still active when the rotate request arrives, the request is REJECTED with HTTP 409 Conflict. This prevents two near-simultaneous rotations from clobbering the original `secret_previous_encrypted` material before the operator has finished distributing the previous new key. The 409 body is structured: `{\"error\": \"rotation_already_in_progress\", \"expires_at\": \"<RFC3339>\"}`.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |

### Return type

[**models::RotateWebhookSecretResponse**](RotateWebhookSecretResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)


## test_webhook

> models::TestWebhookResponse test_webhook(id)
Test webhook by sending a test payload

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**id** | **uuid::Uuid** | Webhook ID | [required] |

### Return type

[**models::TestWebhookResponse**](TestWebhookResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

