> For the complete documentation index, see [llms.txt](https://apidocs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apidocs.akinon.com/oms/webhook-setup-services.md).

# Webhook Setup Services

All services related to webhook setup are listed in this document.

### `POST` Execute

This endpoint is used to add unregistered webhooks from the settings to the Omnitron client. Specifically, it checks the webhooks listed in the OMNITRON\_WEBHOOKS setting, and any webhooks found in the settings but not already registered with the Omnitron client will be added to the client.

**Path:** `/api/v1/oms/setup/webhooks/execute/`

**Request Body**

The following query parameters can be used to execute the setup.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To execute this setup step, a `POST` request should be sent to\
the `/api/v1/oms/setup/webhooks/execute/` endpoint. In the headers, set\
the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/setup/webhooks/execute/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers)

print(response.status_code)
```

**Response 204 No Content**

There is No Response.

### `GET` Get Async Status

This endpoint provides the status of the task executed by the "execute" endpoint. If there is no active task, the result will be returned as "READY."

**Path:** `/api/v1/oms/setup/webhooks/get_async_status/`

**Request Body**

The following query parameters can be used view the status of the setup task.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To view the status of the task, a `GET` request should be sent to\
the `/api/v1/oms/setup/webhooks/get_async_status/` endpoint. In the headers, set\
the `Authorization` header to include the token for authentication.

Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/setup/webhooks/get_async_status/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers)

print(response.json())
```

**Response 200 OK**

Possible values of result are:

* READY
* WORKING
* FINISHED
* FAILED
* ABORTED

| Parameter | Data Type | Description            |
| --------- | --------- | ---------------------- |
| result    | string    | The status of the task |

This example response serves as a reference to understand the structure and\
data format returned from this API service.

```json
{
  "result": "Ready"
}
```

### `GET` Is Required

This endpoint indicates whether the "execute" endpoint should be called or not. It evaluates whether there are any webhooks listed in the settings that are not registered within the Omnitron client. If there are unregistered webhooks in the settings, the result is returned as true.

**Path:** `/api/v1/oms/setup/webhooks/is_required/`

**Request Body**

The following query parameters can be used to execute the setup.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To execute this setup step, a `POST` request should be sent to\
the `/api/v1/oms/setup/webhooks/is_required/` endpoint. In the headers, set\
the `Authorization` header to include the token for authentication.\
Here's an example of how to make the request in python:

```python
import requests

url = "https://{domain_url}/api/v1/oms/setup/webhooks/is_required/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
    'Content-Type': 'application/json',
    'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers)

print(response.status_code)
```

**Response 200 OK**

Possible values of result are true and false.

| Parameter | Data Type | Description                           |
| --------- | --------- | ------------------------------------- |
| reuslt    | string    | Whether the task should be run or not |

This example response serves as a reference to understand the structure and\
data format returned from this API service.

```json
{
  "result": "true"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apidocs.akinon.com/oms/webhook-setup-services.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
