DestinationsCreate destination

Create destination

Create a destination for the calling location. Requires an agency (ak_) key. The action_config shape is validated against action_type. HIPAA-enabled locations reject http:// webhook URLs.

curl -X POST "https://mythic-analytics.gulp.workers.dev/client/v1/destinations" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "Purchase → Meta",
  "action_type": "webhook",
  "trigger_rules": {
    "operator": "AND",
    "rules": [
      {
        "type": "mythic_event",
        "eventName": "purchase",
        "operator": "equals"
      }
    ]
  },
  "action_config": {
    "url": "https://hooks.example.com/mythic",
    "method": "POST",
    "headers": {},
    "body_template": "example_string",
    "timeout_ms": 3.14,
    "retry_count": 3.14,
    "enrichment": {
      "enabled": true,
      "attribution_model": "last_touch"
    }
  },
  "enabled": true,
  "rate_limit_max": 3.14,
  "rate_limit_window_seconds": 3.14
}'
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "tenant_key": "example_string",
    "name": "Purchase → Meta",
    "action_type": "webhook",
    "trigger_rules": {
      "operator": "AND",
      "rules": [
        {
          "type": "mythic_event",
          "eventName": "purchase",
          "operator": "equals"
        }
      ]
    },
    "action_config": {},
    "enabled": true,
    "rate_limit_max": 42,
    "rate_limit_window_seconds": 42,
    "trigger_count": 10,
    "last_triggered_at": "2024-12-25T10:00:00Z",
    "last_error": "example_string",
    "created_at": "2024-12-25T10:00:00Z",
    "updated_at": "2024-12-25T10:00:00Z"
  }
}
POST
/client/v1/destinations
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.

Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.
Content-Typestring
Required

The media type of the request body

Options: application/json
namestring
Required

Human-readable destination name.

Min length: 1
action_typestring
Required
Options: webhook, meta_capi, google_ads, google_analytics, openai_ads, convert_experiments
trigger_rulesobject
Required

Conditions that gate whether a destination fires for a given event. For server-side delivery, the only rule type that filters on the event name is mythic_event (with an eventName and an operator). Unknown types are rejected with 400 invalid_config. See the "Trigger rules" section of the overview for the full field-by-field contract and how this interacts with event_mapping.

rate_limit_maxnumber

Per-destination rate cap. Must be positive. Deliveries beyond the cap within the window are dropped (logged as status skipped, rate_limited). Defaults to 10000 when omitted.

rate_limit_window_secondsnumber

Rate-limit window in seconds. Must be positive. Defaults to 3600 (1 hour).

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Client key as bearer token. Use an agency key (Bearer ak_...) for read-write access or a location secret key (Bearer sk_...) for read-only access. Scoped keys (mcp_) are accepted too and need destinations:read or destinations:write. See Using an mcp_ key over HTTP.

Body

application/json
namestring
Required

Human-readable destination name.

Example:
Purchase → Meta
action_typestring
Required
Allowed values:webhookmeta_capigoogle_adsgoogle_analyticsopenai_adsconvert_experiments
trigger_rulesobject
Required

Conditions that gate whether a destination fires for a given event. For server-side delivery, the only rule type that filters on the event name is mythic_event (with an eventName and an operator). Unknown types are rejected with 400 invalid_config. See the "Trigger rules" section of the overview for the full field-by-field contract and how this interacts with event_mapping.

rate_limit_maxnumber

Per-destination rate cap. Must be positive. Deliveries beyond the cap within the window are dropped (logged as status skipped, rate_limited). Defaults to 10000 when omitted.

rate_limit_window_secondsnumber

Rate-limit window in seconds. Must be positive. Defaults to 3600 (1 hour).

Responses