Update a UTM template
curl --request POST \
--url https://api.dashlink.ai/api/v1/utm_templates/update_utm_template \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-API-Key: <api-key>' \
--data 'template_id=<string>' \
--data 'template_name=<string>' \
--data 'utm_campaign_name=<string>' \
--data 'utm_medium=<string>' \
--data 'utm_source=<string>' \
--data 'utm_content=<string>' \
--data 'utm_term=<string>' \
--data 'utm_campaign_id=<string>'const encodedParams = new URLSearchParams();
encodedParams.append('template_id', '<string>');
encodedParams.append('template_name', '<string>');
encodedParams.append('utm_campaign_name', '<string>');
encodedParams.append('utm_medium', '<string>');
encodedParams.append('utm_source', '<string>');
encodedParams.append('utm_content', '<string>');
encodedParams.append('utm_term', '<string>');
encodedParams.append('utm_campaign_id', '<string>');
const url = 'https://api.dashlink.ai/api/v1/utm_templates/update_utm_template';
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.dashlink.ai/api/v1/utm_templates/update_utm_template"
payload = {
"template_id": "<string>",
"template_name": "<string>",
"utm_campaign_name": "<string>",
"utm_medium": "<string>",
"utm_source": "<string>",
"utm_content": "<string>",
"utm_term": "<string>",
"utm_campaign_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dashlink.ai/api/v1/utm_templates/update_utm_template"
payload := strings.NewReader("template_id=%3Cstring%3E&template_name=%3Cstring%3E&utm_campaign_name=%3Cstring%3E&utm_medium=%3Cstring%3E&utm_source=%3Cstring%3E&utm_content=%3Cstring%3E&utm_term=%3Cstring%3E&utm_campaign_id=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.dashlink.ai/api/v1/utm_templates/update_utm_template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "template_id=%3Cstring%3E&template_name=%3Cstring%3E&utm_campaign_name=%3Cstring%3E&utm_medium=%3Cstring%3E&utm_source=%3Cstring%3E&utm_content=%3Cstring%3E&utm_term=%3Cstring%3E&utm_campaign_id=%3Cstring%3E"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dashlink.ai/api/v1/utm_templates/update_utm_template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "template_id=%3Cstring%3E&template_name=%3Cstring%3E&utm_campaign_name=%3Cstring%3E&utm_medium=%3Cstring%3E&utm_source=%3Cstring%3E&utm_content=%3Cstring%3E&utm_term=%3Cstring%3E&utm_campaign_id=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {}
}{
"error": {
"message": "Invalid sort_by option. Choose from name, most_recent, last_modified",
"status_code": 400,
"code": "INVALID_PARAMETER",
"details": {
"parameter": "sort_by",
"value": "most_clicked",
"valid_options": [
"name",
"most_recent",
"last_modified"
]
}
}
}{
"error": {
"message": "Authentication required. Please provide valid credentials.",
"status_code": 401,
"code": "AUTHENTICATION_REQUIRED"
}
}{
"error": {
"message": "You do not have permission to perform this action.",
"status_code": 403,
"code": "PERMISSION_DENIED"
}
}{
"error": {
"message": "Shortlink not found.",
"status_code": 404,
"code": "NOT_FOUND"
}
}{
"error": {
"message": "This back-half is already in use on that domain.",
"status_code": 409,
"code": "DUPLICATE_ENTRY"
}
}{
"error": {
"message": "Rate limit exceeded. Please retry in 43 seconds.",
"status_code": 429,
"code": "RATE_LIMIT_EXCEEDED"
}
}{
"error": {
"message": "An unexpected error occurred. Please try again.",
"status_code": 500,
"code": "INTERNAL_SERVER_ERROR"
}
}UTM Templates
Update a UTM template
Update an existing UTM template for the logged-in user’s organization. Owner, Admin, or Editor roles can update templates. Supports both session-based auth and API key auth.
POST
/
api
/
v1
/
utm_templates
/
update_utm_template
Update a UTM template
curl --request POST \
--url https://api.dashlink.ai/api/v1/utm_templates/update_utm_template \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'X-API-Key: <api-key>' \
--data 'template_id=<string>' \
--data 'template_name=<string>' \
--data 'utm_campaign_name=<string>' \
--data 'utm_medium=<string>' \
--data 'utm_source=<string>' \
--data 'utm_content=<string>' \
--data 'utm_term=<string>' \
--data 'utm_campaign_id=<string>'const encodedParams = new URLSearchParams();
encodedParams.append('template_id', '<string>');
encodedParams.append('template_name', '<string>');
encodedParams.append('utm_campaign_name', '<string>');
encodedParams.append('utm_medium', '<string>');
encodedParams.append('utm_source', '<string>');
encodedParams.append('utm_content', '<string>');
encodedParams.append('utm_term', '<string>');
encodedParams.append('utm_campaign_id', '<string>');
const url = 'https://api.dashlink.ai/api/v1/utm_templates/update_utm_template';
const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/x-www-form-urlencoded'},
body: encodedParams
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));import requests
url = "https://api.dashlink.ai/api/v1/utm_templates/update_utm_template"
payload = {
"template_id": "<string>",
"template_name": "<string>",
"utm_campaign_name": "<string>",
"utm_medium": "<string>",
"utm_source": "<string>",
"utm_content": "<string>",
"utm_term": "<string>",
"utm_campaign_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/x-www-form-urlencoded"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.dashlink.ai/api/v1/utm_templates/update_utm_template"
payload := strings.NewReader("template_id=%3Cstring%3E&template_name=%3Cstring%3E&utm_campaign_name=%3Cstring%3E&utm_medium=%3Cstring%3E&utm_source=%3Cstring%3E&utm_content=%3Cstring%3E&utm_term=%3Cstring%3E&utm_campaign_id=%3Cstring%3E")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.dashlink.ai/api/v1/utm_templates/update_utm_template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/x-www-form-urlencoded'
request.body = "template_id=%3Cstring%3E&template_name=%3Cstring%3E&utm_campaign_name=%3Cstring%3E&utm_medium=%3Cstring%3E&utm_source=%3Cstring%3E&utm_content=%3Cstring%3E&utm_term=%3Cstring%3E&utm_campaign_id=%3Cstring%3E"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dashlink.ai/api/v1/utm_templates/update_utm_template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "template_id=%3Cstring%3E&template_name=%3Cstring%3E&utm_campaign_name=%3Cstring%3E&utm_medium=%3Cstring%3E&utm_source=%3Cstring%3E&utm_content=%3Cstring%3E&utm_term=%3Cstring%3E&utm_campaign_id=%3Cstring%3E",
CURLOPT_HTTPHEADER => [
"Content-Type: application/x-www-form-urlencoded",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {}
}{
"error": {
"message": "Invalid sort_by option. Choose from name, most_recent, last_modified",
"status_code": 400,
"code": "INVALID_PARAMETER",
"details": {
"parameter": "sort_by",
"value": "most_clicked",
"valid_options": [
"name",
"most_recent",
"last_modified"
]
}
}
}{
"error": {
"message": "Authentication required. Please provide valid credentials.",
"status_code": 401,
"code": "AUTHENTICATION_REQUIRED"
}
}{
"error": {
"message": "You do not have permission to perform this action.",
"status_code": 403,
"code": "PERMISSION_DENIED"
}
}{
"error": {
"message": "Shortlink not found.",
"status_code": 404,
"code": "NOT_FOUND"
}
}{
"error": {
"message": "This back-half is already in use on that domain.",
"status_code": 409,
"code": "DUPLICATE_ENTRY"
}
}{
"error": {
"message": "Rate limit exceeded. Please retry in 43 seconds.",
"status_code": 429,
"code": "RATE_LIMIT_EXCEEDED"
}
}{
"error": {
"message": "An unexpected error occurred. Please try again.",
"status_code": 500,
"code": "INTERNAL_SERVER_ERROR"
}
}Authorizations
Body
application/x-www-form-urlencoded