ProvisioningAttach a custom tracking hostname

Attach a custom tracking hostname

Claim a first-party tracking hostname for this client. Returns the CNAME target to configure in DNS.

The hostname does not route events until Cloudflare confirms that CNAME — kv_sync reads pending_validation until then. Poll GET /client/v1/locations/hostname until the status is active. A hostname already attached to another location is refused with hostname_taken.

curl -X PUT "https://mythic-analytics.gulp.workers.dev/client/v1/locations/hostname?location_id=example_string" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "hostname": "analytics.example.com"
}'
{
  "success": true,
  "data": {
    "hostname": "analytics.example.com",
    "status": "pending_validation",
    "cname_target": "John Doe",
    "dns_instructions": "example_string",
    "kv_sync": "synced"
  }
}
PUT
/client/v1/locations/hostname
PUT
Base URLstring

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

Bearer Token
Bearer Tokenstring
Required

Agency key (ak_) or location secret key (sk_). Writes require an agency key; creating a client requires an agency-wide key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too: locations:read/locations:write for one client's setup, and provisioning:write to create a client. See Using an mcp_ key over HTTP.

Agency key (ak_) or location secret key (sk_). Writes require an agency key; creating a client requires an agency-wide key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too: locations:read/locations:write for one client's setup, and provisioning:write to create a client. See Using an mcp_ key over HTTP.
query
location_idstring

Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_. Not used when creating a client.

Content-Typestring
Required

The media type of the request body

Options: application/json
hostnamestring
Required

Fully-qualified hostname.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Agency key (ak_) or location secret key (sk_). Writes require an agency key; creating a client requires an agency-wide key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too: locations:read/locations:write for one client's setup, and provisioning:write to create a client. See Using an mcp_ key over HTTP.

Query Parameters

location_idstring

Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_. Not used when creating a client.

Body

application/json
hostnamestring
Required

Fully-qualified hostname.

Example:
analytics.example.com

Responses