Create destination

Stores the addressed platform's non-secret ids (its measurement, pixel or dataset ids) and seals its API credential into KMS under a path scoped to the caller's own org, then answers the same status card the read routes do — with live telling you whether the credential actually resolves right now.

POST /v1/destination/{platform}

Addresshttps://api.hanzo.ai/v1/destination/{platform}
MethodPOST
Operationpost_destination_by_platform
AuthAuthorization: Bearer $HANZO_API_KEY

Stores the addressed platform's non-secret ids (its measurement, pixel or dataset ids) and seals its API credential into KMS under a path scoped to the caller's own org, then answers the same status card the read routes do — with live telling you whether the credential actually resolves right now. The body's property NAMES are the platform's own: each field the platform declares, plus each secret under its camelCase name, so the accepted keys differ per platform and a missing REQUIRED field is refused. Connecting is an ORG ADMIN action — a validated member without the admin bit gets 403 — and it fails closed with 503 when the KMS master key is unavailable rather than persisting a destination whose secret was never sealed. The secret itself never appears in the response, in the store, or in a log line; only its NAME is ever published. Set enabled to false to keep the connection but stop the analytics fan-out to it.

Request

2 fields, body application/json.

FieldInTypeRequiredDescription
platformpathstringyes
*bodyany—

Response

StatusBodyMeaning
2XXDestinationStatusSuccess

2XX body — 16 fields.

FieldInTypeAlwaysDescription
accountbodystring—
categorybodystring—
configbodyobject—
config.*bodystring—
connectedbodyboolean—
enabledbodyboolean—
fieldsbodyDestinationField[]—
fields[].examplebodystring—
fields[].keybodystring—
fields[].labelbodystring—
fields[].requiredbodyboolean—
livebodyboolean—
namebodystring—
pixelbodyboolean—
platformbodystring—
secretsbodystring[]—

Failure carries the platform error shape — see Errors.

Examples

hanzo destination add <platform>
import { Configuration, DestinationApi } from 'hanzoai';

const api = new DestinationApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postDestinationByPlatform({ platform: 'platform' });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DestinationApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DestinationApi(client).post_destination_by_platform(platform='platform')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.DestinationAPI.PostDestinationByPlatform(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, destination_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = destination_api::post_destination_by_platform(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DestinationApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new DestinationApi(client).postDestinationByPlatform();
curl -X POST https://api.hanzo.ai/v1/destination/<platform> \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches destination through the destination tool, which names its 4 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_destinations"
         }
       }
     }'

Destination API · All Hanzo APIs · Interactive reference

Was this page useful?