Set target CPAs
Replace every saved target of one conversion in one transaction. Needs an agency key or creative_analysis:write. Every field is required: a missing or invalid value answers 400 and changes nothing. null clears the client default and {} clears every campaign target.
curl -X PUT "https://mythic-analytics.gulp.workers.dev/client/v1/creatives/decisions/targets?location_id=example_string" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"conversion": "meta:lead",
"currency": "USD",
"client_target_cpa": 40,
"campaigns": {
"120212345678901234": 60
}
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/creatives/decisions/targets?location_id=example_string"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"conversion": "meta:lead",
"currency": "USD",
"client_target_cpa": 40,
"campaigns": {
"120212345678901234": 60
}
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/creatives/decisions/targets?location_id=example_string", {
method: "PUT",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"conversion": "meta:lead",
"currency": "USD",
"client_target_cpa": 40,
"campaigns": {
"120212345678901234": 60
}
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"conversion": "meta:lead",
"currency": "USD",
"client_target_cpa": 40,
"campaigns": {
"120212345678901234": 60
}
}`)
req, err := http.NewRequest("PUT", "https://mythic-analytics.gulp.workers.dev/client/v1/creatives/decisions/targets?location_id=example_string", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/creatives/decisions/targets?location_id=example_string')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"conversion": "meta:lead",
"currency": "USD",
"client_target_cpa": 40,
"campaigns": {
"120212345678901234": 60
}
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"conversion": "example_string",
"client": 3.14,
"campaigns": {},
"currency": "example_string"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
/client/v1/creatives/decisions/targets
Target server for requests. Edit to use your own host.
Agency key (ak_), location secret key (sk_, reads only) or a scoped mcp_ key with creative_analysis:read or creative_analysis:write. See Using an mcp_ key over HTTP.
ak_), location secret key (sk_, reads only) or a scoped mcp_ key with creative_analysis:read or creative_analysis:write. See Using an mcp_ key over HTTP.Location to scope to. Required for ak_ keys or send X-Location-Id. Ignored for sk_.
The media type of the request body
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. Agency key (ak_), location secret key (sk_, reads only) or a scoped mcp_ key with creative_analysis:read or creative_analysis:write. See Using an mcp_ key over HTTP.
Query Parameters
Location to scope to. Required for ak_ keys or send X-Location-Id. Ignored for sk_.
Body
meta:leadUSD40{"120212345678901234":60}