> 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/api/getting-started/implementation/channel.md).

# Channel

The last API that you will need to call is for adding a channel. We support a wide range of channels. We suggest starting with one that suits you the most and then adding the others later on.

Each channel has a configuration that you should check on the channel integration page. Use that as a reference for each channel. In our example, we will use Segment as it only has one secret.&#x20;

On our [secret page](/api/getting-started/implementation/secret.md), you can see how you can encrypt your values, which will be passed in the API.

For `consentCategory`  you can provide the following values:

* necessary
* advertising
* analytics
* functional
* share\_pii

`shouldDeploy` Indicates if, when the channel is added, infrastructure should be deployed/updated, or if you will be adding more channels and deploy it at the end. Until you deploy, your changes will not be visible.

[Script](/api/api/script.md#post-script)

{% tabs %}
{% tab title="JavaScript" %}

```javascript
fetch('https://api-sandbox.edgetag.io/script', {
  method: 'POST',
  headers: {
    'Accept': 'application/json',
    'Authorization': 'Bearer your-token',
    'Team-Id': '{your-team-id}'
  },
  body: JSON.stringify({
    name: 'Pixel',
    providerId: 'segment',
    tagId: '{tagId}',
    shouldDeploy: true,
    consentCategory: 'advertising',
    secrets: [
      {
        variable: 'SEGMENT_TOKEN',
        type: 'PASSWORD',
        optional: false,
        data: 'kZi3giHyCnT5WAAhdZ6X8Q==',
        key: 'uNLgTIjNI8fICSt7bT7XmFlNgUVLXIk0JKNk51DOaLI3qis097XzgX5HxwG3yOX488YC4EMQRqU9GU8591R/zHN8DEpSgp5Zqu1YR4mTh4wfYVEsffRZIdo97F8dVjP/9nHiBiuf0bb+arxNDgl1PRXdvWu/N3eliOWa6dyoriY=',
        iv: '2c3eaaed73fe85c1dc5f97f724230adc',
        salt: 'd676d4b53c06585e',
      },
    ]
  })
})

```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --request PUT \
  --url https://api-sandbox.edgetag.io/me \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {your-token}' \
  --header 'Content-Type: application/json' \
  --header 'Team-Id: {your-team-id}' \
  --data '{
	"name": "Pixel",
	"providerId": "segment",
	"tagId": "{tagId}",
	"shouldDeploy": true,
	"consentCategory": "advertising",
	"secrets": [
		{
			"variable": "SEGMENT_TOKEN",
			"type": "PASSWORD",
			"optional": false,
			"data": "kZi3giHyCnT5WAAhdZ6X8Q==",
			"key": "uNLgTIjNI8fICSt7bT7XmFlNgUVLXIk0JKNk51DOaLI3qis097XzgX5HxwG3yOX488YC4EMQRqU9GU8591R/zHN8DEpSgp5Zqu1YR4mTh4wfYVEsffRZIdo97F8dVjP/9nHiBiuf0bb+arxNDgl1PRXdvWu/N3eliOWa6dyoriY=",
			"iv": "2c3eaaed73fe85c1dc5f97f724230adc",
			"salt": "d676d4b53c06585e"
		}
	]
}'
```

{% endtab %}
{% endtabs %}

You are now good to go. Your first website is live with channel integration. :tada:

Now that the infrastructure is set up, you will need to add our small JavaScript snippet to the website.&#x20;

{% content-ref url="/spaces/ZJWZKbUk0hRISkCIj2p4/pages/sV0LBUDv5lQFbImtqHoB" %}
[Overview](/implementation/overview.md)
{% endcontent-ref %}


---

# 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/api/getting-started/implementation/channel.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.
