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

# Introduction

## Introduction to the Link11 API

Link11 offers a number of prebuilt API endpoints for the Web DDoS, Network DDoS, Secure CDN, and Secure DNS products. (Note: the products don't include full API suites, and are therefore not based on frameworks.)

Commands are sent to the API via specific URLs, with appropriate values for the query parameters.&#x20;

## Accessing the API

To use an API endpoint, access its URL as shown in the documentation.&#x20;

{% hint style="info" %}
Each API request must be sent from a [whitelisted IP address](#customerapi-authentication).\
\
When an IP will be used to access the API for multiple Link11 services, it must be whitelisted separately for each one.
{% endhint %}

API endpoints can be accessed in two ways.

### Using curl

[curl](https://curl.se/) is a free, open source cli tool that can access Link11 API endpoints, e.g. \
`curl "$ENDPOINT-URL"`

### Using a web browser

Unless otherwise noted, all Link11 endpoints use the GET HTTP method. Therefore, these endpoint URLs can be entered directly into a web browser.&#x20;

## Common endpoint parameters

Here's an example of retrieving statistics from Web DDoS:

`https://api.link11.de/?apikey=link11&domainkey=io8dijw2lkw0d83hd&get_stats&from=1633076968&to=1633150568&aggregate=86400&type=clientbytes`

It includes two parameters that are common to all Link11 API endpoints:

* `apikey` (discussed in [Service Keys](#customerapi-servicekey) below, including a caution about potential confusion from its name)
* `domainkey` (discussed in [Domain Keys](#domain-keys), below. Note the exception for Secure CDN, which is `domain`).

{% hint style="info" %}
Attempting to use the API without fulfilling these requirements will result in [API errors](/using-link11/api/api-errors.md).
{% endhint %}

### Alternate format

For additional security, a Domain Key can be passed as a `domainkey` header value instead of a query parameter, as in this example:

`curl -H "domainkey:io8dijw2lkw0d83hd" "https://api.link11.de/?apikey=link11&get_stats&aggregate=86400&type=clientbytes&from=1633076968&to=1633150568"`

***

## Service Keys <a href="#customerapi-servicekey" id="customerapi-servicekey"></a>

The Service Key determines the Link11 service that receives the API command. It is submitted as a value for the `apikey` parameter, as follows:

`apikey=`$SERVICEKEY

The available Service Keys are:

<table><thead><tr><th width="268">Key</th><th width="296">Targeted Service</th><th>Success Response</th></tr></thead><tbody><tr><td><code>link11</code></td><td>WebDDoS</td><td>200 OK</td></tr><tr><td><code>infraddos</code></td><td>Network DDoS</td><td>200 OK</td></tr><tr><td><code>l11ddosflow</code></td><td>Network DDoS Reporting</td><td>200 OK</td></tr><tr><td><code>l11cdn</code></td><td>Secure CDN</td><td>200 OK</td></tr><tr><td><code>l11securedns</code></td><td>Secure DNS</td><td>200 OK</td></tr></tbody></table>

### A possible source of confusion

{% hint style="warning" %}
Note there is potential confusion about the name of the `apikey` parameter. Within WebGUI, several Link11 services have an API Access page, which have buttons to "Show API Key".  **The values revealed by these buttons are the Domain Keys described in the next section below**, and are ***not*** the same as the `apikey` parameter being described here.
{% endhint %}

***

## Domain Keys

The Domain Key determines the specific target of the API command within the customer's system (for example, a Web DDoS instance or Network DDoS BGP Session).&#x20;

It is usually submitted like this:

`domainkey=`$DOMAINKEY

There is one exception. For Secure CDN, it is:

`domain=`$DOMAINKEY

The $DOMAINKEY value can be obtained from WebGUI; the location within WebGUI varies according to the Link11 service being accessed.

For most services, the note above ("[A possible source of confusion](#a-possible-source-of-confusion)") will apply.

***

## Whitelisting source IPs <a href="#customerapi-authentication" id="customerapi-authentication"></a>

The authentication to a certain API Key and customer is only allowed from predefined allowed source IP addresses.&#x20;

* For Web DDoS, Network DDoS, and Secure DNS, the IPs can be whitelisted within each service's "API Access" page.
* For Secure CDN, the IPs can be whitelisted via [API IP ACL Limits](/product-guides/secure-cdn/interface/instances.md#api-ip-acl-limits).

***

## Service-specific instructions

The discussion above is an overview of using the Link11 API. Here are specific instructions for each service:

* [Web DDoS](/product-guides/web-ddos/interface/api-access.md)
* [Network DDoS](broken://pages/VUDuLHzvFgR0480bepBo)
* [Netflow DDoS Detector](/using-link11/api/netflow-ddos-detector.md)
* [Secure DNS](/product-guides/secure-dns/interface/api-access.md)
* [Secure CDN](/using-link11/api/secure-cdn.md)
