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

# Upsert Connection

`PUT /api/domains/{domain_id}/aws-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}/aws-bot-tracking`
- Auth: OAuth 2
  - Password
  - Token URL: `/auth/login`

Probe the role+bucket then persist.

## Path parameters

- `domain_id` string, required

## Headers

- `x-view-as` string, nullable

## Request body

- AwsBotTrackingUpsert
  - `role_arn` string, required: ARN of the IAM role we should assume
  - `s3_logs_bucket` string, required: S3 bucket where CloudFront standard logs land
  - `s3_logs_prefix` string, nullable: Optional key prefix within the bucket
  - `cloudfront_distribution_ids` string, nullable: Optional comma-separated CloudFront distribution IDs to filter on; null = all distributions
  - `region` string: AWS region

## Response `200`

Successful Response

- AwsBotTrackingStatus
  - `configured` boolean, required
  - `enabled` boolean, required
  - `role_arn` string, nullable
  - `external_id` string, nullable
  - `s3_logs_bucket` string, nullable
  - `s3_logs_prefix` string, nullable
  - `cloudfront_distribution_ids` string, nullable
  - `region` string, nullable
  - `last_sync_at` string, date-time, nullable
  - `last_sync_status` string, nullable
  - `last_log_cursor` string, nullable
  - `our_account_id` 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)
