> For the complete documentation index, see [llms.txt](https://docs.edgetag.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgetag.io/channels/webhook/api.md).

# API

{% hint style="warning" %}
This section is intended for developers utilizing our APIs to add channels.
{% endhint %}

Below you will find the keys to generate secret payloads for adding or updating a channel via the [Script API](/api/api/script.md).

Refer to the [configuration page](/channels/webhook/configuration.md) for detailed information on the purpose and usage of each input.

### WEBHOOK\_CODE

In this secret, you would store the JS code of the webhook. \
\
**Example value**

```javascript
async process(params) {
  // Add your code here
  console.log('This is the JS code block');
  return new Response('It is working');
}
```

\
**Type**\
TEXT\
\
**Optional**\
false

### WEBHOOK\_TOKEN

In this secret, you can optionally set an access token, which will be used to authorize the POST request. This value should match the request header `Authorization: Bearer <token value>`.\
\
**Example value**

```javascript
ba88bcee6907d5e8d62bf2d466d1dbe04fbc688
```

\
**Type**\
TEXT\
\
**Optional**\
true

### WEBHOOK\_SECRETS

Use for storing the Pixel ID.

**Example value**

```json
"{ \"PRIVATE_APP_ACCESS_TOKEN\": \"CM08ISRC77U2H4CKPULG123\" }"
```

\
**Type**\
TEXT\
\
**Optional**\
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://docs.edgetag.io/channels/webhook/api.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.
