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
}'
import requests
import json
url = "https://mythic-analytics.gulp.workers.dev/client/v1/destinations"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"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
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://mythic-analytics.gulp.workers.dev/client/v1/destinations", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"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
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"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
}`)
req, err := http.NewRequest("POST", "https://mythic-analytics.gulp.workers.dev/client/v1/destinations", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://mythic-analytics.gulp.workers.dev/client/v1/destinations')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"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
}'
response = http.request(request)
puts response.body
{
"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"
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Forbidden",
"message": "You don't have permission to access this resource",
"code": 403
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
{
"error": "Error",
"message": "Upstream data store returned an error.",
"code": 502
}
/client/v1/destinations
Target server for requests. Edit to use your own host.
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.
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.
The media type of the request body
Human-readable destination name.
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.
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 in seconds. Must be positive. Defaults to 3600 (1 hour).
Request Preview
Response
Response will appear here after sending the request
Authentication
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
webhookmeta_capigoogle_adsgoogle_analyticsopenai_adsconvert_experimentsConditions 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.
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 in seconds. Must be positive. Defaults to 3600 (1 hour).