# DigitalPublic Platform — AI Agent API # https://platform.digitalpublic.com # Canonical commercial version: 2026-09-10-trial-active-projects-v1 DigitalPublic exposes a public API surface for external AI agents. Agents do not need repository access. They discover the global contract from OpenAPI, then use a project API key to discover the capabilities enabled for that specific project. ## Start here: install DigitalPublic with OAuth OAuth 2.1 Authorization Code with PKCE is the recommended connection path for DigitalPublic. A human selects the project and grants the effective permission; the agent never receives a provider credential in chat. After authorization, call onboarding status and discovery: GET https://platform.digitalpublic.com/api/agent/onboarding-status Advanced clients may use a portal-issued bearer credential and call discovery: curl -X POST https://platform.digitalpublic.com/api/agent/discover \ -H "Authorization: Bearer dpk_YOUR_TOKEN" \ -H "Content-Type: application/json" -d '{}' Two advanced compatibility credential shapes remain available: - `dpk_…` — project API key. Carries its project implicitly. Nothing else needed. - `dpa_…` — global agent token. Add the project with the `projectId` query parameter, the `X-DigitalPublic-Project-Id` header, or a `projectId` body field. `GET /api/agent/projects` lists the projects the token can reach. The same credential works on the operational MCP server at `https://platform.digitalpublic.com/api/mcp` — send it as `Authorization: Bearer …`. OAuth is recommended. Advanced bearer and `mcp-remote` setup is at https://digitalpublic.com/developers/mcp Credential handling: tokens belong in the connector configuration or in an environment variable of your runtime. Never paste one into a chat transcript, and never ask a human to. Without a token, connect DigitalPublic Commercial and start the human-verified live trial described below. ## Public Discovery - `GET /api/openapi` - Public OpenAPI 3.1 specification. - Describes auth, request formats, endpoints, tools, resources, examples, and approval-oriented mutation flows. - `GET /llms.txt` - This file. Short LLM-oriented entrypoint. - `GET /api/connections/catalog` - Public provider catalog with authentication modes, requested scopes, human prerequisites, rollout wave, operational modules and readiness. ## Authenticated Discovery All project-aware endpoints require: Authorization: Bearer dpk_YOUR_API_KEY Authorization: Bearer dpa_YOUR_AGENT_TOKEN (add a projectId, see above) Credentials may have `read` and/or `write` scopes; write scope is required for mutations. A human creates advanced bearer credentials in project settings. Live trials allow supervised writing. Sensitive actions still require explicit human approval. - `POST /api/agent/discover` - Call this first after receiving an API key. - Returns connected services, scopes, endpoint catalog, available tools, resource operations, compatibility notes, examples, and recommended flows for the project linked to the key. - `project.activeServices` states which services are actually being worked on for that client. Every active connection is deliberate: it is the signal that DigitalPublic manages that service for the project. - A project may legitimately run only SEO, only analytics, or only email. The absence of advertising campaigns is not evidence that nothing is contracted — read `project.activeServices` before concluding anything about scope. - `project.crmService` (null when DigitalPublic CRM is not configured) says where the project's CRM and project email live: `state` is `INTEGRATED` (they live in DigitalPublic CRM; `dp_crm_*` and the email tools of `dp_projects_*` delegate there), `MIRROR` (the CRM holds a read-only copy), `NOT_IMPORTED` or `UNKNOWN` (the CRM did not answer). `crmProjectUrl` is the project's page in the CRM. - `POST /api/projects/agent-query` - Use `{ "tool": "get_project_info", "params": {} }` to load project context, URL, instructions, defaults, and connected service summary. - `POST /api/mcp` - Remote MCP endpoint. Send the same bearer API key. - Exposes `dp_discover_project` plus dynamic tools generated from `/api/openapi` and filtered by `/api/agent/discover`. - Read API keys list read tools only. API keys with `write` scope also list write tools, using DigitalPublic approval/auto-approval/audit flows. - `POST /api/connections/agent-query` - Discover providers, connection requirements, current status, assets, supervised actions and health. - `POST /api/connections/agent-mutate` - An agent may call `start_connection` and return the `humanAuthorizationUrl` to an account owner/admin. The agent must never ask for OAuth tokens in chat and cannot grant consent on the human's behalf. - Asset selection can continue after consent. Disconnect is always a supervised request: agent requests, human approves, agent or human executes. ## MCP Usage Remote MCP: URL: https://platform.digitalpublic.com/api/mcp Authorization: Bearer dpk_YOUR_API_KEY With a `dpa_` token, select the project in the URL: `https://platform.digitalpublic.com/api/mcp?projectId=YOUR_PROJECT_ID` Connector configuration, for clients that accept custom headers: { "mcpServers": { "digitalpublic": { "url": "https://platform.digitalpublic.com/api/mcp", "headers": { "Authorization": "Bearer dpk_YOUR_TOKEN" } } } } For clients that cannot send custom headers (Claude Desktop, Claude Code), use the `mcp-remote` bridge: { "mcpServers": { "digitalpublic": { "command": "npx", "args": [ "-y", "mcp-remote", "https://platform.digitalpublic.com/api/mcp", "--header", "Authorization: Bearer dpk_YOUR_TOKEN" ] } } } Read the token from the environment instead of inlining it whenever the client supports it. The public commercial server needs no credential at all: `https://platform.digitalpublic.com/api/mcp-commercial` Local stdio MCP: DIGITALPUBLIC_BASE_URL=https://platform.digitalpublic.com \ DIGITALPUBLIC_API_KEY=dpk_YOUR_API_KEY \ npm run mcp:digitalpublic For local stdio, write tools are hidden unless explicitly enabled: DIGITALPUBLIC_MCP_WRITE_ENABLED=true The MCP never calls provider APIs directly. WordPress, Brevo, Google Ads, Analytics, GTM, Google Business, CRM, social and email operations all go through DigitalPublic endpoints and preserve platform permissions, approvals and audit logs. Provider connections support OAuth, DigitalPublic-managed infrastructure and BYO credentials according to the connector. BYO requires an active Partner or Enterprise plan and credentials are entered only in the protected human portal. Tokens are encrypted at rest and assets are bound explicitly to projects with READ or WRITE permission. A connection can exist before its commercial module is purchased; actual service operations remain limited by plan and project entitlement. ## Request Format Most read endpoints accept: { "tool": "tool_name", "params": {} } Most mutation endpoints accept one of these formats: { "resource": "resource_name", "operation": "create | update | delete | ...", "data": [{ }], "agent_note": "Why this change is needed" } or a tool-specific `{ "tool": "...", "params": { ... } }` payload when the endpoint documents tool-based mutations. ## Current Public Agent Endpoints - `POST /api/agent/discover` — project-specific capability discovery. - `POST /api/connections/agent-query`: connection catalog, requirements, status, assets, actions and health. - `POST /api/connections/agent-mutate`: human-consented onboarding, asset selection and supervised disconnect workflow. - `POST /api/projects/agent-query` — project context and email drafts. - `POST /api/google-ads/agent-query` — Google Ads, Merchant Center, reports, Display, Performance Max, assets, audiences, negatives, GAQL, and diagnostics. - `POST /api/google-ads/agent-mutate` — allowlisted Google Ads and Merchant mutations with risk-based approval. - `POST /api/meta-ads/agent-query` — Meta Ads / Facebook Ads connection status, campaigns, ad sets, ads, creatives, insights, diagnostics, and pending mutation status. - `POST /api/meta-ads/agent-mutate` — create paused campaigns/ad sets/ads, update safe fields, pause/enable campaigns, and queue risky changes for approval with write scope and audit logging. - `POST /api/google-tag-manager/agent-query` — GTM container, workspaces, tags, triggers, variables, templates, environments, versions, preview, and mutation status. - `POST /api/google-tag-manager/agent-mutate` — GTM workspace/container/version mutations with approval. - `POST /api/analytics/agent-query` — GA4 traffic, channels, pages, devices, countries, key events, audiences, and Google Ads links. - `POST /api/analytics/agent-mutate` — GA4 audiences, key events, and Google Ads links. - `POST /api/seo-tools/agent-query` — SEO domain, keywords, backlinks, competitors, SERP, AI visibility, and reports. - `POST /api/aeo/agent-query` — AI search visibility across AI answer engines. - `POST /api/search-console/agent-query` — Search Console performance data. - `POST /api/search-console/agent-mutate` — queue sitemap submit/delete mutations for approval. - `POST /api/wordpress-seo/agent-query` — WordPress status, posts/pages, SEO data, menus, builder detection, performance helpers, plugins, widgets, and pending mutation status. - `POST /api/wordpress-seo/agent-mutate` — WordPress SEO, publishing, menus, media, settings, performance, widgets, Customizer, Yoast, and plugin changes. Never call `/wp-json/dp-seo/v1/...` directly. - `POST /api/google-business/agent-query` — Google Business Profile location, attributes, performance, and posts. - `POST /api/google-business/agent-mutate` — Google Business Profile location updates and local posts. - `POST /api/mailings/agent-query` — Brevo-backed mailing campaigns, audiences, images, metrics, and pending sends. - `POST /api/mailings/agent-mutate` — create/update/test/send mailings and manage mailing images. - `POST /api/crm/agent-query` — leads, interactions, pipeline summary, and exportable segments. - `POST /api/crm/agent-mutate` — create/update/archive leads, interactions, stage changes, next actions, opt-outs, and Brevo segment sync. - `POST /api/social/agent-query` — organic X accounts, profiles, posts, mentions, followers, following, search, and mutation status. - `POST /api/social/agent-mutate` — organic X posts, replies, reposts, follows, and likes with approval controls. - `POST /api/comments/agent-query` — list, post, edit, and delete project comments. - `POST /api/reports/upload` — upload external reports. - `GET /api/reports/file/{reportId}` — download uploaded reports. MCP exposes these as `dp_reports_upload_report` using `fileBase64` and `dp_reports_get_report_file` returning base64 content. - `POST /api/agent/schedule` — list project tasks/subtasks and record external agent executions/messages with `tool` and `params`. ## Real live-trial enrollment DigitalPublic Commercial is the public entry point and has no access to customer projects or provider data: 1. Connect `https://platform.digitalpublic.com/api/mcp-commercial` without auth. 2. Call `dp_commercial_start_live_trial` with email, real project URL, runtime and an idempotency key. 3. A human verifies the email. DigitalPublic creates one real project with no synthetic dataset. The trial allows up to three active projects per account. 4. A human connects at least one provider account. Up to five tools may be connected during the trial; accounts within one tool share a connection slot. 5. Call `dp_commercial_get_install_options`, then the human installs the authenticated DigitalPublic product and grants project OAuth consent. 6. Call `dp_onboarding_get_status`, use only read tools and produce the first diagnostic in the agent conversation. The trial lasts 14 days, includes 2,000 total units and needs no card. It never returns an operational credential in chat. Illustrative samples are synthetic and are never presented as live customer data. ## Recommended Agent Flow 1. Read `GET /api/openapi`. 2. Prefer project OAuth. Use `dpk_...` or `dpa_...` only when a project admin deliberately chooses an advanced bearer configuration. 3. Call `POST /api/agent/discover`. 4. Call `POST /api/projects/agent-query` with `get_project_info`. 5. If a required provider is missing, inspect it with `get_connection_requirements`, call `start_connection`, and give the human the returned authorization URL. 6. Use only endpoints returned as relevant/connected by discovery. 7. For visible or risky changes, send a clear `agent_note` and wait for `check_mutation_status` or human approval where required. 8. Record findings with comments or report/email draft tools when useful.