---
title: "Upsert Connection"
method: PUT
path: "/api/domains/{domain_id}/cloudflare-bot-tracking"
tags: ["cloudflare_bot_tracking"]
---

# Upsert Connection

`PUT /api/domains/{domain_id}/cloudflare-bot-tracking`

## Request

- Base URL: `https://api-v1.unusual.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api-v1.unusual.ai/api/domains/{domain_id}/cloudflare-bot-tracking`
- Auth: OAuth 2
  - Password
  - Token URL: `/auth/login`

Validate the credentials with a live probe, then persist them.

## Path parameters

- `domain_id` string, required

## Headers

- `x-view-as` string, nullable

## Request body

- CloudflareBotTrackingUpsert
  - `api_token` string, required: Cloudflare API token with Zone:Read + Analytics:Read on the target zone
  - `zone_id` string, required: Cloudflare Zone ID (the long hex string in the Cloudflare dashboard URL)

## Response `200`

Successful Response

- CloudflareBotTrackingStatus
  - `configured` boolean, required
  - `enabled` boolean, required
  - `zone_id` string, nullable
  - `last_sync_at` string, date-time, nullable
  - `last_sync_status` string, nullable
  - `hosting_provider` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/unusual/apis/dashboard-server.md) - [All operations](https://skmtc.dev/unusual/apis/dashboard-server/llms.txt) - [OpenAPI document](https://skmtc.dev/unusual/apis/dashboard-server/revisions/89f716930ead?raw)
