API Documentation
API Documentation
Integrate powerful Valkiria advertising tools into your applications
01Quick Start
Quick Start
Authentication
Get your API key in account settings
First Request
Use the API key in the Authorization header
Rate Limits
1000 requests per minute on basic plan
02API Reference
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/campaigns | Get campaign list |
| POST | /api/v1/campaigns | Create new campaign |
| GET | /api/v1/campaigns/:id | Get campaign details |
| PATCH | /api/v1/campaigns/:id | Update campaign |
| GET | /api/v1/analytics/dashboard | Get analytics |
| POST | /api/v1/analytics/report | Generate an analytics report |
| GET | /api/v1/rules/templates | List automation rule templates |
| POST | /mcp | Connect AI assistants through MCP |
03Example
GET /api/v1/campaigns
curl -X GET "https://sys.valkiria.pro/api/v1/campaigns" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"{
"campaigns": [
{
"id": "b3c8e1d0-7d3a-4f29-9a55-1b2c3d4e5f60",
"name": "Summer Campaign",
"platform": "google",
"status": "active",
"budget": 1000
}
],
"total": 1,
"limit": 20,
"offset": 0
}POST /api/v1/campaigns — Create new campaign
// Local draft only: no advertising is published.
// Create one UUID per draft and save the complete request before sending.
// Retry this same saved UUID/body after a timeout; do not generate another.
const savedRequest = {
requestId: '54bda530-50ae-4bb4-bb8c-ae89fc26c029',
name: 'Ukraine product launch',
platform: 'telegram_ads',
objective: 'leads',
budget: 10000,
dailyBudget: 500,
currency: 'UAH',
targetAudience: {
countries: ['UA'],
languages: ['uk'],
interests: ['technology', 'business']
},
adContent: {
headline: 'Discover our product',
description: 'Explore the features for your business',
callToAction: 'Learn more'
}
};
// Run on your server. Keep the API key out of browser code.
const response = await fetch('https://sys.valkiria.pro/api/v1/campaigns', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + process.env.VALKIRIA_API_KEY
},
body: JSON.stringify(savedRequest)
});
if (!response.ok) throw new Error('Creation not confirmed: HTTP ' + response.status);
const result = await response.json();
// Review the local draft; publication requires a separate approved workflow.
console.log(result.campaign.id, result.execution_scope);04API starter snippets
API starter snippets
Copy ready-to-use request examples for your preferred language.
const apiKey = process.env.VALKIRIA_API_KEY;
const response = await fetch('https://sys.valkiria.pro/api/v1/campaigns', {
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
});
if (!response.ok) {
throw new Error(`Valkiria API error: ${response.status}`);
}
const data = await response.json();import os
import requests
api_key = os.environ["VALKIRIA_API_KEY"]
response = requests.get(
"https://sys.valkiria.pro/api/v1/campaigns",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
},
timeout=30,
)
response.raise_for_status()
data = response.json()<?php
$apiKey = getenv('VALKIRIA_API_KEY');
$curl = curl_init('https://sys.valkiria.pro/api/v1/campaigns');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
$data = json_decode($response, true, flags: JSON_THROW_ON_ERROR);package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
func main() {
req, err := http.NewRequest("GET", "https://sys.valkiria.pro/api/v1/campaigns", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer "+os.Getenv("VALKIRIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var data map[string]any
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
panic(err)
}
fmt.Println(data)
}Need help?
Didn't find an answer? Contact us