Complete reference for the YodAI REST API. Create API keys in your dashboard Settings > API tab.
Public download for Apple silicon Macs (M1 or newer). No API key or GitHub login is needed to download.
Download Mac installer · Installation instructions · Release metadata and checksum
Check the metadata for the current version and signing status. The pilot is unsigned and unnotarized; updates are installed manually.
Authorization: Bearer ym_live_xxxxxxxxxxxxxcurl
curl -H "Authorization: Bearer ym_live_xxxxx" \
https://yodai.app/api/v1/clientsJavaScript
const res = await fetch('https://yodai.app/api/v1/clients', {
headers: { 'Authorization': 'Bearer ym_live_xxxxx' }
});
const { data } = await res.json();Python
import requests
r = requests.get('https://yodai.app/api/v1/clients',
headers={'Authorization': 'Bearer ym_live_xxxxx'})
data = r.json()['data']// Success
{ "data": { ... }, "meta": { "timestamp": "...", "request_id": "..." } }
// Paginated
{ "data": [...], "pagination": { "total": 50, "page": 1, "per_page": 20, "total_pages": 3 }, "meta": {...} }
// Error
{ "error": { "code": "VALIDATION_ERROR", "message": "..." }, "meta": {...} }Read operations: 100 req/min | Write operations: 30 req/min | AI operations: 10 req/min. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset (unix seconds); 429 responses also carry Retry-After (seconds).
Keep the two credentials separate
Management endpoints under /api/v1 require a scoped ym_live_ agency API key. Published storefront endpoints under /api/site-commerce require only the short-lived published-site capability delivered with that site. Never put an agency API key, provider credential or connector secret in browser code.
Configure WooCommerce hosted handoff, validate readiness, then queue an idempotent catalogue sync.
curl -X PUT https://yodai.app/api/v1/sites/SITE_ID/commerce \
-H "Authorization: Bearer ym_live_xxxxx" -H "Content-Type: application/json" \
-d '{"provider":"woocommerce","checkoutStrategy":"woo_hosted_handoff","integrationId":"33333333-3333-4333-8333-333333333333","catalogueSource":"hybrid","defaultCurrency":"NZD","enabled":true}'
curl -X POST https://yodai.app/api/v1/sites/SITE_ID/commerce/test \
-H "Authorization: Bearer ym_live_xxxxx"
curl -X POST https://yodai.app/api/v1/sites/SITE_ID/commerce/sync \
-H "Authorization: Bearer ym_live_xxxxx" -H "Content-Type: application/json" \
-d '{"resource":"catalogue","reason":"Initial WooCommerce import","idempotencyKey":"agent-run-00000001"}'
# Poll sanitized integration, webhook, sync, connector and job status.
curl -H "Authorization: Bearer ym_live_xxxxx" \
https://yodai.app/api/v1/integrations/INTEGRATION_ID/commerce/statusManagement rate limits: reads 100/min, writes 30/min, AI 10/min per API key.
Storefront rates are separately enforced per published capability, trusted IP and cart capability; inspect its OpenAPI extensions for exact limits.
Handle 409 as an idempotency/configuration conflict, 422 as validation or unsupported capability, 429 using Retry-After, and 503 as a temporary provider degradation.
Connect any MCP-compatible client to YodAI over HTTP using the Streamable HTTP transport. No local setup required.
POST https://yodai.app/api/mcpAuthentication uses the same Bearer token as the REST API. The endpoint is stateless — each request is independent with no session management.
tools/list returns the complete catalogue by default. When server-side paging is enabled the response includes a nextCursor; repeat tools/list with that cursor until it is absent. Neither the JavaScript nor the Python MCP SDK pages automatically, so follow the cursor yourself as shown below.
Claude Desktop / Claude Code
// .mcp.json or claude_desktop_config.json
{
"mcpServers": {
"yodai": {
"type": "url",
"url": "https://yodai.app/api/mcp",
"headers": {
"Authorization": "Bearer ym_live_xxxxx"
}
}
}
}curl (raw MCP protocol)
# One request — returns the whole catalogue unless paging is enabled
curl -X POST https://yodai.app/api/mcp \
-H "Authorization: Bearer ym_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# Forward-compatible: page until nextCursor is absent (needs jq)
cursor=''
while :; do
params='{}'; [ -n "$cursor" ] && params='{"cursor":"'"$cursor"'"}'
page=$(curl -s -X POST https://yodai.app/api/mcp \
-H "Authorization: Bearer ym_live_xxxxx" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":'"$params"'}')
echo "$page" | jq -r '.result.tools[].name'
cursor=$(echo "$page" | jq -r '.result.nextCursor // empty')
[ -z "$cursor" ] && break
doneJavaScript (MCP SDK)
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
const transport = new StreamableHTTPClientTransport(
new URL("https://yodai.app/api/mcp"),
{ requestInit: { headers: { "Authorization": "Bearer ym_live_xxxxx" } } }
);
const client = new Client({ name: "my-agent", version: "1.0.0" });
await client.connect(transport);
// listTools() does not auto-paginate — follow nextCursor until it is absent
const tools = [];
let cursor;
do {
const page = await client.listTools(cursor ? { cursor } : {});
tools.push(...page.tools);
cursor = page.nextCursor;
} while (cursor);
const result = await client.callTool({ name: "list_clients", arguments: {} });Python (MCP SDK)
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async with streamablehttp_client(
"https://yodai.app/api/mcp",
headers={"Authorization": "Bearer ym_live_xxxxx"}
) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
# list_tools() does not auto-paginate — follow nextCursor until absent
tools = []
cursor = None
while True:
page = await session.list_tools(cursor=cursor)
tools.extend(page.tools)
cursor = page.nextCursor
if not cursor:
break
result = await session.call_tool("list_clients", {})Rate limits: 100 requests/min per API key. Individual tool calls that hit the REST API internally are subject to their own per-endpoint rate limits (read: 100/min, write: 30/min, AI: 10/min).
Both transports expose the same complete tool registry for use with Claude, ChatGPT, and other AI agents.
Chatbot lead destination tools:
list_chatbot_lead_destinations, set_chatbot_lead_destinations, create_chatbot_lead_destination, update_chatbot_lead_destination, delete_chatbot_lead_destination, test_chatbot_lead_destination, list_chatbot_leads, get_chatbot_lead, update_chatbot_lead_status, list_chatbot_lead_deliveries, retry_chatbot_lead_deliveryChatbot configuration tools:
list_client_chatbots, create_client_chatbot, get_client_chatbot, update_client_chatbot, configure_client_chatbot, update_client_chatbot_brain, configure_client_chatbot_voice, configure_client_chatbot_lead_capture, set_client_chatbot_active, regenerate_client_chatbot_key, delete_client_chatbot, list_client_knowledge_sourcesKnowledge Bank tools (agency + client + facets):
list_agency_knowledge_sources, get_agency_knowledge_source, create_agency_knowledge_source, update_agency_knowledge_source, delete_agency_knowledge_source, reindex_agency_knowledge_source, get_agency_knowledge_source_clients, set_agency_knowledge_source_clients, list_agency_knowledge_folders, create_agency_knowledge_folder, update_agency_knowledge_folder, delete_agency_knowledge_folder, list_client_knowledge_sources, create_client_knowledge_source, get_client_knowledge_source, update_client_knowledge_source, delete_client_knowledge_source, reindex_client_knowledge_source, list_knowledge_facets, get_knowledge_facet, delete_knowledge_facet, merge_knowledge_facet, delete_knowledge_facet_value, merge_knowledge_facet_valueMemory security and temporal-chat tools:
list_agent_memories, get_agent_memory, list_memory_security_incidents, get_memory_security_incident, preview_memory_lifecycle_operation, execute_memory_lifecycle_operation, review_client_knowledge_source, get_chatbot_chat_session_config, update_chatbot_chat_session_config, get_agent_chat_session_config, update_agent_chat_session_config, list_chatbot_chat_sessions, get_chatbot_chat_session, list_agent_chat_sessions, get_agent_chat_sessionAgent voice tools:
get_agent_voice_options, create_agent_voice_session, execute_agent_voice_tool_call, persist_agent_voice_transcriptCoupon tools:
list_coupon_offers, get_coupon_offer, create_coupon_offer, update_coupon_offer, delete_coupon_offer, generate_coupon_code, list_coupon_codes, get_coupon_code, revoke_coupon_code, delete_coupon_code, update_coupon_code, set_coupon_code_enabled, get_coupon_value_schedule, preview_coupon_value_schedule, list_coupon_value_events, get_coupon_value_results, set_coupon_value_schedule, pause_coupon_value_schedule, resume_coupon_value_schedule, cancel_coupon_value_scheduleThe value schedule tools wrap the value schedule endpoints. The four read tools (get_coupon_value_schedule, preview_coupon_value_schedule, list_coupon_value_events, get_coupon_value_results) need coupons:read. The four write tools (set_coupon_value_schedule, pause_coupon_value_schedule, resume_coupon_value_schedule, cancel_coupon_value_schedule) need coupons:write and ask for confirmation. set_coupon_value_schedule needs expected_version (0 for a new schedule) and cancel_coupon_value_schedule needs confirm: true. Preview a schedule and show the user its terms text before setting it. A running schedule is immutable, so it can only be paused, resumed or cancelled. create_coupon_offer also accepts value_schedule: pass amount equal to the start value and leave expires_at out.
Image Tool MCP tools (generation is generate_image; image + folder CRUD live in the generated-media / media tools):
generate_image, get_image_tool_settings, update_image_tool_settings, get_image_branding_context, remove_image_background, autocrop_image, decompose_image_layers, ai_edit_image, apply_image_border, strip_image_metadata, list_image_studio_documents, get_image_studio_document, delete_image_studio_document, list_media_folders, create_media_folder, update_media_folder, delete_media_folder, reorder_media_foldersThe SKILL.md follows Anthropic's agent skill standard and provides AI agents with structured documentation for the entire YodAI API surface. It includes complete tool references, step-by-step workflows, and important behavioral notes.
Fetch via curl:
curl https://yodai.app/api/v1/skill-reference -o SKILL.mdBoard settings uses default_task_type (general or coding). New tasks inherit it when task_type is omitted. Changing board type leaves existing tasks unchanged. The task editor can convert a task separately.
Within a Coding task, coding_task_type selects the category below. The editor autosaves after a short pause and flushes on close. API and MCP clients read coding details first, then send expected_version (0 for a new brief). Omitted fields are retained; type_details replaces the whole object, so merge inactive fields before writing. Each brief value is optional text up to 4,000 characters.
| Category / API value | Brief fields (type_details) |
|---|---|
New featurenew_feature | feature_problem: Problem and user goalfeature_users: Users and workflowfeature_requirements: Functional requirementsfeature_integrations: Data and integrationsfeature_rollout: Rollout and success measures |
Bugbug | bug_expected: Expected behaviourbug_actual: Actual behaviourbug_environment: Affected versions and environmentbug_impact: Frequency and impactbug_evidence: Diagnostic evidence |
Update Featureupdate_feature | update_current: Current feature behaviourupdate_proposed: Requested changesupdate_reason: Reason for the updateupdate_compatibility: Compatibility and migrationupdate_regression: Regression coverage and rollout |
Design Changedesign_change | design_scope: Screens and componentsdesign_references: Design referencesdesign_behaviour: Layout and interactionsdesign_states: Responsive layouts and statesdesign_accessibility: Accessibility and visual checks |
Otherother | other_objective: Objective and contextother_scope: Work scopeother_output: Expected outputother_validation: Verification approach |
Planningplanning | planning_question: Goal or decision to resolveplanning_context: Current state and assumptionsplanning_options: Options to evaluateplanning_risks: Dependencies and risksplanning_output: Plan format and level of detail |
Testingtesting | testing_target: Test target and scopetesting_approach: Test approachtesting_scenarios: Scenarios and expected resultstesting_setup: Test environment and datatesting_evidence: Pass criteria and evidence |
Deploymentdeployment | deployment_release: Release and targetdeployment_prechecks: Pre-deployment checksdeployment_rollout: Rollout steps and windowdeployment_health: Health checks and abort criteriadeployment_rollback: Rollback and recovery |
Securitysecurity | security_finding: Finding or threatsecurity_impact: Severity and impactsecurity_scope: Authorised assessment scopesecurity_remediation: Remediation requirementssecurity_verification: Verification and evidence |
Sys Adminsys_admin | admin_systems: Systems and desired stateadmin_change: Change procedure and dependenciesadmin_impact: Impact and maintenance windowadmin_recovery: Backup and recoveryadmin_validation: Post-change verification |
Shared fields include repository/environment, base branch, responsible person/reviewer, acceptance criteria, constraints, paths, reproduction steps, priority, start/deadline, deliverable/completion policy, budget and attempts. The interactive OpenAPI schema lists their exact types and limits. The Bug category uses the shared reproduction_steps field.
MCP: use create_board_label/update_board_label for board type, create_card/update_card for task type, and get_coding_details/update_coding_details for coding briefs. Saving a brief never starts a run. Starting execution and human review use separate scoped operations below.
/api/v1/clients/{clientId}/magic-linksRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials.
/api/v1/clients/{clientId}/magic-linksRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. An object creates one draft link (201), with optional strict personalization.hosted.fields settings (Professional and Enterprise; a Starter link that lists fields is refused with a plan error, and one that omits them stores none). Optional personalization.external selects an active landing site owned by this client, plainParams, sealedFields and ttlSeconds (60–604800); plain parameters exclude email and lead identifiers, and their names cannot collide with tracking, affiliate or code names; status may be omitted or draft, and activation uses the status operation. An array imports 1–100 standard-link rows with name and url, optional slug/tags/notes/utm/status/fallback_when_broken (200). Bulk returns results with zero-based index, ok, link or sanitized error; a refused row does not stop other rows. No Idempotency-Key support: retrying a taken custom slug returns a conflict.
{
"name": "Launch",
"mode": "standard",
"destinations": [
{
"label": "Store",
"url_template": "https://store.example/launch"
}
]
}/api/v1/clients/{clientId}/magic-links/{linkId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials.
/api/v1/clients/{clientId}/magic-links/{linkId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. expected_version is required. A stale version returns 409; the service validates the final combined link state. status is not accepted here: use the status operation or DELETE to archive. personalization.hosted.fields is a strict allowlist of first_name, last_name, email, offer_code, variant, source and deadline. An empty list disables hosted personalization; last_name/email require opt-in. Turning a field on needs the Professional or Enterprise plan; turning fields off never does. personalization replaces both branches, so preserve the other branch when editing one. external selects siteId, plainParams, sealedFields and ttlSeconds; omit external to disable it. External enrichment requires an exact registered HTTPS origin, a temporary human redirect and non-Strict privacy. Lead fields require the issued token used by that click.
/api/v1/clients/{clientId}/magic-links/{linkId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Archives the link (click history is kept). The key creator must be a current non-bot agency owner or administrator.
/api/v1/clients/{clientId}/magic-links/{linkId}/destinationsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Replaces the whole destination list; expected_version is required and a stale version returns 409. A variant may carry conditions (countries, devices, os, languages, referrer_domains): the first active matching rule by position wins, and a link with rules keeps an active variant without conditions. A destination sent without conditions has none.
/api/v1/clients/{clientId}/magic-links/{linkId}/statusRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Accepts draft, active or paused. Use DELETE to archive. Restoring an archived link needs the key creator to be a current non-bot agency owner or administrator. A link changed between the authority check and the write returns 409; read it again and retry. Activation retains existing safety, attestation and plan checks.
/api/v1/clients/{clientId}/magic-links/{linkId}/duplicateRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. An empty body or {} is accepted. The copy is editable and counts against the normal plan limit.
/api/v1/clients/{clientId}/magic-links/{linkId}/codesRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Returns configured code rows and usage only. It never returns allocated coupon-pool bearer codes.
/api/v1/clients/{clientId}/magic-links/{linkId}/codesRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. At most 200 configured rows. IDs retain counters; uses and tenant metadata cannot be supplied.
/api/v1/clients/{clientId}/magic-links/{linkId}/statsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Without dimension returns clicks, human_clicks, bot_clicks, unique_visitors, qr_scans, by_decision and by_identity_method. With dimension returns {dimension, rows:[{value,clicks,human_clicks,unique_visitors}]}. The shared analytics budget is charged before aggregation.
/api/v1/clients/{clientId}/magic-links/{linkId}/clicksRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Paginated fields: click_id, created_at, decision, destination ({id,label} or null), is_bot, bot_reason, identity_method, source_tag, code, country, device, referrer_host and allowlisted UTM fields. The shared analytics budget applies. Code is a configured link code, never an issued pool bearer.
/api/v1/clients/{clientId}/magic-links/{linkId}/qrRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Encodes the saved link URL with the qr source tag. No arbitrary URL or request Host is used. Success is image/png or image/svg+xml with Cache-Control: private, max-age=300; failures are private, no-store.
/api/v1/clients/{clientId}/magic-links/domainsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials.
/api/v1/clients/{clientId}/magic-links/domainsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. The key creator must be a current non-bot agency owner or administrator. Enforces plan caps. Returns domain plus public ownership/CNAME DNS records; it does not bypass ownership verification or expose provider credentials.
/api/v1/clients/{clientId}/magic-links/domains/{domainId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. Reads saved state without triggering DNS/provider refresh. Infrastructure operator recovery is not part of this API.
/api/v1/clients/{clientId}/magic-links/domains/{domainId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. The key creator must be a current non-bot agency owner or administrator. Uses the existing safe provider cleanup and link migration service; returns moved_links and renamed_links. Moderation holds cannot be removed through this route.
/api/v1/clients/{clientId}/magic-links/settingsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials.
/api/v1/clients/{clientId}/magic-links/settingsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses exclude identity hashes, visitor/lead/token identifiers and private credentials. The key creator must still be a non-bot agency owner or administrator. A write scope alone is insufficient.
/api/v1/clients/{clientId}/magic-links/conversionsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Paginated rows with id, link_id, kind, event_name, source, attributed_by, value_minor, currency, verified, occurred_at and created_at, newest first. No lead, visitor or click identifiers, external id, source reference or metadata. from is inclusive and to exclusive; the range defaults to the 30 days before to and may span at most 400 days. The shared analytics budget applies.
/api/v1/clients/{clientId}/magic-links/conversionsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. kind plus at least one of click_id, code or link_id. A custom kind needs event_name; a sale needs external_id (at most 200 characters). value is an exact nonnegative decimal string sent with currency, or neither is sent. occurred_at may be at most five minutes after the server time. The server sets source api, the API key as source reference and verified true; callers cannot supply them. A new attributed conversion returns 201 with attributed, duplicate, conversion_id, link_id and attributed_by. Repeating an external_id returns 200 with duplicate true and records nothing new. Input that attributes to no link returns 200 with attributed false. A link_id of another client returns 404. No Idempotency-Key header support: external_id is the idempotency key.
/api/v1/clients/{clientId}/magic-links/{linkId}/spendRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Returns from, to, rows (id, day, amount_minor, currency, note, created_at) and totals by currency (amount_minor). The range defaults to the 90 days ending today and may span at most 366 days.
/api/v1/clients/{clientId}/magic-links/{linkId}/spendRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. amount is an exact nonnegative decimal string in the currency precision. Send day, or from and to (inclusive, at most 366 days); a range is split evenly across its days in minor units. A row for the same link, day and currency is replaced. Returns count.
/api/v1/clients/{clientId}/magic-links/{linkId}/spend/{spendId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Deletes only the named row of the path link. Returns deleted.
/api/v1/clients/{clientId}/magic-links/{linkId}/issueRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Exactly one of lead_ids (each a lead of this client, unique) or count, at most 1,000. max_uses (1 to 100) applies to anonymous links only. issued_at defaults to now and cannot be in the future. source_ref is an optional id-like label (no spaces, no email address). Returns 201 with links: [{lead_id, url, issued_at, deadline_at}]. Each url is a bearer link shown only in this response: deliver it to its recipient. A lead of another client returns 404 and issues nothing.
/api/v1/clients/{clientId}/magic-links/{linkId}/issuedRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Returns groups (source_kind, source_ref, issued, used, revoked, first_issued_at, last_issued_at) over the newest 500 tokens of the link, plus truncated. No token, URL or lead identifier.
/api/v1/clients/{clientId}/magic-links/{linkId}/issued/revokeRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Always limited to the path link. Send lead_id, token_ids (at most 1,000), or source_kind with source_ref (null selects the unlabelled group); filters combine. A body without one of them is refused, so this never revokes every issued link. Returns revoked, the number of live tokens revoked.
/api/v1/clients/{clientId}/magic-links/pixelsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Returns id, name, provider, public_id, conversion_label, is_active, created_at and updated_at.
/api/v1/clients/{clientId}/magic-links/pixelsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. provider is ga4, google_ads or meta, with that provider's public id; conversion_label is for Google Ads only. Google Tag Manager containers are refused.
/api/v1/clients/{clientId}/magic-links/pixels/{pixelId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. Change name, public_id, conversion_label (empty or null removes it) or is_active. The provider cannot change.
/api/v1/clients/{clientId}/magic-links/pixels/{pixelId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. Removes the pixel from the library and from every link that uses it.
/api/v1/clients/{clientId}/magic-links/{linkId}/pixelsRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. pixels holds at most five {pixel_id, event_name} pairs, each library pixel once, each event one its provider can fire. Replaces the whole set; an empty list removes every pixel. Returns the saved pairs.
/api/v1/clients/{clientId}/magic-links/postback-keysRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. Metadata only: id, label, key_prefix (the first 8 characters), allowed_ips, is_active, last_used_at, revoked_at and created_at. Never the key or its hash.
/api/v1/clients/{clientId}/magic-links/postback-keysRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. label and optional allowed_ips (CIDR networks). Returns 201 with postback_key metadata, key and the url_template and code_url_template that contain it. The key is shown only in this response.
/api/v1/clients/{clientId}/magic-links/postback-keys/{keyId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. Revoking an already revoked key succeeds. Returns revoked.
/api/v1/clients/{clientId}/magic-links/sitesRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. Metadata only: id, name, public_key, allowed_origins, status, secret_kid, previous_expires_at, version, created_at and updated_at. No secret.
/api/v1/clients/{clientId}/magic-links/sitesRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. name and allowed_origins (1 to 10 exact HTTPS origins, without a path). Returns 201 with site and secret; the secret is shown again only by rotate-secret or reveal-secret. Plan site limits apply.
/api/v1/clients/{clientId}/magic-links/sites/{siteId}Requires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. expected_version is required; a stale version returns 409. Change name or allowed_origins. Returns the site without its secret.
/api/v1/clients/{clientId}/magic-links/sites/{siteId}/rotate-secretRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. expected_version is required. Returns site and the new secret; the previous secret keeps working for seven days.
/api/v1/clients/{clientId}/magic-links/sites/{siteId}/reveal-secretRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. Body is an empty object. Returns site and its current secret. Every reveal is recorded in the activity log, without the secret.
/api/v1/clients/{clientId}/magic-links/settings/issue-secretRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. Returns null when there is no key, otherwise kid, created_at, updated_at, previous_kid and previous_expires_at. There is no operation that reveals the issue secret.
/api/v1/clients/{clientId}/magic-links/settings/issue-secretRequires the named scope, current client access, MagicLinks feature flag and plan entitlement. The client comes from the path; foreign and missing resources return the same 404. Responses are private, no-store. The key creator must also be a current non-bot agency owner or administrator. action create returns 201 and is refused when a key already exists; action rotate returns 200 and keeps the previous key for its grace window. Both return kid, secret and previous_expires_at. The secret is shown only in this response.