API reference

REST API v1, webhooks and MCP — scoped keys, JSON in, JSON out.

Authentication

Create an API key in Settings → API Keys and send it as a bearer token. Keys are scoped per capability, rate-limited per minute, hashed at rest and bound to your organization.

curl https://adneticai.com/api/v1/brands \
  -H "Authorization: Bearer adk_live_..." \
  -H "Content-Type: application/json"

Endpoints

MethodPathScopeDescription
GET/api/v1/brandsbrands:readList brands
POST/api/v1/brandsbrands:writeCreate a brand
GET/api/v1/brands/:idbrands:readFetch a brand with its products
GET/api/v1/actorscreatives:readList actors available to the workspace
POST/api/v1/generations/videogenerations:createQueue a video generation (idempotent)
GET/api/v1/jobs/:idcreatives:readPoll a generation job
GET/api/v1/webhookswebhooks:manageList webhook endpoints
POST/api/v1/webhookswebhooks:manageRegister an endpoint (secret returned once)
GET/api/v1/webhooks/:idwebhooks:manageFetch an endpoint with recent deliveries
DELETE/api/v1/webhooks/:idwebhooks:manageDelete an endpoint

Idempotency

POST /api/v1/generations/video accepts an Idempotency-Key header. Replaying the same key returns the original job (with replayed: true) instead of creating — and charging — a new one. Keys are namespaced per organization.

Webhooks

Register endpoints on the Developers page or via the API. Endpoints must be public HTTPS URLs. The signing secret is returned exactly once at registration. Deliveries are retried up to 5 times with exponential backoff.

Every delivery carries these headers:

X-Adnetic-Event:      generation.completed
X-Adnetic-Delivery:   <delivery id>
X-Adnetic-Timestamp:  <unix seconds>
X-Adnetic-Signature:  v1=<hex HMAC-SHA256>

The signature is HMAC_SHA256(secret, `${timestamp}.${rawBody}`). Verify by recomputing it over the exact raw request body and comparing with a constant-time equality check, and reject timestamps older than 5 minutes to prevent replays:

import { createHmac, timingSafeEqual } from "node:crypto";

function verify(secret, timestamp, rawBody, signature) {
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  const expected = "v1=" + createHmac("sha256", secret)
    .update(`${timestamp}.${rawBody}`)
    .digest("hex");
  return timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

Events emitted today:

creative.createdA creative record was created for a queued generation
creative.approvedA creative was approved (internal review or client link)
generation.queuedA generation was accepted and credits were reserved
generation.completedThe render finished; payload includes credits charged
generation.failedThe render failed; credits were released
localization.completedA localization re-render finished
workflow.completedAn Autopilot run finished rendering its plan
workflow.failedAn Autopilot run failed during planning
campaign.approvedEvery active creative of an in-review campaign was approved
credits.lowA reservation took the balance below 100 credits
test.pingSent by the endpoint test button / test action

MCP server

The Model Context Protocol server is live at /api/mcp (Streamable HTTP). Authenticate with the same adk_… API keys as bearer tokens; each tool enforces the matching REST scope and calls the same application services.

ToolRequired scope
list_brandsbrands:read
list_actorscreatives:read
list_creativescreatives:read
generate_hookscampaigns:write
generate_scriptcampaigns:write
estimate_video_creditsgenerations:create
create_ugc_videogenerations:create
get_generationcreatives:read

Errors

Errors are JSON: { "error": { "code", "message" } }. Notable codes: 402 insufficient_credits, 422 compliance_blocked (the content failed the server-side compliance review; the message names the finding and a suggested fix), 429 rate_limited, and 503 when no provider or queue is configured for the workspace.