# 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: 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:

```
GET https://docs.edgetag.io/channels/webhook/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
