400
invalid_requestThe request did not satisfy the documented contract.
Beladed Ads API
Create Attribution through the reviewed Beladed Ads contract.
/api/ads/attribution/createcurl --request POST 'https://api.beladed.dev/api/ads/attribution/create' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'X-Beladed-API-Key: BELADED_SECRET_KEY' \
--data '{
"campaignId": "id_demo_001",
"name": "Summer Campaign Attribution",
"description": "Attribution tracking for summer sale campaign",
"model": "data_driven",
"conversionWindow": {
"view": 30,
"click": 90
},
"touchpoints": [
{
"channel": "display",
"medium": "banner",
"source": "google",
"campaign": "summer_sale_2025"
},
{
"channel": "social",
"medium": "video",
"source": "facebook",
"campaign": "summer_video_ads"
}
],
"goals": [
{
"type": "conversion",
"name": "purchase",
"value": 50
},
{
"type": "engagement",
"name": "newsletter_signup",
"value": 5
}
],
"settings": {
"enableCrossDomain": true,
"enableCrossDevice": true,
"modelRefreshInterval": "weekly",
"minTouchpoints": 2
}
}'const response = await fetch("https://api.beladed.dev/api/ads/attribution/create", {
method: "POST",
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"X-Beladed-API-Key": "BELADED_SECRET_KEY"
},
body: JSON.stringify({
"campaignId": "id_demo_001",
"name": "Summer Campaign Attribution",
"description": "Attribution tracking for summer sale campaign",
"model": "data_driven",
"conversionWindow": {
"view": 30,
"click": 90
},
"touchpoints": [
{
"channel": "display",
"medium": "banner",
"source": "google",
"campaign": "summer_sale_2025"
},
{
"channel": "social",
"medium": "video",
"source": "facebook",
"campaign": "summer_video_ads"
}
],
"goals": [
{
"type": "conversion",
"name": "purchase",
"value": 50
},
{
"type": "engagement",
"name": "newsletter_signup",
"value": 5
}
],
"settings": {
"enableCrossDomain": true,
"enableCrossDevice": true,
"modelRefreshInterval": "weekly",
"minTouchpoints": 2
}
})
});
const data = await response.json();import requests
response = requests.request(
"POST",
"https://api.beladed.dev/api/ads/attribution/create",
headers={"Accept":"application/json","Content-Type":"application/json","X-Beladed-API-Key":"BELADED_SECRET_KEY"},
json={
"campaignId": "id_demo_001",
"name": "Summer Campaign Attribution",
"description": "Attribution tracking for summer sale campaign",
"model": "data_driven",
"conversionWindow": {
"view": 30,
"click": 90
},
"touchpoints": [
{
"channel": "display",
"medium": "banner",
"source": "google",
"campaign": "summer_sale_2025"
},
{
"channel": "social",
"medium": "video",
"source": "facebook",
"campaign": "summer_video_ads"
}
],
"goals": [
{
"type": "conversion",
"name": "purchase",
"value": 50
},
{
"type": "engagement",
"name": "newsletter_signup",
"value": 5
}
],
"settings": {
"enableCrossDomain": true,
"enableCrossDevice": true,
"modelRefreshInterval": "weekly",
"minTouchpoints": 2
}
},
timeout=30,
)
response.raise_for_status()
data = response.json()<?php
$client = curl_init("https://api.beladed.dev/api/ads/attribution/create");
curl_setopt_array($client, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => ["Accept: application/json","Content-Type: application/json","X-Beladed-API-Key: BELADED_SECRET_KEY"],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode({
"campaignId": "id_demo_001",
"name": "Summer Campaign Attribution",
"description": "Attribution tracking for summer sale campaign",
"model": "data_driven",
"conversionWindow": {
"view": 30,
"click": 90
},
"touchpoints": [
{
"channel": "display",
"medium": "banner",
"source": "google",
"campaign": "summer_sale_2025"
},
{
"channel": "social",
"medium": "video",
"source": "facebook",
"campaign": "summer_video_ads"
}
],
"goals": [
{
"type": "conversion",
"name": "purchase",
"value": 50
},
{
"type": "engagement",
"name": "newsletter_signup",
"value": 5
}
],
"settings": {
"enableCrossDomain": true,
"enableCrossDevice": true,
"modelRefreshInterval": "weekly",
"minTouchpoints": 2
}
}),
]);
$response = curl_exec($client);require "net/http"
require "json"
uri = URI("https://api.beladed.dev/api/ads/attribution/create")
request = Net::HTTP::Post.new(uri)
request["Accept"] = "application/json"
request["Content-Type"] = "application/json"
request["X-Beladed-API-Key"] = "BELADED_SECRET_KEY"
request.body = "{\n \"campaignId\": \"id_demo_001\",\n \"name\": \"Summer Campaign Attribution\",\n \"description\": \"Attribution tracking for summer sale campaign\",\n \"model\": \"data_driven\",\n \"conversionWindow\": {\n \"view\": 30,\n \"click\": 90\n },\n \"touchpoints\": [\n {\n \"channel\": \"display\",\n \"medium\": \"banner\",\n \"source\": \"google\",\n \"campaign\": \"summer_sale_2025\"\n },\n {\n \"channel\": \"social\",\n \"medium\": \"video\",\n \"source\": \"facebook\",\n \"campaign\": \"summer_video_ads\"\n }\n ],\n \"goals\": [\n {\n \"type\": \"conversion\",\n \"name\": \"purchase\",\n \"value\": 50\n },\n {\n \"type\": \"engagement\",\n \"name\": \"newsletter_signup\",\n \"value\": 5\n }\n ],\n \"settings\": {\n \"enableCrossDomain\": true,\n \"enableCrossDevice\": true,\n \"modelRefreshInterval\": \"weekly\",\n \"minTouchpoints\": 2\n }\n}"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }var request = java.net.http.HttpRequest.newBuilder()
.uri(java.net.URI.create("https://api.beladed.dev/api/ads/attribution/create"))
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.header("X-Beladed-API-Key", "BELADED_SECRET_KEY")
.method("POST", java.net.http.HttpRequest.BodyPublishers.ofString("{\n \"campaignId\": \"id_demo_001\",\n \"name\": \"Summer Campaign Attribution\",\n \"description\": \"Attribution tracking for summer sale campaign\",\n \"model\": \"data_driven\",\n \"conversionWindow\": {\n \"view\": 30,\n \"click\": 90\n },\n \"touchpoints\": [\n {\n \"channel\": \"display\",\n \"medium\": \"banner\",\n \"source\": \"google\",\n \"campaign\": \"summer_sale_2025\"\n },\n {\n \"channel\": \"social\",\n \"medium\": \"video\",\n \"source\": \"facebook\",\n \"campaign\": \"summer_video_ads\"\n }\n ],\n \"goals\": [\n {\n \"type\": \"conversion\",\n \"name\": \"purchase\",\n \"value\": 50\n },\n {\n \"type\": \"engagement\",\n \"name\": \"newsletter_signup\",\n \"value\": 5\n }\n ],\n \"settings\": {\n \"enableCrossDomain\": true,\n \"enableCrossDevice\": true,\n \"modelRefreshInterval\": \"weekly\",\n \"minTouchpoints\": 2\n }\n}"))
.build();
var response = java.net.http.HttpClient.newHttpClient().send(request, java.net.http.HttpResponse.BodyHandlers.ofString());package main
import (
"bytes"
"net/http"
)
func callBeladed() (*http.Response, error) {
body := []byte("{\n \"campaignId\": \"id_demo_001\",\n \"name\": \"Summer Campaign Attribution\",\n \"description\": \"Attribution tracking for summer sale campaign\",\n \"model\": \"data_driven\",\n \"conversionWindow\": {\n \"view\": 30,\n \"click\": 90\n },\n \"touchpoints\": [\n {\n \"channel\": \"display\",\n \"medium\": \"banner\",\n \"source\": \"google\",\n \"campaign\": \"summer_sale_2025\"\n },\n {\n \"channel\": \"social\",\n \"medium\": \"video\",\n \"source\": \"facebook\",\n \"campaign\": \"summer_video_ads\"\n }\n ],\n \"goals\": [\n {\n \"type\": \"conversion\",\n \"name\": \"purchase\",\n \"value\": 50\n },\n {\n \"type\": \"engagement\",\n \"name\": \"newsletter_signup\",\n \"value\": 5\n }\n ],\n \"settings\": {\n \"enableCrossDomain\": true,\n \"enableCrossDevice\": true,\n \"modelRefreshInterval\": \"weekly\",\n \"minTouchpoints\": 2\n }\n}")
request, err := http.NewRequest("POST", "https://api.beladed.dev/api/ads/attribution/create", bytes.NewReader(body))
if err != nil { return nil, err }
request.Header.Set("Accept", "application/json")
request.Header.Set("Content-Type", "application/json")
request.Header.Set("X-Beladed-API-Key", "BELADED_SECRET_KEY")
return http.DefaultClient.Do(request)
}using var client = new HttpClient();
using var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.beladed.dev/api/ads/attribution/create");
request.Headers.TryAddWithoutValidation("Accept", "application/json");
request.Headers.TryAddWithoutValidation("Content-Type", "application/json");
request.Headers.TryAddWithoutValidation("X-Beladed-API-Key", "BELADED_SECRET_KEY");
request.Content = new StringContent("{\n \"campaignId\": \"id_demo_001\",\n \"name\": \"Summer Campaign Attribution\",\n \"description\": \"Attribution tracking for summer sale campaign\",\n \"model\": \"data_driven\",\n \"conversionWindow\": {\n \"view\": 30,\n \"click\": 90\n },\n \"touchpoints\": [\n {\n \"channel\": \"display\",\n \"medium\": \"banner\",\n \"source\": \"google\",\n \"campaign\": \"summer_sale_2025\"\n },\n {\n \"channel\": \"social\",\n \"medium\": \"video\",\n \"source\": \"facebook\",\n \"campaign\": \"summer_video_ads\"\n }\n ],\n \"goals\": [\n {\n \"type\": \"conversion\",\n \"name\": \"purchase\",\n \"value\": 50\n },\n {\n \"type\": \"engagement\",\n \"name\": \"newsletter_signup\",\n \"value\": 5\n }\n ],\n \"settings\": {\n \"enableCrossDomain\": true,\n \"enableCrossDevice\": true,\n \"modelRefreshInterval\": \"weekly\",\n \"minTouchpoints\": 2\n }\n}", System.Text.Encoding.UTF8, "application/json");
using var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();var request = URLRequest(url: URL(string: "https://api.beladed.dev/api/ads/attribution/create")!)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.setValue("BELADED_SECRET_KEY", forHTTPHeaderField: "X-Beladed-API-Key")
request.httpBody = "{\n \"campaignId\": \"id_demo_001\",\n \"name\": \"Summer Campaign Attribution\",\n \"description\": \"Attribution tracking for summer sale campaign\",\n \"model\": \"data_driven\",\n \"conversionWindow\": {\n \"view\": 30,\n \"click\": 90\n },\n \"touchpoints\": [\n {\n \"channel\": \"display\",\n \"medium\": \"banner\",\n \"source\": \"google\",\n \"campaign\": \"summer_sale_2025\"\n },\n {\n \"channel\": \"social\",\n \"medium\": \"video\",\n \"source\": \"facebook\",\n \"campaign\": \"summer_video_ads\"\n }\n ],\n \"goals\": [\n {\n \"type\": \"conversion\",\n \"name\": \"purchase\",\n \"value\": 50\n },\n {\n \"type\": \"engagement\",\n \"name\": \"newsletter_signup\",\n \"value\": 5\n }\n ],\n \"settings\": {\n \"enableCrossDomain\": true,\n \"enableCrossDevice\": true,\n \"modelRefreshInterval\": \"weekly\",\n \"minTouchpoints\": 2\n }\n}".data(using: .utf8)
let (data, response) = try await URLSession.shared.data(for: request)val request = okhttp3.Request.Builder()
.url("https://api.beladed.dev/api/ads/attribution/create")
.addHeader("Accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("X-Beladed-API-Key", "BELADED_SECRET_KEY")
.method("POST", okhttp3.RequestBody.create(okhttp3.MediaType.get("application/json"), "{\n \"campaignId\": \"id_demo_001\",\n \"name\": \"Summer Campaign Attribution\",\n \"description\": \"Attribution tracking for summer sale campaign\",\n \"model\": \"data_driven\",\n \"conversionWindow\": {\n \"view\": 30,\n \"click\": 90\n },\n \"touchpoints\": [\n {\n \"channel\": \"display\",\n \"medium\": \"banner\",\n \"source\": \"google\",\n \"campaign\": \"summer_sale_2025\"\n },\n {\n \"channel\": \"social\",\n \"medium\": \"video\",\n \"source\": \"facebook\",\n \"campaign\": \"summer_video_ads\"\n }\n ],\n \"goals\": [\n {\n \"type\": \"conversion\",\n \"name\": \"purchase\",\n \"value\": 50\n },\n {\n \"type\": \"engagement\",\n \"name\": \"newsletter_signup\",\n \"value\": 5\n }\n ],\n \"settings\": {\n \"enableCrossDomain\": true,\n \"enableCrossDevice\": true,\n \"modelRefreshInterval\": \"weekly\",\n \"minTouchpoints\": 2\n }\n}"))
.build()
val response = okhttp3.OkHttpClient().newCall(request).execute()
This operation has no documented parameters.
{
"type": "object",
"properties": {
"campaignId": {
"type": "string"
},
"name": {
"type": "string"
},
"description": {
"type": "string"
},
"model": {
"type": "string"
},
"conversionWindow": {
"type": "object",
"properties": {
"view": {
"type": "integer"
},
"click": {
"type": "integer"
}
}
},
"touchpoints": {
"type": "array",
"items": {
"type": "object",
"properties": {
"channel": {
"type": "string"
},
"medium": {
"type": "string"
},
"source": {
"type": "string"
},
"campaign": {
"type": "string"
}
}
}
},
"goals": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"name": {
"type": "string"
},
"value": {
"type": "integer"
}
}
}
},
"settings": {
"type": "object",
"properties": {
"enableCrossDomain": {
"type": "boolean"
},
"enableCrossDevice": {
"type": "boolean"
},
"modelRefreshInterval": {
"type": "string"
},
"minTouchpoints": {
"type": "integer"
}
}
}
}
}{
"campaignId": "id_demo_001",
"name": "Summer Campaign Attribution",
"description": "Attribution tracking for summer sale campaign",
"model": "data_driven",
"conversionWindow": {
"view": 30,
"click": 90
},
"touchpoints": [
{
"channel": "display",
"medium": "banner",
"source": "google",
"campaign": "summer_sale_2025"
},
{
"channel": "social",
"medium": "video",
"source": "facebook",
"campaign": "summer_video_ads"
}
],
"goals": [
{
"type": "conversion",
"name": "purchase",
"value": 50
},
{
"type": "engagement",
"name": "newsletter_signup",
"value": 5
}
],
"settings": {
"enableCrossDomain": true,
"enableCrossDevice": true,
"modelRefreshInterval": "weekly",
"minTouchpoints": 2
}
}
{
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"requestId": {
"type": "string"
}
}
}{
"data": {
"id": "id_demo_001",
"status": "available"
},
"requestId": "req_demo_001"
}
invalid_requestThe request did not satisfy the documented contract.
authentication_requiredThe credential is missing or invalid.
not_authorizedThe account, product scope, permission, or origin is not eligible.
not_foundThe requested public or account-owned resource was not found.
rate_limitedRetry after the current product limit resets.
This operation is published from reviewed repository contracts. Source metadata is included for traceability without exposing internal implementation details.