Skip to content

Commit

Permalink
Added example payload for API endpoint for creating webhooks
Browse files Browse the repository at this point in the history
  • Loading branch information
anero committed Jun 6, 2024
1 parent 20fda7b commit f2d4506
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions source/includes/authenticated_api/_webhook_endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Webhooks can be used by software engineers to integrate ControlShift with third-party systems. They allow engineers to build software that is triggered by events that take place within ControlShift. This authenticated endpoint provides information about webhook endpoints and allows for the creation of new ones.

This is useful for customers who would like to build automated reporting to detect when webhooks have been disabled or are setup incorrectly.
This is useful for customers who would like to build automated reporting to detect when webhooks have been disabled or are setup incorrectly.

### List Webhook Endpoints

Expand Down Expand Up @@ -35,28 +35,43 @@ Show information about all of the webhook endpoints configured for organisation.
]
```

### Create Webhook Endpoint

Creates a new webhook endpoint that will receive webhooks from the platform.
<div></div>

`POST /api/v1/webhook_endpoints`
### Create Webhook Endpoint
> POST /api/v1/webhook_endpoints
The request body should be a JSON block containing one `"endpoint"` object, which can have the following properties:
```json
{
"endpoint": {
"url": "https://example.com/test1",
"basic_auth_username": "my_secret_user",
"basic_auth_password": "passw0rd",
"aws_account_id": "355687156842"
}
}
```

Field | Type | Description | Required?
------|--------|--------------------------------------------------------------|----------
url | string | URL webhook will be POSTed to. | yes
basic_auth_username | string | Optional. HTTP Basic Auth credential to use with your endpoint | no
basic_auth_password | string | | no
aws_account_id | string | Optional. Advanced feature. See Bulk Data API docs | no
> Response body
Successful response
```json
{
"status": "success",
"endpoint": {
"url": "https://example.com",
"url": "https://example.com/test1",
"signing_secret": "abc122"
}
}
```

Creates a new webhook endpoint that will receive webhooks from the platform.

`POST /api/v1/webhook_endpoints`

The request body should be a JSON block containing one `"endpoint"` object, which can have the following properties:

Field | Type | Description | Required?
--------------------|--------|----------------------------------------------------------------|----------
url | string | URL webhook will be POSTed to. | yes
basic_auth_username | string | Optional. HTTP Basic Auth credential to use with your endpoint | no
basic_auth_password | string | | no
aws_account_id | string | Optional. Advanced feature. See Bulk Data API docs | no

0 comments on commit f2d4506

Please sign in to comment.