{
    "openapi": "3.0.0",
    "info": {
        "title": "TrafficBot API v1",
        "description": "Programmatic access to TrafficBot Browser Simulation (`bsim-campaigns`) and Google Analytics (`ga-campaigns`) campaigns.\n\n**Authentication.** Every request requires a Sanctum personal access token in the `Authorization: Bearer <token>` header. Generate tokens at [/dashboard/api-tokens](/dashboard/api-tokens). Each token carries a fixed set of abilities — `{ga,bsim}-campaigns:{read,write,delete}` — and a request to a gated endpoint without the matching ability returns `403`.\n\n**Rate limiting.** All endpoints share a 300/minute per-IP limit. In addition, read endpoints allow 120/minute per token and write endpoints allow 30/minute per token. Exceeded limits return `429` with a `Retry-After` header.\n\n**Errors.** All error responses use the shape `{ \"message\": \"...\", \"errors\": { \"field\": [\"...\"] } }`. Validation failures populate `errors` keyed by field. Domain failures use field keys `is_active` (insufficient credits / delete-while-active), `limit` (campaign cap reached), and `end_date` (date-range > 90 days).",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://trafficbot.co",
            "description": "Production"
        }
    ],
    "paths": {
        "/api/v1/me": {
            "get": {
                "tags": [
                    "Account"
                ],
                "summary": "Get the authenticated account info",
                "description": "Returns basic profile and credit balances. Requires no specific ability.",
                "operationId": "9bab499f1fb24f0f823a21d9b7dab48f",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string",
                                                    "format": "email"
                                                },
                                                "ga_credits": {
                                                    "type": "integer"
                                                },
                                                "bsim_credits": {
                                                    "type": "integer"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/bsim-campaigns": {
            "get": {
                "tags": [
                    "Bsim campaigns"
                ],
                "summary": "List Bsim campaigns",
                "operationId": "9d469d39f34373e131053aeafe0aea14",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Match against name or url",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "inactive"
                            ]
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/BsimCampaign"
                                            }
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PaginationLinks"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Bsim campaigns"
                ],
                "summary": "Create a Bsim campaign",
                "description": "Activating with `is_active=true` requires a positive bsim credit balance.",
                "operationId": "184f947dba5d8f4513dc7628bae2cba6",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BsimCampaignInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/BsimCampaign"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/bsim-campaigns/{campaign}": {
            "get": {
                "tags": [
                    "Bsim campaigns"
                ],
                "summary": "Get a Bsim campaign",
                "operationId": "f2d248d9fc5743f3331a56ed028778fe",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/BsimCampaign"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Bsim campaigns"
                ],
                "summary": "Delete a Bsim campaign",
                "description": "The campaign must be inactive; a request to delete an active campaign returns 422.",
                "operationId": "51b8acdfce5c9c3982c60935574251ec",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "Bsim campaigns"
                ],
                "summary": "Update a Bsim campaign (partial)",
                "description": "Flipping `is_active` to true requires a positive bsim credit balance.",
                "operationId": "973e39df57386dbce83caa23ad486261",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/BsimCampaignInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/BsimCampaign"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/bsim-campaigns/{campaign}/report": {
            "get": {
                "tags": [
                    "Bsim campaigns"
                ],
                "summary": "Hourly results for a Bsim campaign",
                "description": "Defaults to the last 7 days in the campaign timezone. Range cannot exceed 90 days.",
                "operationId": "6701fcf021dcfd7eed6bd79f8c2ee59d",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "campaign": {
                                                    "$ref": "#/components/schemas/BsimCampaign"
                                                },
                                                "hourly_results": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "filters": {
                                                    "type": "object"
                                                },
                                                "date_range": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/ga-campaigns": {
            "get": {
                "tags": [
                    "GA campaigns"
                ],
                "summary": "List GA campaigns",
                "description": "Returns the authenticated user's GA4 campaigns, paginated.",
                "operationId": "90624f41ae11ad3652568a995583c032",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Match against name or tracker_id",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "active",
                                "inactive"
                            ]
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/GaCampaign"
                                            }
                                        },
                                        "links": {
                                            "$ref": "#/components/schemas/PaginationLinks"
                                        },
                                        "meta": {
                                            "$ref": "#/components/schemas/PaginationMeta"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "GA campaigns"
                ],
                "summary": "Create a GA campaign",
                "operationId": "a90b567f750ae13b82586849099eb09e",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GaCampaignInput"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GaCampaign"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/ga-campaigns/{campaign}": {
            "get": {
                "tags": [
                    "GA campaigns"
                ],
                "summary": "Get a GA campaign",
                "operationId": "0462b33fe4949c56ab2fd36aa356b604",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GaCampaign"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "GA campaigns"
                ],
                "summary": "Delete a GA campaign",
                "description": "The campaign must be inactive before it can be deleted.",
                "operationId": "2f7e717a1e2586737a1d176c7f21074d",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "Deleted"
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            },
            "patch": {
                "tags": [
                    "GA campaigns"
                ],
                "summary": "Update a GA campaign (partial)",
                "operationId": "a0204843180779099ec0500f9310687b",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GaCampaignInput"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/GaCampaign"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/ga-campaigns/{campaign}/report": {
            "get": {
                "tags": [
                    "GA campaigns"
                ],
                "summary": "Hourly results for a GA campaign",
                "description": "Defaults to the last 7 days in the campaign timezone. Range cannot exceed 90 days.",
                "operationId": "a1ec2bc83ec1dab1cef0bb9303cf688a",
                "parameters": [
                    {
                        "name": "campaign",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "start_date",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "end_date",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "properties": {
                                                "campaign": {
                                                    "$ref": "#/components/schemas/GaCampaign"
                                                },
                                                "hourly_results": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "filters": {
                                                    "type": "object"
                                                },
                                                "date_range": {
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "403": {
                        "$ref": "#/components/responses/Forbidden"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFound"
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/api/v1/bsim/proxy-countries": {
            "get": {
                "tags": [
                    "Reference"
                ],
                "summary": "List Bsim proxy countries",
                "description": "Returns the distinct list of country codes available across active proxies. Useful for validating Bsim `countries` before submitting a campaign. Requires no specific ability.",
                "operationId": "e2c00ea3b203d5bba79874d58495f8be",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            },
                                            "example": [
                                                "CA",
                                                "GB",
                                                "US"
                                            ]
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/Unauthorized"
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimited"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "GaCampaign": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 42
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "name": {
                        "type": "string",
                        "example": "Homepage promo"
                    },
                    "tracker_id": {
                        "type": "string",
                        "example": "G-XXXXXXX"
                    },
                    "events_per_day": {
                        "type": "integer",
                        "example": 100
                    },
                    "bounce_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "max_events_per_visitor": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "fluctuate_event_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "event_duration": {
                        "description": "Average event duration in seconds",
                        "type": "integer"
                    },
                    "fluctuate_duration_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "device_rate": {
                        "description": "Mobile share, 0..1",
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "timezone": {
                        "type": "string",
                        "example": "UTC"
                    },
                    "locations": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "US",
                            "GB"
                        ]
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "title": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "daily_rates": {
                        "description": "Map of weekday (1=Mon..7=Sun) to multiplier 0..1",
                        "type": "object"
                    },
                    "utms": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "GaCampaignInput": {
                "required": [
                    "name",
                    "tracker_id",
                    "events_per_day",
                    "urls",
                    "daily_rates"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "tracker_id": {
                        "type": "string",
                        "example": "G-XXXXXXX"
                    },
                    "events_per_day": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "bounce_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "max_events_per_visitor": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "fluctuate_event_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "event_duration": {
                        "type": "integer"
                    },
                    "fluctuate_duration_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "device_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "timezone": {
                        "type": "string",
                        "example": "UTC"
                    },
                    "locations": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "urls": {
                        "type": "array",
                        "items": {
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "format": "uri"
                                },
                                "title": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "daily_rates": {
                        "type": "object",
                        "example": {
                            "1": 1,
                            "2": 1,
                            "3": 1,
                            "4": 1,
                            "5": 1,
                            "6": 1,
                            "7": 1
                        }
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "BsimCampaign": {
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 42
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "name": {
                        "type": "string"
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "visits_per_day": {
                        "type": "integer"
                    },
                    "bounce_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "max_pages_per_visit": {
                        "type": "integer"
                    },
                    "dwell_time_min": {
                        "description": "Seconds",
                        "type": "integer"
                    },
                    "dwell_time_max": {
                        "description": "Seconds, must be >= dwell_time_min",
                        "type": "integer"
                    },
                    "device_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "countries": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "US",
                            "CA"
                        ]
                    },
                    "referrers": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "example": [
                            "https://google.com"
                        ]
                    },
                    "timezone": {
                        "type": "string",
                        "example": "UTC"
                    },
                    "daily_rates": {
                        "type": "object",
                        "nullable": true
                    },
                    "fluctuate_visit_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                },
                "type": "object"
            },
            "BsimCampaignInput": {
                "required": [
                    "name",
                    "url",
                    "visits_per_day",
                    "countries",
                    "daily_rates"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "url": {
                        "type": "string",
                        "format": "uri"
                    },
                    "visits_per_day": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "bounce_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "max_pages_per_visit": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "dwell_time_min": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "dwell_time_max": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "device_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "countries": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "referrers": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "timezone": {
                        "type": "string",
                        "example": "UTC"
                    },
                    "daily_rates": {
                        "type": "object"
                    },
                    "fluctuate_visit_rate": {
                        "type": "number",
                        "format": "float",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "is_active": {
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "PaginationMeta": {
                "properties": {
                    "current_page": {
                        "type": "integer"
                    },
                    "from": {
                        "description": "1-based index of the first record on the page; null for an empty page",
                        "type": "integer",
                        "nullable": true
                    },
                    "last_page": {
                        "type": "integer"
                    },
                    "links": {
                        "description": "Per-page navigation entries rendered by the default Laravel paginator",
                        "type": "array",
                        "items": {
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "label": {
                                    "type": "string"
                                },
                                "active": {
                                    "type": "boolean"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "path": {
                        "description": "Base URL of the resource without query string",
                        "type": "string"
                    },
                    "per_page": {
                        "type": "integer"
                    },
                    "to": {
                        "description": "1-based index of the last record on the page; null for an empty page",
                        "type": "integer",
                        "nullable": true
                    },
                    "total": {
                        "type": "integer"
                    }
                },
                "type": "object"
            },
            "PaginationLinks": {
                "description": "Top-level navigation links emitted alongside `data` and `meta` by Laravel's `JsonResource::collection($paginator)`.",
                "properties": {
                    "first": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "last": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "prev": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    },
                    "next": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true
                    }
                },
                "type": "object"
            },
            "ErrorResponse": {
                "properties": {
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                },
                "type": "object"
            }
        },
        "responses": {
            "Unauthorized": {
                "description": "Missing or invalid token",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorResponse"
                        }
                    }
                }
            },
            "Forbidden": {
                "description": "Token is missing the required ability",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorResponse"
                        }
                    }
                }
            },
            "NotFound": {
                "description": "Resource not found or not owned by the authenticated user",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorResponse"
                        }
                    }
                }
            },
            "ValidationError": {
                "description": "Validation or domain rule failed",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorResponse"
                        }
                    }
                }
            },
            "RateLimited": {
                "description": "Rate limit exceeded; retry after the duration in the Retry-After header",
                "headers": {
                    "Retry-After": {
                        "description": "Seconds until retry",
                        "schema": {
                            "type": "integer"
                        }
                    }
                },
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorResponse"
                        }
                    }
                }
            }
        },
        "securitySchemes": {
            "sanctum": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "Personal Access Token",
                "description": "Sanctum personal access token. Manage tokens at /dashboard/api-tokens."
            }
        }
    },
    "security": [
        {
            "sanctum": []
        }
    ],
    "tags": [
        {
            "name": "GA campaigns",
            "description": "Google Analytics 4 campaigns"
        },
        {
            "name": "Bsim campaigns",
            "description": "Browser Simulation campaigns"
        },
        {
            "name": "Account",
            "description": "Authenticated account info"
        },
        {
            "name": "Reference",
            "description": "Read-only reference data"
        }
    ]
}