Update a tracked page
Change label, country, max_ads or active. A body of only {"active": false} works on every plan and for disabled clients. A resumed page is first refreshed 24 hours after its last scrape.
curl -X PATCH "https://mythic-analytics.gulp.workers.dev/client/v1/competitor-ads/pages/123e4567-e89b-12d3-a456-426614174000?location_id=example_string" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"country": "US",
"label": "example_string",
"max_ads": 42,
"active": true
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/competitor-ads/pages/123e4567-e89b-12d3-a456-426614174000?location_id=example_string"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"country": "US",
"label": "example_string",
"max_ads": 42,
"active": true
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/competitor-ads/pages/123e4567-e89b-12d3-a456-426614174000?location_id=example_string", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"country": "US",
"label": "example_string",
"max_ads": 42,
"active": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"country": "US",
"label": "example_string",
"max_ads": 42,
"active": true
}`)
req, err := http.NewRequest("PATCH", "https://mythic-analytics.gulp.workers.dev/client/v1/competitor-ads/pages/123e4567-e89b-12d3-a456-426614174000?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/competitor-ads/pages/123e4567-e89b-12d3-a456-426614174000?location_id=example_string')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"country": "US",
"label": "example_string",
"max_ads": 42,
"active": true
}'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"page_id": "example_string",
"country": "USA",
"label": "example_string",
"max_ads": 42,
"active": true,
"page_name": "John Doe",
"last_refresh_at": "2024-12-25T10:00:00Z",
"last_refresh_status": "ok",
"last_refresh_error": "example_string",
"last_refresh_counts": {
"received": 42,
"inserted": 42,
"updated": 42,
"changed": 42,
"gone": 42,
"rejected": 42,
"total_results": 42,
"returned_ads": 42,
"pagination_complete": true,
"ms": 42
},
"next_refresh_at": "2024-12-25T10:00:00Z",
"refreshing": true,
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
/client/v1/competitor-ads/pages/{id}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 competitor_ads:read or competitor_ads:write. See Using an mcp_ key over HTTP.
ak_), location secret key (sk_, reads only) or a scoped mcp_ key with competitor_ads:read or competitor_ads:write. See Using an mcp_ key over HTTP.The tracked page id from the list, not the Facebook page id.
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 competitor_ads:read or competitor_ads:write. See Using an mcp_ key over HTTP.
Path Parameters
The tracked page id from the list, not the Facebook page id.
Query Parameters
Location to scope to. Required for ak_ keys or send X-Location-Id. Ignored for sk_.