API Documentation

API Documentation

Integrate powerful Valkiria advertising tools into your applications

RESTJSONMCP8 endpoints

01Quick Start

Quick Start

  1. Authentication

    Get your API key in account settings

  2. First Request

    Use the API key in the Authorization header

  3. Rate Limits

    1000 requests per minute on basic plan

02API Reference

Endpoints

MethodEndpointDescription
GET/api/v1/campaignsGet campaign list
POST/api/v1/campaignsCreate new campaign
GET/api/v1/campaigns/:idGet campaign details
PATCH/api/v1/campaigns/:idUpdate campaign
GET/api/v1/analytics/dashboardGet analytics
POST/api/v1/analytics/reportGenerate an analytics report
GET/api/v1/rules/templatesList automation rule templates
POST/mcpConnect AI assistants through MCP

03Example

GET /api/v1/campaigns

Request
curl -X GET "https://sys.valkiria.pro/api/v1/campaigns" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
Response
{
  "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
POST /api/v1/campaigns
// 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.

JavaScript / TypeScript
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();
Python
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
<?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);
Go
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

Drag to move. Alt + arrow keys move the button; Alt + Home resets its position.

Cookie Preferences

We use cookies to enhance your experience. Essential cookies are always active. You can manage optional cookies below.

Essential
Analytics
Marketing
Third-Party