REST API Documentation
AgentClick REST API v1.0.0 — 24 endpoints
AgentClick provides a REST API that lets you automate program search, partnership management, and conversion tracking from any HTTP client. Compatible with Python, JavaScript, curl, and any other language.
1. Overview
| Endpoint | POST https://agentclick.ai/api/mcp.php |
|---|---|
| Content-Type | application/json |
| Authentication | Authorization: Bearer aa_xxx |
| Encoding | UTF-8 |
All requests are POST to a single endpoint. The action field specifies the operation to perform.
2. Authentication
All requests (except health) require an API key.
| Format | aa_ + 48-char hex = 51 characters total |
|---|---|
| Header | Authorization: Bearer aa_your_api_key |
| Issued from | Dashboard → "API Keys" menu |
| Max keys | 10 per account |
| Roles | publisher / advertiser / agent |
API keys can be created, revoked, or deleted at any time from the "API Keys" page in your dashboard.
3. Request Format
The request body is JSON with an action and optional params.
{
"action": "namespace.method",
"params": {
"key": "value"
}
}
| Field | Type | Required | Description |
|---|---|---|---|
action | string | Required | Action to execute (e.g. publisher.programs_search) |
params | object | Optional | Action-specific parameters |
4. Response Format
Success:
{
"success": true,
"message": "Operation completed",
"data": { ... }
}
Error:
{
"success": false,
"message": "Error description"
}
5. Rate Limits
| Operation | Limit | Notes |
|---|---|---|
| Read | 200 req/min | Search, list, report, etc. |
| Write | 30 req/min | Partnership apply, click tracking, conversion recording, etc. |
When the limit is exceeded, 429 Too Many Requests is returned. Wait one minute before retrying.
6. Common Endpoints (5)
Available to all roles.
health
Health check. No authentication required. Verify server status.
Parameters: None
curl
# Health check (no auth required)
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-d '{"action": "health"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
json={"action": "health"}
)
print(resp.json())
# {"success": true, "message": "OK", "data": {"status": "ok", ...}}
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ action: "health" })
});
const data = await resp.json();
console.log(data);
common.categories
Retrieve the list of categories. Used as filters for program search.
Parameters: None
Response: categories[] — id, name, slug, description, sort_order
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.categories"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.categories"}
)
categories = resp.json()["data"]["categories"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.categories" })
});
const { data } = await resp.json();
common.stats
Public platform statistics: active programs, publishers, advertisers, and approved conversions.
Parameters: None
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.stats"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.stats"}
)
stats = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.stats" })
});
const { data } = await resp.json();
common.profile
Retrieve the authenticated user's profile, including role-specific details (site info or company info).
Parameters: None
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.profile"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.profile"}
)
profile = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.profile" })
});
const { data } = await resp.json();
common.api_key_info
API key usage stats: request count, allowed actions, and last used timestamp.
Parameters: None
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "common.api_key_info"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "common.api_key_info"}
)
key_info = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "common.api_key_info" })
});
const { data } = await resp.json();
7. Publisher Endpoints (13)
Available to the publisher or agent role.
publisher.programs_search
Search public programs. Filter by category, reward type, keyword, and minimum reward amount.
| Parameter | Type | Description |
|---|---|---|
category_id | integer | Category ID |
category_slug | string | Category slug (e.g. ai-chatbot) |
reward_type | string | cpa / cpc / cpi |
keyword | string | Keyword search (program name and description) |
min_reward | integer | Minimum reward amount (JPY) |
self_affiliate | boolean | Self-back eligible programs only |
min_confirmation_rate | integer | Minimum confirmation rate (%) |
allow_listing | boolean | Programs that allow listing ads only |
has_product_link | boolean | Programs with product links only |
itp_supported | boolean | ITP-compliant programs only |
is_campaign | boolean | Programs with active campaigns only |
is_new | boolean | New programs only |
auto_approve | boolean | Instantly approved programs only |
sort | string | newest / reward_desc / reward_asc / name / confirmation_rate_desc / epc_desc |
page | integer | Page number (default: 1) |
per_page | integer | Items per page (default: 20, max: 50) |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.programs_search",
"params": {
"category_slug": "ai-chatbot",
"reward_type": "cpa",
"min_reward": 1000
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.programs_search",
"params": {
"category_slug": "ai-chatbot",
"reward_type": "cpa",
"min_reward": 1000
}
}
)
programs = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.programs_search",
params: {
category_slug: "ai-chatbot",
reward_type: "cpa",
min_reward: 1000
}
})
});
const { data } = await resp.json();
publisher.programs_detail
Program details: reward conditions, cookie duration, creatives, LP URL, and current partnership status.
| Parameter | Type | Required | Description |
|---|---|---|---|
program_id | integer | Required | Program ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.programs_detail",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.programs_detail",
"params": {"program_id": 42}
}
)
program = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.programs_detail",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
publisher.partnerships_apply WRITE
Apply for a partnership. Programs with auto_approve are approved immediately.
| Parameter | Type | Required | Description |
|---|---|---|---|
program_id | integer | Required | Program ID to apply for |
Response: partnership_id, status, tracking_code
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.partnerships_apply",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.partnerships_apply",
"params": {"program_id": 42}
}
)
result = resp.json()["data"]
# {"partnership_id": 15, "status": "approved", "tracking_code": "abc123..."}
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.partnerships_apply",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
publisher.partnerships_cancel WRITE
Cancel a partnership application in pending status.
| Parameter | Type | Required | Description |
|---|---|---|---|
partnership_id | integer | Required | Partnership ID to cancel |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.partnerships_cancel",
"params": {"partnership_id": 15}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.partnerships_cancel",
"params": {"partnership_id": 15}
}
)
print(resp.json())
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.partnerships_cancel",
params: { partnership_id: 15 }
})
});
const { data } = await resp.json();
publisher.partnerships_list
List partnerships including tracking_code. Filterable by status.
| Parameter | Type | Description |
|---|---|---|
status | string | pending / approved / rejected / suspended |
page | integer | Page number |
per_page | integer | Items per page |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.partnerships_list",
"params": {"status": "approved"}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.partnerships_list",
"params": {"status": "approved"}
}
)
partnerships = resp.json()["data"]["partnerships"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.partnerships_list",
params: { status: "approved" }
})
});
const { data } = await resp.json();
publisher.links_generate
Generate tracking links in three formats (URL, HTML tag, JS tag) plus a PR disclosure template.
| Parameter | Type | Required | Description |
|---|---|---|---|
partnership_id | integer | Required | Approved partnership ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.links_generate",
"params": {"partnership_id": 15}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.links_generate",
"params": {"partnership_id": 15}
}
)
links = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.links_generate",
params: { partnership_id: 15 }
})
});
const { data } = await resp.json();
publisher.selfback_list
List programs eligible for self-back (self-referral), sorted by reward amount.
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number |
per_page | integer | Items per page |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.selfback_list"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.selfback_list"}
)
programs = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "publisher.selfback_list" })
});
const { data } = await resp.json();
publisher.selfback_apply WRITE
Submit a self-back application. Processes partnership, click, and redirect URL in one shot. Limited to once per program.
| Parameter | Type | Required | Description |
|---|---|---|---|
program_id | integer | Required | Program ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.selfback_apply",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.selfback_apply",
"params": {"program_id": 42}
}
)
result = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.selfback_apply",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
publisher.report
Conversion report with date range, grouping by program or day, and click statistics.
| Parameter | Type | Description |
|---|---|---|
start_date | string | YYYY-MM-DD (default: first day of current month) |
end_date | string | YYYY-MM-DD (default: today) |
group_by | string | program / daily |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.report",
"params": {
"start_date": "2026-03-01",
"end_date": "2026-03-31",
"group_by": "daily"
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.report",
"params": {
"start_date": "2026-03-01",
"end_date": "2026-03-31",
"group_by": "daily"
}
}
)
report = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.report",
params: {
start_date: "2026-03-01",
end_date: "2026-03-31",
group_by: "daily"
}
})
});
const { data } = await resp.json();
publisher.earnings_summary
Reward summary: unpaid balance, current month earnings, lifetime total, paid out, and 6-month trend.
Parameters: None
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.earnings_summary"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.earnings_summary"}
)
earnings = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "publisher.earnings_summary" })
});
const { data } = await resp.json();
publisher.earnings_payouts
Payout history including gross reward, withholding tax, transfer fee, and net payout amount.
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number |
per_page | integer | Items per page |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.earnings_payouts"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.earnings_payouts"}
)
payouts = resp.json()["data"]["payouts"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "publisher.earnings_payouts" })
});
const { data } = await resp.json();
publisher.notifications_list
List notifications. Optionally filter by unread status.
| Parameter | Type | Description |
|---|---|---|
unread_only | boolean | Return unread notifications only |
page | integer | Page number |
per_page | integer | Items per page |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.notifications_list",
"params": {"unread_only": true}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.notifications_list",
"params": {"unread_only": True}
}
)
notifications = resp.json()["data"]["notifications"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.notifications_list",
params: { unread_only: true }
})
});
const { data } = await resp.json();
publisher.notifications_read WRITE
Mark notifications as read. Specify an ID to mark a single notification, or omit to mark all as read.
| Parameter | Type | Description |
|---|---|---|
notification_id | integer | Notification ID (omit to mark all as read) |
curl
# Mark a specific notification as read
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "publisher.notifications_read",
"params": {"notification_id": 5}
}'
# Mark all notifications as read
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "publisher.notifications_read"}'
Python
import requests
# Mark a specific notification as read
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "publisher.notifications_read",
"params": {"notification_id": 5}
}
)
# Mark all notifications as read
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "publisher.notifications_read"}
)
JavaScript
// Mark a specific notification as read
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "publisher.notifications_read",
params: { notification_id: 5 }
})
});
8. Agent Endpoints (6)
Exclusive to the agent role. Ideal for A2A traffic routing and IoT device integration.
agent.recommend
Recommend matching programs based on user requirements. Ideal for A2A traffic routing.
| Parameter | Type | Description |
|---|---|---|
use_case | string | Use case (e.g. code generation, image generation) |
category_slug | string | Category slug |
category_id | integer | Category ID |
reward_type | string | cpa / cpc / cpi |
limit | integer | Number of results (default: 5, max: 20) |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.recommend",
"params": {
"use_case": "画像生成",
"limit": 5
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.recommend",
"params": {
"use_case": "画像生成",
"limit": 5
}
}
)
recommendations = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.recommend",
params: {
use_case: "画像生成",
limit: 5
}
})
});
const { data } = await resp.json();
agent.program_detail
Retrieve public program info plus creatives. Used to inspect recommendation results in detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
program_id | integer | Required | Program ID |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.program_detail",
"params": {"program_id": 42}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.program_detail",
"params": {"program_id": 42}
}
)
program = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.program_detail",
params: { program_id: 42 }
})
});
const { data } = await resp.json();
agent.track_click WRITE
Record a click from an agent. The context field captures device or channel type.
| Parameter | Type | Required | Description |
|---|---|---|---|
partnership_id | integer | Required | Partnership ID |
context | string | voice-assistant / iot-device / chatbot, etc. | |
user_agent | string | User agent string |
Response: click_id, tracking_url, lp_url
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.track_click",
"params": {
"partnership_id": 15,
"context": "voice-assistant"
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.track_click",
"params": {
"partnership_id": 15,
"context": "voice-assistant"
}
}
)
result = resp.json()["data"]
# {"click_id": 123, "tracking_url": "https://...", "lp_url": "https://..."}
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.track_click",
params: {
partnership_id: 15,
context: "voice-assistant"
}
})
});
const { data } = await resp.json();
agent.record_conversion WRITE
Record a conversion. Use order_id to prevent duplicates.
| Parameter | Type | Required | Description |
|---|---|---|---|
tracking_code | string | Required | Tracking code (32-char hex) |
order_id | string | Order ID (for deduplication) | |
amount | integer | Conversion amount (JPY) |
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{
"action": "agent.record_conversion",
"params": {
"tracking_code": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"order_id": "ORDER-001",
"amount": 9800
}
}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={
"action": "agent.record_conversion",
"params": {
"tracking_code": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"order_id": "ORDER-001",
"amount": 9800
}
}
)
result = resp.json()["data"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({
action: "agent.record_conversion",
params: {
tracking_code: "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
order_id: "ORDER-001",
amount: 9800
}
})
});
const { data } = await resp.json();
agent.catalog
Full public program catalog (lightweight: name, category, and reward only). Suitable for initial load or caching.
Parameters: None
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "agent.catalog"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "agent.catalog"}
)
catalog = resp.json()["data"]["programs"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "agent.catalog" })
});
const { data } = await resp.json();
agent.categories
Category list with program counts.
Parameters: None
curl
curl -X POST https://agentclick.ai/api/mcp.php \
-H "Content-Type: application/json" \
-H "Authorization: Bearer aa_your_api_key" \
-d '{"action": "agent.categories"}'
Python
import requests
resp = requests.post(
"https://agentclick.ai/api/mcp.php",
headers={"Authorization": "Bearer aa_your_api_key"},
json={"action": "agent.categories"}
)
categories = resp.json()["data"]["categories"]
JavaScript
const resp = await fetch("https://agentclick.ai/api/mcp.php", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer aa_your_api_key"
},
body: JSON.stringify({ action: "agent.categories" })
});
const { data } = await resp.json();
9. Error Codes
| HTTP Status | Meaning | Resolution |
|---|---|---|
400 | Bad Request | Check the request format or parameters |
401 | Unauthorized | API key is invalid or missing |
403 | Forbidden | Your role does not have access to this action |
404 | Not Found | The specified resource does not exist |
409 | Conflict | Duplicate (existing partnership, duplicate order_id, etc.) |
422 | Unprocessable | Missing required parameters |
429 | Too Many Requests | Rate limit exceeded. Wait one minute and retry |
Error response format:
{
"success": false,
"message": "Error description"
}
10. Role-based Access
| Role | Common (5) | Publisher (13) | Agent (6) |
|---|---|---|---|
publisher | Yes | Yes | No |
advertiser | Yes | No | No |
agent | Yes | Yes | Yes |
The agent role has access to all publisher and agent endpoints, making it ideal for autonomous AI agent operations.
11. Python Sample Code
Sample code for calling the REST API directly from Python using the requests library.
Setup
# Install requests if not already installed
pip install requestsBasic Usage
import requests
API_URL = "https://agentclick.ai/api/mcp.php"
API_KEY = "aa_your_api_key"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
def call(action, params=None):
res = requests.post(API_URL, json={"action": action, "params": params or {}}, headers=HEADERS)
res.raise_for_status()
return res.json()
# Get program catalog
catalog = call("agent.catalog")
for program in catalog["data"]:
print(program["name"], program["reward_amount"])Program Search and Partnership
# Keyword search
results = call("publisher.programs_search", {"keyword": "AI", "reward_type": "cpa"})
# Apply for a partnership
partnership = call("publisher.partnerships_apply", {"program_id": 1})
# Generate affiliate link
link = call("publisher.links_generate", {"partnership_id": partnership["data"]["id"]})Agent Usage
# Get recommended programs
recommendations = call("agent.recommend", {"use_case": "chatbot development", "limit": 5})
# Record a click
click = call("agent.track_click", {"partnership_id": 1, "context": "line-bot"})
# Record a conversion
call("agent.record_conversion", {"tracking_code": "abc123...", "amount": 5000})12. JavaScript Sample Code
Sample code for calling the REST API directly from Node.js or a browser using the fetch API.
Basic Usage
const API_URL = 'https://agentclick.ai/api/mcp.php'
const API_KEY = 'aa_your_api_key'
async function call(action, params = {}) {
const res = await fetch(API_URL, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ action, params })
})
if (!res.ok) throw new Error(await res.text())
return res.json()
}
// Get program catalog
const catalog = await call('agent.catalog')
catalog.data.forEach(p => console.log(p.name, p.reward_amount))Program Search and Partnership
// Keyword search
const results = await call('publisher.programs_search', { keyword: 'AI', reward_type: 'cpa' })
// Apply for a partnership
const partnership = await call('publisher.partnerships_apply', { program_id: 1 })
// Generate affiliate link
const link = await call('publisher.links_generate', { partnership_id: partnership.data.id })Agent Usage
// Get recommended programs
const recs = await call('agent.recommend', { use_case: 'chatbot', limit: 5 })
// Record a click
const click = await call('agent.track_click', { partnership_id: 1, context: 'x-bot' })
// Record a conversion
await call('agent.record_conversion', { tracking_code: 'abc123...', amount: 5000 })Start Building Today
Sign up for free and get your API key. Start integrating with AI agents right away.
Want to start affiliate marketing?
Sign Up as Publisher (Free)
For advertisers looking to promote
Advertise for Free