curl -X POST "https://api.dashlink.ai/api/v1/campaigns/create_campaign" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-d 'campaign_name=Spring Sale 2026' \
-d 'description=Q2 promotional push'
const body = new URLSearchParams();
body.append("campaign_name", "Spring Sale 2026");
body.append("description", "Q2 promotional push");
const response = await fetch("https://api.dashlink.ai/api/v1/campaigns/create_campaign", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/campaigns/create_campaign',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'campaign_name': 'Spring Sale 2026',
'description': 'Q2 promotional push',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/campaigns/create_campaign"
form0 := url.Values{
"campaign_name": {"Spring Sale 2026"},
"description": {"Q2 promotional push"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/campaigns/create_campaign")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("campaign_name" => "Spring Sale 2026", "description" => "Q2 promotional push")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/campaigns/create_campaign');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['campaign_name' => 'Spring Sale 2026', 'description' => 'Q2 promotional push']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
The usual shape
1
Create the campaign
The container.
2
Create channels within it
Email, social, paid — however you want to compare. See Channels.
3
Add links to channels
A link can be in more than one.
4
Read the numbers
get_campaign_kpis for headlines, the analytics endpoints for detail.Reading performance
curl -X GET "https://api.dashlink.ai/api/v1/campaigns/get_campaign_kpis?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31" \
-H "X-API-Key: $DASHLINK_API_KEY"
const response = await fetch("https://api.dashlink.ai/api/v1/campaigns/get_campaign_kpis?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31", {
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
});
const payload = await response.json();
import os
import requests
response = requests.get(
'https://api.dashlink.ai/api/v1/campaigns/get_campaign_kpis?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/campaigns/get_campaign_kpis?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31"
req0, err0 := http.NewRequest("GET", endpoint0, nil)
if err0 != nil {
panic(err0)
}
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/campaigns/get_campaign_kpis?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31")
request0 = Net::HTTP::Get.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/campaigns/get_campaign_kpis?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
curl -X GET "https://api.dashlink.ai/api/v1/analytics/get_campaign_metrics_aggregation?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31&metric=referrer" \
-H "X-API-Key: $DASHLINK_API_KEY"
const response = await fetch("https://api.dashlink.ai/api/v1/analytics/get_campaign_metrics_aggregation?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31&metric=referrer", {
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
});
const payload = await response.json();
import os
import requests
response = requests.get(
'https://api.dashlink.ai/api/v1/analytics/get_campaign_metrics_aggregation?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31&metric=referrer',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/analytics/get_campaign_metrics_aggregation?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31&metric=referrer"
req0, err0 := http.NewRequest("GET", endpoint0, nil)
if err0 != nil {
panic(err0)
}
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/analytics/get_campaign_metrics_aggregation?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31&metric=referrer")
request0 = Net::HTTP::Get.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/analytics/get_campaign_metrics_aggregation?name=CAMP-0001&date_from=2026-01-01&date_to=2026-01-31&metric=referrer');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
Listing
curl -X GET "https://api.dashlink.ai/api/v1/campaigns/get_campaigns?per_page=50" \
-H "X-API-Key: $DASHLINK_API_KEY"
const response = await fetch("https://api.dashlink.ai/api/v1/campaigns/get_campaigns?per_page=50", {
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
});
const payload = await response.json();
import os
import requests
response = requests.get(
'https://api.dashlink.ai/api/v1/campaigns/get_campaigns?per_page=50',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/campaigns/get_campaigns?per_page=50"
req0, err0 := http.NewRequest("GET", endpoint0, nil)
if err0 != nil {
panic(err0)
}
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/campaigns/get_campaigns?per_page=50")
request0 = Net::HTTP::Get.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/campaigns/get_campaigns?per_page=50');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
get_campaigns accepts the analytics filters too, so you can list campaigns with their performance in one call rather than looping.
Updating and deleting
curl -X POST "https://api.dashlink.ai/api/v1/campaigns/update_campaign" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-d "campaign_id=CAMP-0001" \
-d 'campaign_name=Spring Sale 2026 (extended)'
const body = new URLSearchParams();
body.append("campaign_id", "CAMP-0001");
body.append("campaign_name", "Spring Sale 2026 (extended)");
const response = await fetch("https://api.dashlink.ai/api/v1/campaigns/update_campaign", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/campaigns/update_campaign',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'campaign_id': 'CAMP-0001',
'campaign_name': 'Spring Sale 2026 (extended)',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/campaigns/update_campaign"
form0 := url.Values{
"campaign_id": {"CAMP-0001"},
"campaign_name": {"Spring Sale 2026 (extended)"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/campaigns/update_campaign")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("campaign_id" => "CAMP-0001", "campaign_name" => "Spring Sale 2026 (extended)")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/campaigns/update_campaign');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['campaign_id' => 'CAMP-0001', 'campaign_name' => 'Spring Sale 2026 (extended)']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
curl -X POST "https://api.dashlink.ai/api/v1/campaigns/delete_campaign" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-d "campaign_id=CAMP-0001"
const body = new URLSearchParams();
body.append("campaign_id", "CAMP-0001");
const response = await fetch("https://api.dashlink.ai/api/v1/campaigns/delete_campaign", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/campaigns/delete_campaign',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'campaign_id': 'CAMP-0001',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/campaigns/delete_campaign"
form0 := url.Values{
"campaign_id": {"CAMP-0001"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/campaigns/delete_campaign")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("campaign_id" => "CAMP-0001")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/campaigns/delete_campaign');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['campaign_id' => 'CAMP-0001']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
Deleting a campaign does not delete its links. They keep working and keep their own analytics; they are simply no longer grouped.
Campaigns, tags and UTMs
Three ways of organising that are easy to confuse:| Groups | Read by | Good for | |
|---|---|---|---|
| Campaign | Links, into channels | Dashlink | Measuring a piece of work as a unit |
| Tag | Links, flatly | Dashlink | Finding links again |
| UTM | Nothing — annotates the destination | Your analytics tool | Attributing sessions off-site |