{
  "openapi": "3.1.0",
  "info": {
    "title": "LinkProfit API",
    "version": "1.0.0",
    "description": "REST API for workspaces (link management, analytics, domains) and partners\n(clients, plans, payments). Authenticate with `Authorization: Bearer <key>`:\nworkspace keys start with `lp_live_`, partner keys with `lpp_live_`.\n\nGuides: https://linkprofit.com/docs/api. v1 is frozen — breaking changes only via /v2.",
    "contact": {
      "name": "LinkProfit",
      "url": "https://linkprofit.com"
    }
  },
  "servers": [
    {
      "url": "https://api.linkprofit.com/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Links",
      "description": "Short links of the workspace"
    },
    {
      "name": "Analytics",
      "description": "Click analytics of the workspace"
    },
    {
      "name": "Domains",
      "description": "Redirect domains available to the workspace"
    },
    {
      "name": "Workspace",
      "description": "Workspace profile and audit trail"
    },
    {
      "name": "Partner",
      "description": "Partner profile and cross-client analytics"
    },
    {
      "name": "Partner clients",
      "description": "Client workspaces of the partner"
    },
    {
      "name": "Partner plans",
      "description": "Plans the partner sells to clients"
    },
    {
      "name": "Partner domains",
      "description": "All domains of the partner"
    },
    {
      "name": "Partner billing",
      "description": "Payments mirror and payouts"
    },
    {
      "name": "Webhooks",
      "description": "Outgoing webhooks with signed deliveries"
    },
    {
      "name": "Conversions",
      "description": "Orders and signups attributed to clicks"
    },
    {
      "name": "Alerts",
      "description": "Alert rules and their firings"
    },
    {
      "name": "Reports",
      "description": "Abuse reports about links of the workspace"
    },
    {
      "name": "Tools",
      "description": "Tool server for AI assistants"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key from the dashboard settings. The full value is shown once at creation."
      }
    }
  },
  "paths": {
    "/links": {
      "get": {
        "operationId": "listLinks",
        "summary": "List links",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `links:read`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "domain_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          },
          {
            "name": "folder_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "short_url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "domain_id": {
                            "type": "string"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "title": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "note": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "folder_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "color": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "color"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "redirect_type": {
                            "anyOf": [
                              {
                                "type": "number",
                                "const": 301
                              },
                              {
                                "type": "number",
                                "const": 302
                              },
                              {
                                "type": "number",
                                "const": 307
                              },
                              {
                                "type": "number",
                                "const": 308
                              }
                            ]
                          },
                          "expires_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expired_url": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "has_password": {
                            "type": "boolean"
                          },
                          "targeting": {
                            "maxItems": 50,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "match": {
                                  "type": "object",
                                  "properties": {
                                    "country": {
                                      "minItems": 1,
                                      "maxItems": 50,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{2}$"
                                      }
                                    },
                                    "device": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "desktop",
                                          "mobile",
                                          "tablet"
                                        ]
                                      }
                                    },
                                    "os": {
                                      "minItems": 1,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "ios",
                                          "android",
                                          "windows",
                                          "macos",
                                          "linux",
                                          "other"
                                        ]
                                      }
                                    },
                                    "language": {
                                      "minItems": 1,
                                      "maxItems": 20,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                }
                              },
                              "required": [
                                "match",
                                "url"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "ab_test": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "enabled": {
                                    "type": "boolean"
                                  },
                                  "variants": {
                                    "maxItems": 10,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "url": {
                                          "type": "string",
                                          "maxLength": 8192,
                                          "format": "uri"
                                        },
                                        "weight": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 100
                                        },
                                        "label": {
                                          "type": "string",
                                          "maxLength": 40
                                        }
                                      },
                                      "required": [
                                        "url",
                                        "weight"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "auto": {
                                    "type": "object",
                                    "properties": {
                                      "enabled": {
                                        "type": "boolean"
                                      },
                                      "min_sample": {
                                        "default": 1000,
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 1000000000
                                      },
                                      "warmup_until": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "weights": {
                                        "maxItems": 10,
                                        "type": "array",
                                        "items": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 100
                                        }
                                      },
                                      "samples": {
                                        "type": "object",
                                        "properties": {
                                          "clicks": {
                                            "maxItems": 10,
                                            "type": "array",
                                            "items": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          },
                                          "conversions": {
                                            "maxItems": 10,
                                            "type": "array",
                                            "items": {
                                              "type": "integer",
                                              "minimum": 0,
                                              "maximum": 9007199254740991
                                            }
                                          }
                                        },
                                        "required": [
                                          "clicks",
                                          "conversions"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "winner_index": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9
                                      },
                                      "stopped_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      }
                                    },
                                    "required": [
                                      "enabled",
                                      "min_sample"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "required": [
                                  "enabled",
                                  "variants"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "rules": {
                            "maxItems": 20,
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "minLength": 3,
                                  "maxLength": 40
                                },
                                "enabled": {
                                  "default": true,
                                  "type": "boolean"
                                },
                                "label": {
                                  "type": "string",
                                  "maxLength": 80
                                },
                                "invert": {
                                  "default": false,
                                  "type": "boolean"
                                },
                                "match": {
                                  "type": "object",
                                  "properties": {
                                    "visitor_type": {
                                      "minItems": 1,
                                      "maxItems": 16,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "human",
                                          "search_bot",
                                          "social_preview",
                                          "seo_crawler",
                                          "ai_crawler",
                                          "monitoring",
                                          "security_scanner",
                                          "library",
                                          "headless",
                                          "feed_reader",
                                          "automated",
                                          "datacenter",
                                          "proxy",
                                          "vpn",
                                          "tor",
                                          "unknown"
                                        ]
                                      }
                                    },
                                    "verified_bot": {
                                      "type": "boolean"
                                    },
                                    "proxy_type": {
                                      "minItems": 1,
                                      "maxItems": 6,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "DCH",
                                          "PUB",
                                          "VPN",
                                          "SES",
                                          "TOR",
                                          "WEB"
                                        ]
                                      }
                                    },
                                    "quality_below": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 100
                                    },
                                    "country": {
                                      "minItems": 1,
                                      "maxItems": 250,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{2}$"
                                      }
                                    },
                                    "region": {
                                      "minItems": 1,
                                      "maxItems": 100,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 80
                                      }
                                    },
                                    "city": {
                                      "minItems": 1,
                                      "maxItems": 100,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 120
                                      }
                                    },
                                    "asn": {
                                      "minItems": 1,
                                      "maxItems": 200,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 4294967295
                                      }
                                    },
                                    "ip": {
                                      "minItems": 1,
                                      "maxItems": 1000,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 2,
                                        "maxLength": 49
                                      }
                                    },
                                    "user_agent": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "referer": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 200
                                    },
                                    "has_utm": {
                                      "type": "boolean"
                                    },
                                    "device": {
                                      "minItems": 1,
                                      "maxItems": 3,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "desktop",
                                          "mobile",
                                          "tablet"
                                        ]
                                      }
                                    },
                                    "language": {
                                      "minItems": 1,
                                      "maxItems": 20,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                      }
                                    },
                                    "local_time": {
                                      "type": "object",
                                      "properties": {
                                        "from": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 23
                                        },
                                        "to": {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 23
                                        }
                                      },
                                      "required": [
                                        "from",
                                        "to"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "weekday": {
                                      "minItems": 1,
                                      "maxItems": 7,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 7
                                      }
                                    },
                                    "visit": {
                                      "type": "string",
                                      "enum": [
                                        "first",
                                        "repeat"
                                      ]
                                    },
                                    "ip_list_ids": {
                                      "minItems": 1,
                                      "maxItems": 5,
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "minLength": 3,
                                        "maxLength": 40
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "action": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "pass"
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "block"
                                        },
                                        "status": {
                                          "default": 404,
                                          "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                          "anyOf": [
                                            {
                                              "type": "number",
                                              "const": 404
                                            },
                                            {
                                              "type": "number",
                                              "const": 410
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "status"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "redirect"
                                        },
                                        "url": {
                                          "type": "string",
                                          "maxLength": 8192,
                                          "format": "uri"
                                        }
                                      },
                                      "required": [
                                        "type",
                                        "url"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "page"
                                        },
                                        "title": {
                                          "type": "string",
                                          "maxLength": 140
                                        },
                                        "text": {
                                          "type": "string",
                                          "maxLength": 600
                                        },
                                        "button_label": {
                                          "type": "string",
                                          "maxLength": 60
                                        },
                                        "button_url": {
                                          "type": "string",
                                          "maxLength": 2048,
                                          "format": "uri"
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "type": {
                                          "type": "string",
                                          "const": "warn"
                                        }
                                      },
                                      "required": [
                                        "type"
                                      ],
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "enabled",
                                "invert",
                                "match",
                                "action"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "workspace_rules_off": {
                            "type": "boolean"
                          },
                          "mobile": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "enabled": {
                                    "default": false,
                                    "type": "boolean"
                                  },
                                  "ios": {
                                    "type": "object",
                                    "properties": {
                                      "app_url": {
                                        "type": "string",
                                        "maxLength": 2048
                                      },
                                      "store_url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      },
                                      "web_url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "android": {
                                    "type": "object",
                                    "properties": {
                                      "app_url": {
                                        "type": "string",
                                        "maxLength": 2048
                                      },
                                      "store_url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      },
                                      "web_url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "desktop_url": {
                                    "type": "string",
                                    "maxLength": 8192,
                                    "format": "uri"
                                  },
                                  "tablet": {
                                    "default": "mobile",
                                    "type": "string",
                                    "enum": [
                                      "mobile",
                                      "desktop"
                                    ]
                                  },
                                  "in_app": {
                                    "default": "attempt",
                                    "type": "string",
                                    "enum": [
                                      "attempt",
                                      "store",
                                      "web"
                                    ]
                                  },
                                  "delay_ms": {
                                    "default": 1600,
                                    "type": "integer",
                                    "minimum": 500,
                                    "maximum": 5000
                                  },
                                  "deferred": {
                                    "default": false,
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "enabled",
                                  "tablet",
                                  "in_app",
                                  "delay_ms",
                                  "deferred"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "rotator": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "enabled": {
                                    "type": "boolean"
                                  },
                                  "mode": {
                                    "type": "string",
                                    "enum": [
                                      "weighted",
                                      "round_robin",
                                      "uniform"
                                    ]
                                  },
                                  "sticky_ttl_seconds": {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  "fallback_url": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "auto_disable_unhealthy": {
                                    "type": "boolean"
                                  },
                                  "destinations": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "url": {
                                          "type": "string"
                                        },
                                        "weight": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "active": {
                                          "type": "boolean"
                                        },
                                        "limits": {
                                          "anyOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "max_total_clicks": {
                                                  "type": "integer",
                                                  "minimum": 1,
                                                  "maximum": 1000000000
                                                },
                                                "max_daily_clicks": {
                                                  "type": "integer",
                                                  "minimum": 1,
                                                  "maximum": 1000000000
                                                },
                                                "starts_at": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "ends_at": {
                                                  "type": "string",
                                                  "format": "date-time",
                                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                },
                                                "countries": {
                                                  "minItems": 1,
                                                  "maxItems": 50,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "pattern": "^[A-Z]{2}$"
                                                  }
                                                },
                                                "devices": {
                                                  "minItems": 1,
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string",
                                                    "enum": [
                                                      "desktop",
                                                      "mobile",
                                                      "tablet"
                                                    ]
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "used_total_clicks": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "used_daily_clicks": {
                                          "type": "integer",
                                          "minimum": -9007199254740991,
                                          "maximum": 9007199254740991
                                        },
                                        "exhausted": {
                                          "type": "boolean"
                                        },
                                        "health_ok": {
                                          "anyOf": [
                                            {
                                              "type": "boolean"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "health_checked_at": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "auto_disabled_at": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "format": "date-time",
                                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "url",
                                        "weight",
                                        "active",
                                        "limits",
                                        "used_total_clicks",
                                        "used_daily_clicks",
                                        "exhausted",
                                        "health_ok",
                                        "health_checked_at",
                                        "auto_disabled_at"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "enabled",
                                  "mode",
                                  "sticky_ttl_seconds",
                                  "fallback_url",
                                  "auto_disable_unhealthy",
                                  "destinations"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "ios_url": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "deprecated": true,
                            "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                          },
                          "android_url": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "deprecated": true,
                            "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                          },
                          "utm": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "utm_source": {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  "utm_medium": {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  "utm_campaign": {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  "utm_term": {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  "utm_content": {
                                    "type": "string",
                                    "maxLength": 120
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "og_override": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "title": {
                                    "type": "string",
                                    "maxLength": 140
                                  },
                                  "description": {
                                    "type": "string",
                                    "maxLength": 300
                                  },
                                  "image_url": {
                                    "type": "string",
                                    "maxLength": 2048,
                                    "format": "uri"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "pixel_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "qr_preset_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "public_stats": {
                            "type": "boolean"
                          },
                          "archived_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "short_url",
                          "domain_id",
                          "domain",
                          "slug",
                          "url",
                          "title",
                          "note",
                          "folder_id",
                          "tags",
                          "redirect_type",
                          "expires_at",
                          "expired_url",
                          "has_password",
                          "targeting",
                          "ab_test",
                          "rules",
                          "workspace_rules_off",
                          "mobile",
                          "rotator",
                          "ios_url",
                          "android_url",
                          "utm",
                          "og_override",
                          "pixel_ids",
                          "qr_preset_id",
                          "public_stats",
                          "archived_at",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createLink",
        "summary": "Create a link",
        "description": "Creates a short link with any options of the link model: targeting, A/B split, expiry, password, UTM, pixels, QR preset. Omit `domain_id` to use the default domain. Supports the `Idempotency-Key` header.\n\nRequires a workspace key (`lp_live_…`). Required scope: `links:write`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192
                  },
                  "domain_id": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "folder_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tag_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 64
                    }
                  },
                  "redirect_type": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 301
                      },
                      {
                        "type": "number",
                        "const": 302
                      },
                      {
                        "type": "number",
                        "const": 307
                      },
                      {
                        "type": "number",
                        "const": 308
                      }
                    ]
                  },
                  "expires_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expired_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 8192
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "password": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "targeting": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "match": {
                          "type": "object",
                          "properties": {
                            "country": {
                              "minItems": 1,
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              }
                            },
                            "device": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "desktop",
                                  "mobile",
                                  "tablet"
                                ]
                              }
                            },
                            "os": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "ios",
                                  "android",
                                  "windows",
                                  "macos",
                                  "linux",
                                  "other"
                                ]
                              }
                            },
                            "language": {
                              "minItems": 1,
                              "maxItems": 20,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                              }
                            }
                          }
                        },
                        "url": {
                          "type": "string",
                          "maxLength": 8192,
                          "format": "uri"
                        }
                      },
                      "required": [
                        "match",
                        "url"
                      ]
                    }
                  },
                  "ab_test": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "variants": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "url": {
                              "type": "string",
                              "maxLength": 8192,
                              "format": "uri"
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "label": {
                              "type": "string",
                              "maxLength": 40
                            }
                          },
                          "required": [
                            "url",
                            "weight"
                          ]
                        }
                      },
                      "auto": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean"
                          },
                          "min_sample": {
                            "default": 1000,
                            "type": "integer",
                            "minimum": 10,
                            "maximum": 1000000000
                          },
                          "warmup_until": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "weights": {
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            }
                          },
                          "samples": {
                            "type": "object",
                            "properties": {
                              "clicks": {
                                "maxItems": 10,
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "conversions": {
                                "maxItems": 10,
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              }
                            },
                            "required": [
                              "clicks",
                              "conversions"
                            ]
                          },
                          "winner_index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9
                          },
                          "stopped_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          }
                        },
                        "required": [
                          "enabled"
                        ]
                      }
                    },
                    "required": [
                      "enabled",
                      "variants"
                    ]
                  },
                  "rules": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 3,
                          "maxLength": 40
                        },
                        "enabled": {
                          "default": true,
                          "type": "boolean"
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "invert": {
                          "default": false,
                          "type": "boolean"
                        },
                        "match": {
                          "type": "object",
                          "properties": {
                            "visitor_type": {
                              "minItems": 1,
                              "maxItems": 16,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "human",
                                  "search_bot",
                                  "social_preview",
                                  "seo_crawler",
                                  "ai_crawler",
                                  "monitoring",
                                  "security_scanner",
                                  "library",
                                  "headless",
                                  "feed_reader",
                                  "automated",
                                  "datacenter",
                                  "proxy",
                                  "vpn",
                                  "tor",
                                  "unknown"
                                ]
                              }
                            },
                            "verified_bot": {
                              "type": "boolean"
                            },
                            "proxy_type": {
                              "minItems": 1,
                              "maxItems": 6,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "DCH",
                                  "PUB",
                                  "VPN",
                                  "SES",
                                  "TOR",
                                  "WEB"
                                ]
                              }
                            },
                            "quality_below": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "country": {
                              "minItems": 1,
                              "maxItems": 250,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              }
                            },
                            "region": {
                              "minItems": 1,
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            },
                            "city": {
                              "minItems": 1,
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              }
                            },
                            "asn": {
                              "minItems": 1,
                              "maxItems": 200,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 4294967295
                              }
                            },
                            "ip": {
                              "minItems": 1,
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 2,
                                "maxLength": 49
                              }
                            },
                            "user_agent": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "referer": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "has_utm": {
                              "type": "boolean"
                            },
                            "device": {
                              "minItems": 1,
                              "maxItems": 3,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "desktop",
                                  "mobile",
                                  "tablet"
                                ]
                              }
                            },
                            "language": {
                              "minItems": 1,
                              "maxItems": 20,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                              }
                            },
                            "local_time": {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "to": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 23
                                }
                              },
                              "required": [
                                "from",
                                "to"
                              ]
                            },
                            "weekday": {
                              "minItems": 1,
                              "maxItems": 7,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 7
                              }
                            },
                            "visit": {
                              "type": "string",
                              "enum": [
                                "first",
                                "repeat"
                              ]
                            },
                            "ip_list_ids": {
                              "minItems": 1,
                              "maxItems": 5,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 40
                              }
                            }
                          }
                        },
                        "action": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "pass"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "block"
                                },
                                "status": {
                                  "default": 404,
                                  "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "const": 404
                                    },
                                    {
                                      "type": "number",
                                      "const": 410
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "redirect"
                                },
                                "url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                }
                              },
                              "required": [
                                "type",
                                "url"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "page"
                                },
                                "title": {
                                  "type": "string",
                                  "maxLength": 140
                                },
                                "text": {
                                  "type": "string",
                                  "maxLength": 600
                                },
                                "button_label": {
                                  "type": "string",
                                  "maxLength": 60
                                },
                                "button_url": {
                                  "type": "string",
                                  "maxLength": 2048,
                                  "format": "uri"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "warn"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "match",
                        "action"
                      ]
                    }
                  },
                  "workspace_rules_off": {
                    "type": "boolean"
                  },
                  "mobile": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "default": false,
                        "type": "boolean"
                      },
                      "ios": {
                        "type": "object",
                        "properties": {
                          "app_url": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "store_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          },
                          "web_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          }
                        }
                      },
                      "android": {
                        "type": "object",
                        "properties": {
                          "app_url": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "store_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          },
                          "web_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          }
                        }
                      },
                      "desktop_url": {
                        "type": "string",
                        "maxLength": 8192,
                        "format": "uri"
                      },
                      "tablet": {
                        "default": "mobile",
                        "type": "string",
                        "enum": [
                          "mobile",
                          "desktop"
                        ]
                      },
                      "in_app": {
                        "default": "attempt",
                        "type": "string",
                        "enum": [
                          "attempt",
                          "store",
                          "web"
                        ]
                      },
                      "delay_ms": {
                        "default": 1600,
                        "type": "integer",
                        "minimum": 500,
                        "maximum": 5000
                      },
                      "deferred": {
                        "default": false,
                        "type": "boolean"
                      }
                    }
                  },
                  "rotator": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "mode": {
                        "default": "weighted",
                        "type": "string",
                        "enum": [
                          "weighted",
                          "round_robin",
                          "uniform"
                        ]
                      },
                      "sticky_ttl_seconds": {
                        "default": 0,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2592000
                      },
                      "fallback_url": {
                        "type": "string",
                        "maxLength": 8192,
                        "format": "uri"
                      },
                      "auto_disable_unhealthy": {
                        "default": false,
                        "type": "boolean"
                      },
                      "destinations": {
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 40
                            },
                            "url": {
                              "type": "string",
                              "maxLength": 8192,
                              "format": "uri"
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "active": {
                              "default": true,
                              "type": "boolean"
                            },
                            "limits": {
                              "type": "object",
                              "properties": {
                                "max_total_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000
                                },
                                "max_daily_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000
                                },
                                "starts_at": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ends_at": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "countries": {
                                  "minItems": 1,
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$"
                                  }
                                },
                                "devices": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "desktop",
                                      "mobile",
                                      "tablet"
                                    ]
                                  }
                                }
                              }
                            }
                          },
                          "required": [
                            "url",
                            "weight"
                          ]
                        }
                      }
                    },
                    "required": [
                      "enabled",
                      "destinations"
                    ]
                  },
                  "ios_url": {
                    "deprecated": true,
                    "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`.",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 8192
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "android_url": {
                    "deprecated": true,
                    "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`.",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 8192
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "utm": {
                    "type": "object",
                    "properties": {
                      "utm_source": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_medium": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_campaign": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_term": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_content": {
                        "type": "string",
                        "maxLength": 120
                      }
                    }
                  },
                  "og_override": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 140
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "image_url": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      }
                    }
                  },
                  "pixel_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 64
                    }
                  },
                  "qr_preset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "public_stats": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "url"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "short_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "domain_id": {
                          "type": "string"
                        },
                        "domain": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "folder_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "color": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "color"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "redirect_type": {
                          "anyOf": [
                            {
                              "type": "number",
                              "const": 301
                            },
                            {
                              "type": "number",
                              "const": 302
                            },
                            {
                              "type": "number",
                              "const": 307
                            },
                            {
                              "type": "number",
                              "const": 308
                            }
                          ]
                        },
                        "expires_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expired_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_password": {
                          "type": "boolean"
                        },
                        "targeting": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "match": {
                                "type": "object",
                                "properties": {
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "os": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "ios",
                                        "android",
                                        "windows",
                                        "macos",
                                        "linux",
                                        "other"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 8192,
                                "format": "uri"
                              }
                            },
                            "required": [
                              "match",
                              "url"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "ab_test": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "variants": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      },
                                      "weight": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                      },
                                      "label": {
                                        "type": "string",
                                        "maxLength": 40
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "weight"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "auto": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "type": "boolean"
                                    },
                                    "min_sample": {
                                      "default": 1000,
                                      "type": "integer",
                                      "minimum": 10,
                                      "maximum": 1000000000
                                    },
                                    "warmup_until": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "weights": {
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                      }
                                    },
                                    "samples": {
                                      "type": "object",
                                      "properties": {
                                        "clicks": {
                                          "maxItems": 10,
                                          "type": "array",
                                          "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "conversions": {
                                          "maxItems": 10,
                                          "type": "array",
                                          "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        }
                                      },
                                      "required": [
                                        "clicks",
                                        "conversions"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "winner_index": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9
                                    },
                                    "stopped_at": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "min_sample"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "enabled",
                                "variants"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rules": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 40
                              },
                              "enabled": {
                                "default": true,
                                "type": "boolean"
                              },
                              "label": {
                                "type": "string",
                                "maxLength": 80
                              },
                              "invert": {
                                "default": false,
                                "type": "boolean"
                              },
                              "match": {
                                "type": "object",
                                "properties": {
                                  "visitor_type": {
                                    "minItems": 1,
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "search_bot",
                                        "social_preview",
                                        "seo_crawler",
                                        "ai_crawler",
                                        "monitoring",
                                        "security_scanner",
                                        "library",
                                        "headless",
                                        "feed_reader",
                                        "automated",
                                        "datacenter",
                                        "proxy",
                                        "vpn",
                                        "tor",
                                        "unknown"
                                      ]
                                    }
                                  },
                                  "verified_bot": {
                                    "type": "boolean"
                                  },
                                  "proxy_type": {
                                    "minItems": 1,
                                    "maxItems": 6,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "DCH",
                                        "PUB",
                                        "VPN",
                                        "SES",
                                        "TOR",
                                        "WEB"
                                      ]
                                    }
                                  },
                                  "quality_below": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 250,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "region": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80
                                    }
                                  },
                                  "city": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    }
                                  },
                                  "asn": {
                                    "minItems": 1,
                                    "maxItems": 200,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 4294967295
                                    }
                                  },
                                  "ip": {
                                    "minItems": 1,
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 2,
                                      "maxLength": 49
                                    }
                                  },
                                  "user_agent": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "referer": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "has_utm": {
                                    "type": "boolean"
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "maxItems": 3,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  },
                                  "local_time": {
                                    "type": "object",
                                    "properties": {
                                      "from": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      },
                                      "to": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      }
                                    },
                                    "required": [
                                      "from",
                                      "to"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "weekday": {
                                    "minItems": 1,
                                    "maxItems": 7,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 7
                                    }
                                  },
                                  "visit": {
                                    "type": "string",
                                    "enum": [
                                      "first",
                                      "repeat"
                                    ]
                                  },
                                  "ip_list_ids": {
                                    "minItems": 1,
                                    "maxItems": 5,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 40
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "action": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "pass"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "block"
                                      },
                                      "status": {
                                        "default": 404,
                                        "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                        "anyOf": [
                                          {
                                            "type": "number",
                                            "const": 404
                                          },
                                          {
                                            "type": "number",
                                            "const": 410
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "status"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "redirect"
                                      },
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "url"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "page"
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 140
                                      },
                                      "text": {
                                        "type": "string",
                                        "maxLength": 600
                                      },
                                      "button_label": {
                                        "type": "string",
                                        "maxLength": 60
                                      },
                                      "button_url": {
                                        "type": "string",
                                        "maxLength": 2048,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "warn"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "enabled",
                              "invert",
                              "match",
                              "action"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "workspace_rules_off": {
                          "type": "boolean"
                        },
                        "mobile": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "default": false,
                                  "type": "boolean"
                                },
                                "ios": {
                                  "type": "object",
                                  "properties": {
                                    "app_url": {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    "store_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    },
                                    "web_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "android": {
                                  "type": "object",
                                  "properties": {
                                    "app_url": {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    "store_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    },
                                    "web_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "desktop_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                },
                                "tablet": {
                                  "default": "mobile",
                                  "type": "string",
                                  "enum": [
                                    "mobile",
                                    "desktop"
                                  ]
                                },
                                "in_app": {
                                  "default": "attempt",
                                  "type": "string",
                                  "enum": [
                                    "attempt",
                                    "store",
                                    "web"
                                  ]
                                },
                                "delay_ms": {
                                  "default": 1600,
                                  "type": "integer",
                                  "minimum": 500,
                                  "maximum": 5000
                                },
                                "deferred": {
                                  "default": false,
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "enabled",
                                "tablet",
                                "in_app",
                                "delay_ms",
                                "deferred"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rotator": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "mode": {
                                  "type": "string",
                                  "enum": [
                                    "weighted",
                                    "round_robin",
                                    "uniform"
                                  ]
                                },
                                "sticky_ttl_seconds": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "fallback_url": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "auto_disable_unhealthy": {
                                  "type": "boolean"
                                },
                                "destinations": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "weight": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "active": {
                                        "type": "boolean"
                                      },
                                      "limits": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "max_total_clicks": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 1000000000
                                              },
                                              "max_daily_clicks": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 1000000000
                                              },
                                              "starts_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "ends_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "countries": {
                                                "minItems": 1,
                                                "maxItems": 50,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "pattern": "^[A-Z]{2}$"
                                                }
                                              },
                                              "devices": {
                                                "minItems": 1,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "enum": [
                                                    "desktop",
                                                    "mobile",
                                                    "tablet"
                                                  ]
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "used_total_clicks": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "used_daily_clicks": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "exhausted": {
                                        "type": "boolean"
                                      },
                                      "health_ok": {
                                        "anyOf": [
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "health_checked_at": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "auto_disabled_at": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "url",
                                      "weight",
                                      "active",
                                      "limits",
                                      "used_total_clicks",
                                      "used_daily_clicks",
                                      "exhausted",
                                      "health_ok",
                                      "health_checked_at",
                                      "auto_disabled_at"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "enabled",
                                "mode",
                                "sticky_ttl_seconds",
                                "fallback_url",
                                "auto_disable_unhealthy",
                                "destinations"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ios_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                        },
                        "android_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                        },
                        "utm": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "utm_source": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_medium": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_campaign": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_term": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_content": {
                                  "type": "string",
                                  "maxLength": 120
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "og_override": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string",
                                  "maxLength": 140
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 300
                                },
                                "image_url": {
                                  "type": "string",
                                  "maxLength": 2048,
                                  "format": "uri"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "pixel_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "qr_preset_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "public_stats": {
                          "type": "boolean"
                        },
                        "archived_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "short_url",
                        "domain_id",
                        "domain",
                        "slug",
                        "url",
                        "title",
                        "note",
                        "folder_id",
                        "tags",
                        "redirect_type",
                        "expires_at",
                        "expired_url",
                        "has_password",
                        "targeting",
                        "ab_test",
                        "rules",
                        "workspace_rules_off",
                        "mobile",
                        "rotator",
                        "ios_url",
                        "android_url",
                        "utm",
                        "og_override",
                        "pixel_ids",
                        "qr_preset_id",
                        "public_stats",
                        "archived_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/links/{id}": {
      "get": {
        "operationId": "getLink",
        "summary": "Retrieve a link",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `links:read`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Link id (lnk_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "short_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "domain_id": {
                          "type": "string"
                        },
                        "domain": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "folder_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "color": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "color"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "redirect_type": {
                          "anyOf": [
                            {
                              "type": "number",
                              "const": 301
                            },
                            {
                              "type": "number",
                              "const": 302
                            },
                            {
                              "type": "number",
                              "const": 307
                            },
                            {
                              "type": "number",
                              "const": 308
                            }
                          ]
                        },
                        "expires_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expired_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_password": {
                          "type": "boolean"
                        },
                        "targeting": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "match": {
                                "type": "object",
                                "properties": {
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "os": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "ios",
                                        "android",
                                        "windows",
                                        "macos",
                                        "linux",
                                        "other"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 8192,
                                "format": "uri"
                              }
                            },
                            "required": [
                              "match",
                              "url"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "ab_test": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "variants": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      },
                                      "weight": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                      },
                                      "label": {
                                        "type": "string",
                                        "maxLength": 40
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "weight"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "auto": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "type": "boolean"
                                    },
                                    "min_sample": {
                                      "default": 1000,
                                      "type": "integer",
                                      "minimum": 10,
                                      "maximum": 1000000000
                                    },
                                    "warmup_until": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "weights": {
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                      }
                                    },
                                    "samples": {
                                      "type": "object",
                                      "properties": {
                                        "clicks": {
                                          "maxItems": 10,
                                          "type": "array",
                                          "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "conversions": {
                                          "maxItems": 10,
                                          "type": "array",
                                          "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        }
                                      },
                                      "required": [
                                        "clicks",
                                        "conversions"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "winner_index": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9
                                    },
                                    "stopped_at": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "min_sample"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "enabled",
                                "variants"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rules": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 40
                              },
                              "enabled": {
                                "default": true,
                                "type": "boolean"
                              },
                              "label": {
                                "type": "string",
                                "maxLength": 80
                              },
                              "invert": {
                                "default": false,
                                "type": "boolean"
                              },
                              "match": {
                                "type": "object",
                                "properties": {
                                  "visitor_type": {
                                    "minItems": 1,
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "search_bot",
                                        "social_preview",
                                        "seo_crawler",
                                        "ai_crawler",
                                        "monitoring",
                                        "security_scanner",
                                        "library",
                                        "headless",
                                        "feed_reader",
                                        "automated",
                                        "datacenter",
                                        "proxy",
                                        "vpn",
                                        "tor",
                                        "unknown"
                                      ]
                                    }
                                  },
                                  "verified_bot": {
                                    "type": "boolean"
                                  },
                                  "proxy_type": {
                                    "minItems": 1,
                                    "maxItems": 6,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "DCH",
                                        "PUB",
                                        "VPN",
                                        "SES",
                                        "TOR",
                                        "WEB"
                                      ]
                                    }
                                  },
                                  "quality_below": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 250,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "region": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80
                                    }
                                  },
                                  "city": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    }
                                  },
                                  "asn": {
                                    "minItems": 1,
                                    "maxItems": 200,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 4294967295
                                    }
                                  },
                                  "ip": {
                                    "minItems": 1,
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 2,
                                      "maxLength": 49
                                    }
                                  },
                                  "user_agent": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "referer": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "has_utm": {
                                    "type": "boolean"
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "maxItems": 3,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  },
                                  "local_time": {
                                    "type": "object",
                                    "properties": {
                                      "from": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      },
                                      "to": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      }
                                    },
                                    "required": [
                                      "from",
                                      "to"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "weekday": {
                                    "minItems": 1,
                                    "maxItems": 7,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 7
                                    }
                                  },
                                  "visit": {
                                    "type": "string",
                                    "enum": [
                                      "first",
                                      "repeat"
                                    ]
                                  },
                                  "ip_list_ids": {
                                    "minItems": 1,
                                    "maxItems": 5,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 40
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "action": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "pass"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "block"
                                      },
                                      "status": {
                                        "default": 404,
                                        "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                        "anyOf": [
                                          {
                                            "type": "number",
                                            "const": 404
                                          },
                                          {
                                            "type": "number",
                                            "const": 410
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "status"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "redirect"
                                      },
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "url"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "page"
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 140
                                      },
                                      "text": {
                                        "type": "string",
                                        "maxLength": 600
                                      },
                                      "button_label": {
                                        "type": "string",
                                        "maxLength": 60
                                      },
                                      "button_url": {
                                        "type": "string",
                                        "maxLength": 2048,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "warn"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "enabled",
                              "invert",
                              "match",
                              "action"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "workspace_rules_off": {
                          "type": "boolean"
                        },
                        "mobile": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "default": false,
                                  "type": "boolean"
                                },
                                "ios": {
                                  "type": "object",
                                  "properties": {
                                    "app_url": {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    "store_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    },
                                    "web_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "android": {
                                  "type": "object",
                                  "properties": {
                                    "app_url": {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    "store_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    },
                                    "web_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "desktop_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                },
                                "tablet": {
                                  "default": "mobile",
                                  "type": "string",
                                  "enum": [
                                    "mobile",
                                    "desktop"
                                  ]
                                },
                                "in_app": {
                                  "default": "attempt",
                                  "type": "string",
                                  "enum": [
                                    "attempt",
                                    "store",
                                    "web"
                                  ]
                                },
                                "delay_ms": {
                                  "default": 1600,
                                  "type": "integer",
                                  "minimum": 500,
                                  "maximum": 5000
                                },
                                "deferred": {
                                  "default": false,
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "enabled",
                                "tablet",
                                "in_app",
                                "delay_ms",
                                "deferred"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rotator": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "mode": {
                                  "type": "string",
                                  "enum": [
                                    "weighted",
                                    "round_robin",
                                    "uniform"
                                  ]
                                },
                                "sticky_ttl_seconds": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "fallback_url": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "auto_disable_unhealthy": {
                                  "type": "boolean"
                                },
                                "destinations": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "weight": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "active": {
                                        "type": "boolean"
                                      },
                                      "limits": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "max_total_clicks": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 1000000000
                                              },
                                              "max_daily_clicks": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 1000000000
                                              },
                                              "starts_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "ends_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "countries": {
                                                "minItems": 1,
                                                "maxItems": 50,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "pattern": "^[A-Z]{2}$"
                                                }
                                              },
                                              "devices": {
                                                "minItems": 1,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "enum": [
                                                    "desktop",
                                                    "mobile",
                                                    "tablet"
                                                  ]
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "used_total_clicks": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "used_daily_clicks": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "exhausted": {
                                        "type": "boolean"
                                      },
                                      "health_ok": {
                                        "anyOf": [
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "health_checked_at": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "auto_disabled_at": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "url",
                                      "weight",
                                      "active",
                                      "limits",
                                      "used_total_clicks",
                                      "used_daily_clicks",
                                      "exhausted",
                                      "health_ok",
                                      "health_checked_at",
                                      "auto_disabled_at"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "enabled",
                                "mode",
                                "sticky_ttl_seconds",
                                "fallback_url",
                                "auto_disable_unhealthy",
                                "destinations"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ios_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                        },
                        "android_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                        },
                        "utm": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "utm_source": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_medium": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_campaign": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_term": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_content": {
                                  "type": "string",
                                  "maxLength": 120
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "og_override": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string",
                                  "maxLength": 140
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 300
                                },
                                "image_url": {
                                  "type": "string",
                                  "maxLength": 2048,
                                  "format": "uri"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "pixel_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "qr_preset_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "public_stats": {
                          "type": "boolean"
                        },
                        "archived_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "short_url",
                        "domain_id",
                        "domain",
                        "slug",
                        "url",
                        "title",
                        "note",
                        "folder_id",
                        "tags",
                        "redirect_type",
                        "expires_at",
                        "expired_url",
                        "has_password",
                        "targeting",
                        "ab_test",
                        "rules",
                        "workspace_rules_off",
                        "mobile",
                        "rotator",
                        "ios_url",
                        "android_url",
                        "utm",
                        "og_override",
                        "pixel_ids",
                        "qr_preset_id",
                        "public_stats",
                        "archived_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateLink",
        "summary": "Update a link",
        "description": "Partial update: only the fields present in the body are changed.\n\nRequires a workspace key (`lp_live_…`). Required scope: `links:write`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Link id (lnk_…)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8192
                  },
                  "domain_id": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 64
                  },
                  "slug": {
                    "type": "string",
                    "maxLength": 64
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "folder_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tag_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 64
                    }
                  },
                  "redirect_type": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 301
                      },
                      {
                        "type": "number",
                        "const": 302
                      },
                      {
                        "type": "number",
                        "const": 307
                      },
                      {
                        "type": "number",
                        "const": 308
                      }
                    ]
                  },
                  "expires_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "expired_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 8192
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "password": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "targeting": {
                    "maxItems": 50,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "match": {
                          "type": "object",
                          "properties": {
                            "country": {
                              "minItems": 1,
                              "maxItems": 50,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              }
                            },
                            "device": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "desktop",
                                  "mobile",
                                  "tablet"
                                ]
                              }
                            },
                            "os": {
                              "minItems": 1,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "ios",
                                  "android",
                                  "windows",
                                  "macos",
                                  "linux",
                                  "other"
                                ]
                              }
                            },
                            "language": {
                              "minItems": 1,
                              "maxItems": 20,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                              }
                            }
                          }
                        },
                        "url": {
                          "type": "string",
                          "maxLength": 8192,
                          "format": "uri"
                        }
                      },
                      "required": [
                        "match",
                        "url"
                      ]
                    }
                  },
                  "ab_test": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "variants": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "url": {
                              "type": "string",
                              "maxLength": 8192,
                              "format": "uri"
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "label": {
                              "type": "string",
                              "maxLength": 40
                            }
                          },
                          "required": [
                            "url",
                            "weight"
                          ]
                        }
                      },
                      "auto": {
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "type": "boolean"
                          },
                          "min_sample": {
                            "default": 1000,
                            "type": "integer",
                            "minimum": 10,
                            "maximum": 1000000000
                          },
                          "warmup_until": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          },
                          "weights": {
                            "maxItems": 10,
                            "type": "array",
                            "items": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            }
                          },
                          "samples": {
                            "type": "object",
                            "properties": {
                              "clicks": {
                                "maxItems": 10,
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              },
                              "conversions": {
                                "maxItems": 10,
                                "type": "array",
                                "items": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                }
                              }
                            },
                            "required": [
                              "clicks",
                              "conversions"
                            ]
                          },
                          "winner_index": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9
                          },
                          "stopped_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                          }
                        },
                        "required": [
                          "enabled"
                        ]
                      }
                    },
                    "required": [
                      "enabled",
                      "variants"
                    ]
                  },
                  "rules": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 3,
                          "maxLength": 40
                        },
                        "enabled": {
                          "default": true,
                          "type": "boolean"
                        },
                        "label": {
                          "type": "string",
                          "maxLength": 80
                        },
                        "invert": {
                          "default": false,
                          "type": "boolean"
                        },
                        "match": {
                          "type": "object",
                          "properties": {
                            "visitor_type": {
                              "minItems": 1,
                              "maxItems": 16,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "human",
                                  "search_bot",
                                  "social_preview",
                                  "seo_crawler",
                                  "ai_crawler",
                                  "monitoring",
                                  "security_scanner",
                                  "library",
                                  "headless",
                                  "feed_reader",
                                  "automated",
                                  "datacenter",
                                  "proxy",
                                  "vpn",
                                  "tor",
                                  "unknown"
                                ]
                              }
                            },
                            "verified_bot": {
                              "type": "boolean"
                            },
                            "proxy_type": {
                              "minItems": 1,
                              "maxItems": 6,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "DCH",
                                  "PUB",
                                  "VPN",
                                  "SES",
                                  "TOR",
                                  "WEB"
                                ]
                              }
                            },
                            "quality_below": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "country": {
                              "minItems": 1,
                              "maxItems": 250,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              }
                            },
                            "region": {
                              "minItems": 1,
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 80
                              }
                            },
                            "city": {
                              "minItems": 1,
                              "maxItems": 100,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 120
                              }
                            },
                            "asn": {
                              "minItems": 1,
                              "maxItems": 200,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 4294967295
                              }
                            },
                            "ip": {
                              "minItems": 1,
                              "maxItems": 1000,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 2,
                                "maxLength": 49
                              }
                            },
                            "user_agent": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "referer": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 200
                            },
                            "has_utm": {
                              "type": "boolean"
                            },
                            "device": {
                              "minItems": 1,
                              "maxItems": 3,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "enum": [
                                  "desktop",
                                  "mobile",
                                  "tablet"
                                ]
                              }
                            },
                            "language": {
                              "minItems": 1,
                              "maxItems": 20,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                              }
                            },
                            "local_time": {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 23
                                },
                                "to": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 23
                                }
                              },
                              "required": [
                                "from",
                                "to"
                              ]
                            },
                            "weekday": {
                              "minItems": 1,
                              "maxItems": 7,
                              "type": "array",
                              "items": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 7
                              }
                            },
                            "visit": {
                              "type": "string",
                              "enum": [
                                "first",
                                "repeat"
                              ]
                            },
                            "ip_list_ids": {
                              "minItems": 1,
                              "maxItems": 5,
                              "type": "array",
                              "items": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 40
                              }
                            }
                          }
                        },
                        "action": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "pass"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "block"
                                },
                                "status": {
                                  "default": 404,
                                  "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                  "anyOf": [
                                    {
                                      "type": "number",
                                      "const": 404
                                    },
                                    {
                                      "type": "number",
                                      "const": 410
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "redirect"
                                },
                                "url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                }
                              },
                              "required": [
                                "type",
                                "url"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "page"
                                },
                                "title": {
                                  "type": "string",
                                  "maxLength": 140
                                },
                                "text": {
                                  "type": "string",
                                  "maxLength": 600
                                },
                                "button_label": {
                                  "type": "string",
                                  "maxLength": 60
                                },
                                "button_url": {
                                  "type": "string",
                                  "maxLength": 2048,
                                  "format": "uri"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "warn"
                                }
                              },
                              "required": [
                                "type"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "match",
                        "action"
                      ]
                    }
                  },
                  "workspace_rules_off": {
                    "type": "boolean"
                  },
                  "mobile": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "default": false,
                        "type": "boolean"
                      },
                      "ios": {
                        "type": "object",
                        "properties": {
                          "app_url": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "store_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          },
                          "web_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          }
                        }
                      },
                      "android": {
                        "type": "object",
                        "properties": {
                          "app_url": {
                            "type": "string",
                            "maxLength": 2048
                          },
                          "store_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          },
                          "web_url": {
                            "type": "string",
                            "maxLength": 8192,
                            "format": "uri"
                          }
                        }
                      },
                      "desktop_url": {
                        "type": "string",
                        "maxLength": 8192,
                        "format": "uri"
                      },
                      "tablet": {
                        "default": "mobile",
                        "type": "string",
                        "enum": [
                          "mobile",
                          "desktop"
                        ]
                      },
                      "in_app": {
                        "default": "attempt",
                        "type": "string",
                        "enum": [
                          "attempt",
                          "store",
                          "web"
                        ]
                      },
                      "delay_ms": {
                        "default": 1600,
                        "type": "integer",
                        "minimum": 500,
                        "maximum": 5000
                      },
                      "deferred": {
                        "default": false,
                        "type": "boolean"
                      }
                    }
                  },
                  "rotator": {
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "mode": {
                        "default": "weighted",
                        "type": "string",
                        "enum": [
                          "weighted",
                          "round_robin",
                          "uniform"
                        ]
                      },
                      "sticky_ttl_seconds": {
                        "default": 0,
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 2592000
                      },
                      "fallback_url": {
                        "type": "string",
                        "maxLength": 8192,
                        "format": "uri"
                      },
                      "auto_disable_unhealthy": {
                        "default": false,
                        "type": "boolean"
                      },
                      "destinations": {
                        "maxItems": 20,
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 40
                            },
                            "url": {
                              "type": "string",
                              "maxLength": 8192,
                              "format": "uri"
                            },
                            "weight": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "active": {
                              "default": true,
                              "type": "boolean"
                            },
                            "limits": {
                              "type": "object",
                              "properties": {
                                "max_total_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000
                                },
                                "max_daily_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000
                                },
                                "starts_at": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "ends_at": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "countries": {
                                  "minItems": 1,
                                  "maxItems": 50,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$"
                                  }
                                },
                                "devices": {
                                  "minItems": 1,
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "enum": [
                                      "desktop",
                                      "mobile",
                                      "tablet"
                                    ]
                                  }
                                }
                              }
                            }
                          },
                          "required": [
                            "url",
                            "weight"
                          ]
                        }
                      }
                    },
                    "required": [
                      "enabled",
                      "destinations"
                    ]
                  },
                  "ios_url": {
                    "deprecated": true,
                    "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`.",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 8192
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "android_url": {
                    "deprecated": true,
                    "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`.",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 8192
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "utm": {
                    "type": "object",
                    "properties": {
                      "utm_source": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_medium": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_campaign": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_term": {
                        "type": "string",
                        "maxLength": 120
                      },
                      "utm_content": {
                        "type": "string",
                        "maxLength": 120
                      }
                    }
                  },
                  "og_override": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string",
                        "maxLength": 140
                      },
                      "description": {
                        "type": "string",
                        "maxLength": 300
                      },
                      "image_url": {
                        "type": "string",
                        "maxLength": 2048,
                        "format": "uri"
                      }
                    }
                  },
                  "pixel_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 64
                    }
                  },
                  "qr_preset_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 3,
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "public_stats": {
                    "type": "boolean"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "short_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "domain_id": {
                          "type": "string"
                        },
                        "domain": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "title": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "note": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "folder_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "color": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "color"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "redirect_type": {
                          "anyOf": [
                            {
                              "type": "number",
                              "const": 301
                            },
                            {
                              "type": "number",
                              "const": 302
                            },
                            {
                              "type": "number",
                              "const": 307
                            },
                            {
                              "type": "number",
                              "const": 308
                            }
                          ]
                        },
                        "expires_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expired_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_password": {
                          "type": "boolean"
                        },
                        "targeting": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "match": {
                                "type": "object",
                                "properties": {
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "os": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "ios",
                                        "android",
                                        "windows",
                                        "macos",
                                        "linux",
                                        "other"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 8192,
                                "format": "uri"
                              }
                            },
                            "required": [
                              "match",
                              "url"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "ab_test": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "variants": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      },
                                      "weight": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                      },
                                      "label": {
                                        "type": "string",
                                        "maxLength": 40
                                      }
                                    },
                                    "required": [
                                      "url",
                                      "weight"
                                    ],
                                    "additionalProperties": false
                                  }
                                },
                                "auto": {
                                  "type": "object",
                                  "properties": {
                                    "enabled": {
                                      "type": "boolean"
                                    },
                                    "min_sample": {
                                      "default": 1000,
                                      "type": "integer",
                                      "minimum": 10,
                                      "maximum": 1000000000
                                    },
                                    "warmup_until": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    },
                                    "weights": {
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 100
                                      }
                                    },
                                    "samples": {
                                      "type": "object",
                                      "properties": {
                                        "clicks": {
                                          "maxItems": 10,
                                          "type": "array",
                                          "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        },
                                        "conversions": {
                                          "maxItems": 10,
                                          "type": "array",
                                          "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 9007199254740991
                                          }
                                        }
                                      },
                                      "required": [
                                        "clicks",
                                        "conversions"
                                      ],
                                      "additionalProperties": false
                                    },
                                    "winner_index": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9
                                    },
                                    "stopped_at": {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                    }
                                  },
                                  "required": [
                                    "enabled",
                                    "min_sample"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "enabled",
                                "variants"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rules": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 40
                              },
                              "enabled": {
                                "default": true,
                                "type": "boolean"
                              },
                              "label": {
                                "type": "string",
                                "maxLength": 80
                              },
                              "invert": {
                                "default": false,
                                "type": "boolean"
                              },
                              "match": {
                                "type": "object",
                                "properties": {
                                  "visitor_type": {
                                    "minItems": 1,
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "search_bot",
                                        "social_preview",
                                        "seo_crawler",
                                        "ai_crawler",
                                        "monitoring",
                                        "security_scanner",
                                        "library",
                                        "headless",
                                        "feed_reader",
                                        "automated",
                                        "datacenter",
                                        "proxy",
                                        "vpn",
                                        "tor",
                                        "unknown"
                                      ]
                                    }
                                  },
                                  "verified_bot": {
                                    "type": "boolean"
                                  },
                                  "proxy_type": {
                                    "minItems": 1,
                                    "maxItems": 6,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "DCH",
                                        "PUB",
                                        "VPN",
                                        "SES",
                                        "TOR",
                                        "WEB"
                                      ]
                                    }
                                  },
                                  "quality_below": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 250,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "region": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80
                                    }
                                  },
                                  "city": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    }
                                  },
                                  "asn": {
                                    "minItems": 1,
                                    "maxItems": 200,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 4294967295
                                    }
                                  },
                                  "ip": {
                                    "minItems": 1,
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 2,
                                      "maxLength": 49
                                    }
                                  },
                                  "user_agent": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "referer": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "has_utm": {
                                    "type": "boolean"
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "maxItems": 3,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  },
                                  "local_time": {
                                    "type": "object",
                                    "properties": {
                                      "from": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      },
                                      "to": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      }
                                    },
                                    "required": [
                                      "from",
                                      "to"
                                    ],
                                    "additionalProperties": false
                                  },
                                  "weekday": {
                                    "minItems": 1,
                                    "maxItems": 7,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 7
                                    }
                                  },
                                  "visit": {
                                    "type": "string",
                                    "enum": [
                                      "first",
                                      "repeat"
                                    ]
                                  },
                                  "ip_list_ids": {
                                    "minItems": 1,
                                    "maxItems": 5,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 40
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              "action": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "pass"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "block"
                                      },
                                      "status": {
                                        "default": 404,
                                        "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                        "anyOf": [
                                          {
                                            "type": "number",
                                            "const": 404
                                          },
                                          {
                                            "type": "number",
                                            "const": 410
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "status"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "redirect"
                                      },
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "url"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "page"
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 140
                                      },
                                      "text": {
                                        "type": "string",
                                        "maxLength": 600
                                      },
                                      "button_label": {
                                        "type": "string",
                                        "maxLength": 60
                                      },
                                      "button_url": {
                                        "type": "string",
                                        "maxLength": 2048,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "warn"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ],
                                    "additionalProperties": false
                                  }
                                ]
                              }
                            },
                            "required": [
                              "enabled",
                              "invert",
                              "match",
                              "action"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "workspace_rules_off": {
                          "type": "boolean"
                        },
                        "mobile": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "default": false,
                                  "type": "boolean"
                                },
                                "ios": {
                                  "type": "object",
                                  "properties": {
                                    "app_url": {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    "store_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    },
                                    "web_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "android": {
                                  "type": "object",
                                  "properties": {
                                    "app_url": {
                                      "type": "string",
                                      "maxLength": 2048
                                    },
                                    "store_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    },
                                    "web_url": {
                                      "type": "string",
                                      "maxLength": 8192,
                                      "format": "uri"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "desktop_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                },
                                "tablet": {
                                  "default": "mobile",
                                  "type": "string",
                                  "enum": [
                                    "mobile",
                                    "desktop"
                                  ]
                                },
                                "in_app": {
                                  "default": "attempt",
                                  "type": "string",
                                  "enum": [
                                    "attempt",
                                    "store",
                                    "web"
                                  ]
                                },
                                "delay_ms": {
                                  "default": 1600,
                                  "type": "integer",
                                  "minimum": 500,
                                  "maximum": 5000
                                },
                                "deferred": {
                                  "default": false,
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "enabled",
                                "tablet",
                                "in_app",
                                "delay_ms",
                                "deferred"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rotator": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "mode": {
                                  "type": "string",
                                  "enum": [
                                    "weighted",
                                    "round_robin",
                                    "uniform"
                                  ]
                                },
                                "sticky_ttl_seconds": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "fallback_url": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "auto_disable_unhealthy": {
                                  "type": "boolean"
                                },
                                "destinations": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string"
                                      },
                                      "weight": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "active": {
                                        "type": "boolean"
                                      },
                                      "limits": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "properties": {
                                              "max_total_clicks": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 1000000000
                                              },
                                              "max_daily_clicks": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 1000000000
                                              },
                                              "starts_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "ends_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "countries": {
                                                "minItems": 1,
                                                "maxItems": 50,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "pattern": "^[A-Z]{2}$"
                                                }
                                              },
                                              "devices": {
                                                "minItems": 1,
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "enum": [
                                                    "desktop",
                                                    "mobile",
                                                    "tablet"
                                                  ]
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "used_total_clicks": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "used_daily_clicks": {
                                        "type": "integer",
                                        "minimum": -9007199254740991,
                                        "maximum": 9007199254740991
                                      },
                                      "exhausted": {
                                        "type": "boolean"
                                      },
                                      "health_ok": {
                                        "anyOf": [
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "health_checked_at": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "auto_disabled_at": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date-time",
                                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "url",
                                      "weight",
                                      "active",
                                      "limits",
                                      "used_total_clicks",
                                      "used_daily_clicks",
                                      "exhausted",
                                      "health_ok",
                                      "health_checked_at",
                                      "auto_disabled_at"
                                    ],
                                    "additionalProperties": false
                                  }
                                }
                              },
                              "required": [
                                "enabled",
                                "mode",
                                "sticky_ttl_seconds",
                                "fallback_url",
                                "auto_disable_unhealthy",
                                "destinations"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ios_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                        },
                        "android_url": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ],
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                        },
                        "utm": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "utm_source": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_medium": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_campaign": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_term": {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                "utm_content": {
                                  "type": "string",
                                  "maxLength": 120
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "og_override": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "title": {
                                  "type": "string",
                                  "maxLength": 140
                                },
                                "description": {
                                  "type": "string",
                                  "maxLength": 300
                                },
                                "image_url": {
                                  "type": "string",
                                  "maxLength": 2048,
                                  "format": "uri"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "pixel_ids": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "qr_preset_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "public_stats": {
                          "type": "boolean"
                        },
                        "archived_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "short_url",
                        "domain_id",
                        "domain",
                        "slug",
                        "url",
                        "title",
                        "note",
                        "folder_id",
                        "tags",
                        "redirect_type",
                        "expires_at",
                        "expired_url",
                        "has_password",
                        "targeting",
                        "ab_test",
                        "rules",
                        "workspace_rules_off",
                        "mobile",
                        "rotator",
                        "ios_url",
                        "android_url",
                        "utm",
                        "og_override",
                        "pixel_ids",
                        "qr_preset_id",
                        "public_stats",
                        "archived_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteLink",
        "summary": "Archive or delete a link",
        "description": "Archives the link (the redirect stops, the record stays). Pass `?permanent=true` to delete it permanently.\n\nRequires a workspace key (`lp_live_…`). Required scope: `links:write`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Link id (lnk_…)"
          },
          {
            "name": "permanent",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "deleted": {
                          "type": "boolean"
                        },
                        "archived": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "deleted",
                        "archived"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/links/bulk": {
      "post": {
        "operationId": "createLinksBulk",
        "summary": "Create up to 100 links",
        "description": "Validates every row first: a failed row does not fail the batch. Returns a per-row result in the original order.\n\nRequires a workspace key (`lp_live_…`). Required scope: `links:write`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "links": {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 8192
                        },
                        "domain_id": {
                          "type": "string",
                          "minLength": 3,
                          "maxLength": 64
                        },
                        "slug": {
                          "type": "string",
                          "maxLength": 64
                        },
                        "title": {
                          "type": "string",
                          "maxLength": 200
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 2000
                        },
                        "folder_id": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 64
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "tag_ids": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 64
                          }
                        },
                        "redirect_type": {
                          "anyOf": [
                            {
                              "type": "number",
                              "const": 301
                            },
                            {
                              "type": "number",
                              "const": 302
                            },
                            {
                              "type": "number",
                              "const": 307
                            },
                            {
                              "type": "number",
                              "const": 308
                            }
                          ]
                        },
                        "expires_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "expired_url": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 8192
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "password": {
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 200
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "targeting": {
                          "maxItems": 50,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "match": {
                                "type": "object",
                                "properties": {
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "os": {
                                    "minItems": 1,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "ios",
                                        "android",
                                        "windows",
                                        "macos",
                                        "linux",
                                        "other"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  }
                                }
                              },
                              "url": {
                                "type": "string",
                                "maxLength": 8192,
                                "format": "uri"
                              }
                            },
                            "required": [
                              "match",
                              "url"
                            ]
                          }
                        },
                        "ab_test": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "variants": {
                              "maxItems": 10,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string",
                                    "maxLength": 8192,
                                    "format": "uri"
                                  },
                                  "weight": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "label": {
                                    "type": "string",
                                    "maxLength": 40
                                  }
                                },
                                "required": [
                                  "url",
                                  "weight"
                                ]
                              }
                            },
                            "auto": {
                              "type": "object",
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "min_sample": {
                                  "default": 1000,
                                  "type": "integer",
                                  "minimum": 10,
                                  "maximum": 1000000000
                                },
                                "warmup_until": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                },
                                "weights": {
                                  "maxItems": 10,
                                  "type": "array",
                                  "items": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  }
                                },
                                "samples": {
                                  "type": "object",
                                  "properties": {
                                    "clicks": {
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    },
                                    "conversions": {
                                      "maxItems": 10,
                                      "type": "array",
                                      "items": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 9007199254740991
                                      }
                                    }
                                  },
                                  "required": [
                                    "clicks",
                                    "conversions"
                                  ]
                                },
                                "winner_index": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9
                                },
                                "stopped_at": {
                                  "type": "string",
                                  "format": "date-time",
                                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                }
                              },
                              "required": [
                                "enabled"
                              ]
                            }
                          },
                          "required": [
                            "enabled",
                            "variants"
                          ]
                        },
                        "rules": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 3,
                                "maxLength": 40
                              },
                              "enabled": {
                                "default": true,
                                "type": "boolean"
                              },
                              "label": {
                                "type": "string",
                                "maxLength": 80
                              },
                              "invert": {
                                "default": false,
                                "type": "boolean"
                              },
                              "match": {
                                "type": "object",
                                "properties": {
                                  "visitor_type": {
                                    "minItems": 1,
                                    "maxItems": 16,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "human",
                                        "search_bot",
                                        "social_preview",
                                        "seo_crawler",
                                        "ai_crawler",
                                        "monitoring",
                                        "security_scanner",
                                        "library",
                                        "headless",
                                        "feed_reader",
                                        "automated",
                                        "datacenter",
                                        "proxy",
                                        "vpn",
                                        "tor",
                                        "unknown"
                                      ]
                                    }
                                  },
                                  "verified_bot": {
                                    "type": "boolean"
                                  },
                                  "proxy_type": {
                                    "minItems": 1,
                                    "maxItems": 6,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "DCH",
                                        "PUB",
                                        "VPN",
                                        "SES",
                                        "TOR",
                                        "WEB"
                                      ]
                                    }
                                  },
                                  "quality_below": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "country": {
                                    "minItems": 1,
                                    "maxItems": 250,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[A-Z]{2}$"
                                    }
                                  },
                                  "region": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 80
                                    }
                                  },
                                  "city": {
                                    "minItems": 1,
                                    "maxItems": 100,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 1,
                                      "maxLength": 120
                                    }
                                  },
                                  "asn": {
                                    "minItems": 1,
                                    "maxItems": 200,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 4294967295
                                    }
                                  },
                                  "ip": {
                                    "minItems": 1,
                                    "maxItems": 1000,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 2,
                                      "maxLength": 49
                                    }
                                  },
                                  "user_agent": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "referer": {
                                    "type": "string",
                                    "minLength": 1,
                                    "maxLength": 200
                                  },
                                  "has_utm": {
                                    "type": "boolean"
                                  },
                                  "device": {
                                    "minItems": 1,
                                    "maxItems": 3,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "enum": [
                                        "desktop",
                                        "mobile",
                                        "tablet"
                                      ]
                                    }
                                  },
                                  "language": {
                                    "minItems": 1,
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                    }
                                  },
                                  "local_time": {
                                    "type": "object",
                                    "properties": {
                                      "from": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      },
                                      "to": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 23
                                      }
                                    },
                                    "required": [
                                      "from",
                                      "to"
                                    ]
                                  },
                                  "weekday": {
                                    "minItems": 1,
                                    "maxItems": 7,
                                    "type": "array",
                                    "items": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 7
                                    }
                                  },
                                  "visit": {
                                    "type": "string",
                                    "enum": [
                                      "first",
                                      "repeat"
                                    ]
                                  },
                                  "ip_list_ids": {
                                    "minItems": 1,
                                    "maxItems": 5,
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "minLength": 3,
                                      "maxLength": 40
                                    }
                                  }
                                }
                              },
                              "action": {
                                "oneOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "pass"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "block"
                                      },
                                      "status": {
                                        "default": 404,
                                        "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                        "anyOf": [
                                          {
                                            "type": "number",
                                            "const": 404
                                          },
                                          {
                                            "type": "number",
                                            "const": 410
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "redirect"
                                      },
                                      "url": {
                                        "type": "string",
                                        "maxLength": 8192,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type",
                                      "url"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "page"
                                      },
                                      "title": {
                                        "type": "string",
                                        "maxLength": 140
                                      },
                                      "text": {
                                        "type": "string",
                                        "maxLength": 600
                                      },
                                      "button_label": {
                                        "type": "string",
                                        "maxLength": 60
                                      },
                                      "button_url": {
                                        "type": "string",
                                        "maxLength": 2048,
                                        "format": "uri"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "type": {
                                        "type": "string",
                                        "const": "warn"
                                      }
                                    },
                                    "required": [
                                      "type"
                                    ]
                                  }
                                ]
                              }
                            },
                            "required": [
                              "match",
                              "action"
                            ]
                          }
                        },
                        "workspace_rules_off": {
                          "type": "boolean"
                        },
                        "mobile": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "default": false,
                              "type": "boolean"
                            },
                            "ios": {
                              "type": "object",
                              "properties": {
                                "app_url": {
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                "store_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                },
                                "web_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                }
                              }
                            },
                            "android": {
                              "type": "object",
                              "properties": {
                                "app_url": {
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                "store_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                },
                                "web_url": {
                                  "type": "string",
                                  "maxLength": 8192,
                                  "format": "uri"
                                }
                              }
                            },
                            "desktop_url": {
                              "type": "string",
                              "maxLength": 8192,
                              "format": "uri"
                            },
                            "tablet": {
                              "default": "mobile",
                              "type": "string",
                              "enum": [
                                "mobile",
                                "desktop"
                              ]
                            },
                            "in_app": {
                              "default": "attempt",
                              "type": "string",
                              "enum": [
                                "attempt",
                                "store",
                                "web"
                              ]
                            },
                            "delay_ms": {
                              "default": 1600,
                              "type": "integer",
                              "minimum": 500,
                              "maximum": 5000
                            },
                            "deferred": {
                              "default": false,
                              "type": "boolean"
                            }
                          }
                        },
                        "rotator": {
                          "type": "object",
                          "properties": {
                            "enabled": {
                              "type": "boolean"
                            },
                            "mode": {
                              "default": "weighted",
                              "type": "string",
                              "enum": [
                                "weighted",
                                "round_robin",
                                "uniform"
                              ]
                            },
                            "sticky_ttl_seconds": {
                              "default": 0,
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 2592000
                            },
                            "fallback_url": {
                              "type": "string",
                              "maxLength": 8192,
                              "format": "uri"
                            },
                            "auto_disable_unhealthy": {
                              "default": false,
                              "type": "boolean"
                            },
                            "destinations": {
                              "maxItems": 20,
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "minLength": 3,
                                    "maxLength": 40
                                  },
                                  "url": {
                                    "type": "string",
                                    "maxLength": 8192,
                                    "format": "uri"
                                  },
                                  "weight": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "active": {
                                    "default": true,
                                    "type": "boolean"
                                  },
                                  "limits": {
                                    "type": "object",
                                    "properties": {
                                      "max_total_clicks": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 1000000000
                                      },
                                      "max_daily_clicks": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 1000000000
                                      },
                                      "starts_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "ends_at": {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                      },
                                      "countries": {
                                        "minItems": 1,
                                        "maxItems": 50,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "pattern": "^[A-Z]{2}$"
                                        }
                                      },
                                      "devices": {
                                        "minItems": 1,
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "enum": [
                                            "desktop",
                                            "mobile",
                                            "tablet"
                                          ]
                                        }
                                      }
                                    }
                                  }
                                },
                                "required": [
                                  "url",
                                  "weight"
                                ]
                              }
                            }
                          },
                          "required": [
                            "enabled",
                            "destinations"
                          ]
                        },
                        "ios_url": {
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`.",
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 8192
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "android_url": {
                          "deprecated": true,
                          "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`.",
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 8192
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "utm": {
                          "type": "object",
                          "properties": {
                            "utm_source": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "utm_medium": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "utm_campaign": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "utm_term": {
                              "type": "string",
                              "maxLength": 120
                            },
                            "utm_content": {
                              "type": "string",
                              "maxLength": 120
                            }
                          }
                        },
                        "og_override": {
                          "type": "object",
                          "properties": {
                            "title": {
                              "type": "string",
                              "maxLength": 140
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 300
                            },
                            "image_url": {
                              "type": "string",
                              "maxLength": 2048,
                              "format": "uri"
                            }
                          }
                        },
                        "pixel_ids": {
                          "maxItems": 20,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "minLength": 3,
                            "maxLength": 64
                          }
                        },
                        "qr_preset_id": {
                          "anyOf": [
                            {
                              "type": "string",
                              "minLength": 3,
                              "maxLength": 64
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "public_stats": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "url"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "links"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "created"
                              },
                              "index": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "link": {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "short_url": {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  "domain_id": {
                                    "type": "string"
                                  },
                                  "domain": {
                                    "type": "string"
                                  },
                                  "slug": {
                                    "type": "string"
                                  },
                                  "url": {
                                    "type": "string"
                                  },
                                  "title": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "note": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "folder_id": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "tags": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string"
                                        },
                                        "name": {
                                          "type": "string"
                                        },
                                        "color": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "id",
                                        "name",
                                        "color"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "redirect_type": {
                                    "anyOf": [
                                      {
                                        "type": "number",
                                        "const": 301
                                      },
                                      {
                                        "type": "number",
                                        "const": 302
                                      },
                                      {
                                        "type": "number",
                                        "const": 307
                                      },
                                      {
                                        "type": "number",
                                        "const": 308
                                      }
                                    ]
                                  },
                                  "expires_at": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "expired_url": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "has_password": {
                                    "type": "boolean"
                                  },
                                  "targeting": {
                                    "maxItems": 50,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "match": {
                                          "type": "object",
                                          "properties": {
                                            "country": {
                                              "minItems": 1,
                                              "maxItems": 50,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[A-Z]{2}$"
                                              }
                                            },
                                            "device": {
                                              "minItems": 1,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "desktop",
                                                  "mobile",
                                                  "tablet"
                                                ]
                                              }
                                            },
                                            "os": {
                                              "minItems": 1,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "ios",
                                                  "android",
                                                  "windows",
                                                  "macos",
                                                  "linux",
                                                  "other"
                                                ]
                                              }
                                            },
                                            "language": {
                                              "minItems": 1,
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "url": {
                                          "type": "string",
                                          "maxLength": 8192,
                                          "format": "uri"
                                        }
                                      },
                                      "required": [
                                        "match",
                                        "url"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "ab_test": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "type": "boolean"
                                          },
                                          "variants": {
                                            "maxItems": 10,
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "url": {
                                                  "type": "string",
                                                  "maxLength": 8192,
                                                  "format": "uri"
                                                },
                                                "weight": {
                                                  "type": "integer",
                                                  "minimum": 1,
                                                  "maximum": 100
                                                },
                                                "label": {
                                                  "type": "string",
                                                  "maxLength": 40
                                                }
                                              },
                                              "required": [
                                                "url",
                                                "weight"
                                              ],
                                              "additionalProperties": false
                                            }
                                          },
                                          "auto": {
                                            "type": "object",
                                            "properties": {
                                              "enabled": {
                                                "type": "boolean"
                                              },
                                              "min_sample": {
                                                "default": 1000,
                                                "type": "integer",
                                                "minimum": 10,
                                                "maximum": 1000000000
                                              },
                                              "warmup_until": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              },
                                              "weights": {
                                                "maxItems": 10,
                                                "type": "array",
                                                "items": {
                                                  "type": "integer",
                                                  "minimum": 1,
                                                  "maximum": 100
                                                }
                                              },
                                              "samples": {
                                                "type": "object",
                                                "properties": {
                                                  "clicks": {
                                                    "maxItems": 10,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  },
                                                  "conversions": {
                                                    "maxItems": 10,
                                                    "type": "array",
                                                    "items": {
                                                      "type": "integer",
                                                      "minimum": 0,
                                                      "maximum": 9007199254740991
                                                    }
                                                  }
                                                },
                                                "required": [
                                                  "clicks",
                                                  "conversions"
                                                ],
                                                "additionalProperties": false
                                              },
                                              "winner_index": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 9
                                              },
                                              "stopped_at": {
                                                "type": "string",
                                                "format": "date-time",
                                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                              }
                                            },
                                            "required": [
                                              "enabled",
                                              "min_sample"
                                            ],
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "variants"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "rules": {
                                    "maxItems": 20,
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "minLength": 3,
                                          "maxLength": 40
                                        },
                                        "enabled": {
                                          "default": true,
                                          "type": "boolean"
                                        },
                                        "label": {
                                          "type": "string",
                                          "maxLength": 80
                                        },
                                        "invert": {
                                          "default": false,
                                          "type": "boolean"
                                        },
                                        "match": {
                                          "type": "object",
                                          "properties": {
                                            "visitor_type": {
                                              "minItems": 1,
                                              "maxItems": 16,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "human",
                                                  "search_bot",
                                                  "social_preview",
                                                  "seo_crawler",
                                                  "ai_crawler",
                                                  "monitoring",
                                                  "security_scanner",
                                                  "library",
                                                  "headless",
                                                  "feed_reader",
                                                  "automated",
                                                  "datacenter",
                                                  "proxy",
                                                  "vpn",
                                                  "tor",
                                                  "unknown"
                                                ]
                                              }
                                            },
                                            "verified_bot": {
                                              "type": "boolean"
                                            },
                                            "proxy_type": {
                                              "minItems": 1,
                                              "maxItems": 6,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "DCH",
                                                  "PUB",
                                                  "VPN",
                                                  "SES",
                                                  "TOR",
                                                  "WEB"
                                                ]
                                              }
                                            },
                                            "quality_below": {
                                              "type": "integer",
                                              "minimum": 1,
                                              "maximum": 100
                                            },
                                            "country": {
                                              "minItems": 1,
                                              "maxItems": 250,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[A-Z]{2}$"
                                              }
                                            },
                                            "region": {
                                              "minItems": 1,
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 80
                                              }
                                            },
                                            "city": {
                                              "minItems": 1,
                                              "maxItems": 100,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 120
                                              }
                                            },
                                            "asn": {
                                              "minItems": 1,
                                              "maxItems": 200,
                                              "type": "array",
                                              "items": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 4294967295
                                              }
                                            },
                                            "ip": {
                                              "minItems": 1,
                                              "maxItems": 1000,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 2,
                                                "maxLength": 49
                                              }
                                            },
                                            "user_agent": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 200
                                            },
                                            "referer": {
                                              "type": "string",
                                              "minLength": 1,
                                              "maxLength": 200
                                            },
                                            "has_utm": {
                                              "type": "boolean"
                                            },
                                            "device": {
                                              "minItems": 1,
                                              "maxItems": 3,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "enum": [
                                                  "desktop",
                                                  "mobile",
                                                  "tablet"
                                                ]
                                              }
                                            },
                                            "language": {
                                              "minItems": 1,
                                              "maxItems": 20,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})?$"
                                              }
                                            },
                                            "local_time": {
                                              "type": "object",
                                              "properties": {
                                                "from": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 23
                                                },
                                                "to": {
                                                  "type": "integer",
                                                  "minimum": 0,
                                                  "maximum": 23
                                                }
                                              },
                                              "required": [
                                                "from",
                                                "to"
                                              ],
                                              "additionalProperties": false
                                            },
                                            "weekday": {
                                              "minItems": 1,
                                              "maxItems": 7,
                                              "type": "array",
                                              "items": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 7
                                              }
                                            },
                                            "visit": {
                                              "type": "string",
                                              "enum": [
                                                "first",
                                                "repeat"
                                              ]
                                            },
                                            "ip_list_ids": {
                                              "minItems": 1,
                                              "maxItems": 5,
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "minLength": 3,
                                                "maxLength": 40
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "action": {
                                          "oneOf": [
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "pass"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "block"
                                                },
                                                "status": {
                                                  "default": 404,
                                                  "description": "404 — неотличимо от несуществующей ссылки, 410 — «удалено навсегда»",
                                                  "anyOf": [
                                                    {
                                                      "type": "number",
                                                      "const": 404
                                                    },
                                                    {
                                                      "type": "number",
                                                      "const": 410
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "status"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "redirect"
                                                },
                                                "url": {
                                                  "type": "string",
                                                  "maxLength": 8192,
                                                  "format": "uri"
                                                }
                                              },
                                              "required": [
                                                "type",
                                                "url"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "page"
                                                },
                                                "title": {
                                                  "type": "string",
                                                  "maxLength": 140
                                                },
                                                "text": {
                                                  "type": "string",
                                                  "maxLength": 600
                                                },
                                                "button_label": {
                                                  "type": "string",
                                                  "maxLength": 60
                                                },
                                                "button_url": {
                                                  "type": "string",
                                                  "maxLength": 2048,
                                                  "format": "uri"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            },
                                            {
                                              "type": "object",
                                              "properties": {
                                                "type": {
                                                  "type": "string",
                                                  "const": "warn"
                                                }
                                              },
                                              "required": [
                                                "type"
                                              ],
                                              "additionalProperties": false
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "enabled",
                                        "invert",
                                        "match",
                                        "action"
                                      ],
                                      "additionalProperties": false
                                    }
                                  },
                                  "workspace_rules_off": {
                                    "type": "boolean"
                                  },
                                  "mobile": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "default": false,
                                            "type": "boolean"
                                          },
                                          "ios": {
                                            "type": "object",
                                            "properties": {
                                              "app_url": {
                                                "type": "string",
                                                "maxLength": 2048
                                              },
                                              "store_url": {
                                                "type": "string",
                                                "maxLength": 8192,
                                                "format": "uri"
                                              },
                                              "web_url": {
                                                "type": "string",
                                                "maxLength": 8192,
                                                "format": "uri"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "android": {
                                            "type": "object",
                                            "properties": {
                                              "app_url": {
                                                "type": "string",
                                                "maxLength": 2048
                                              },
                                              "store_url": {
                                                "type": "string",
                                                "maxLength": 8192,
                                                "format": "uri"
                                              },
                                              "web_url": {
                                                "type": "string",
                                                "maxLength": 8192,
                                                "format": "uri"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "desktop_url": {
                                            "type": "string",
                                            "maxLength": 8192,
                                            "format": "uri"
                                          },
                                          "tablet": {
                                            "default": "mobile",
                                            "type": "string",
                                            "enum": [
                                              "mobile",
                                              "desktop"
                                            ]
                                          },
                                          "in_app": {
                                            "default": "attempt",
                                            "type": "string",
                                            "enum": [
                                              "attempt",
                                              "store",
                                              "web"
                                            ]
                                          },
                                          "delay_ms": {
                                            "default": 1600,
                                            "type": "integer",
                                            "minimum": 500,
                                            "maximum": 5000
                                          },
                                          "deferred": {
                                            "default": false,
                                            "type": "boolean"
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "tablet",
                                          "in_app",
                                          "delay_ms",
                                          "deferred"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "rotator": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "enabled": {
                                            "type": "boolean"
                                          },
                                          "mode": {
                                            "type": "string",
                                            "enum": [
                                              "weighted",
                                              "round_robin",
                                              "uniform"
                                            ]
                                          },
                                          "sticky_ttl_seconds": {
                                            "type": "integer",
                                            "minimum": -9007199254740991,
                                            "maximum": 9007199254740991
                                          },
                                          "fallback_url": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "auto_disable_unhealthy": {
                                            "type": "boolean"
                                          },
                                          "destinations": {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "properties": {
                                                "id": {
                                                  "type": "string"
                                                },
                                                "url": {
                                                  "type": "string"
                                                },
                                                "weight": {
                                                  "type": "integer",
                                                  "minimum": -9007199254740991,
                                                  "maximum": 9007199254740991
                                                },
                                                "active": {
                                                  "type": "boolean"
                                                },
                                                "limits": {
                                                  "anyOf": [
                                                    {
                                                      "type": "object",
                                                      "properties": {
                                                        "max_total_clicks": {
                                                          "type": "integer",
                                                          "minimum": 1,
                                                          "maximum": 1000000000
                                                        },
                                                        "max_daily_clicks": {
                                                          "type": "integer",
                                                          "minimum": 1,
                                                          "maximum": 1000000000
                                                        },
                                                        "starts_at": {
                                                          "type": "string",
                                                          "format": "date-time",
                                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                        },
                                                        "ends_at": {
                                                          "type": "string",
                                                          "format": "date-time",
                                                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                                                        },
                                                        "countries": {
                                                          "minItems": 1,
                                                          "maxItems": 50,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "pattern": "^[A-Z]{2}$"
                                                          }
                                                        },
                                                        "devices": {
                                                          "minItems": 1,
                                                          "type": "array",
                                                          "items": {
                                                            "type": "string",
                                                            "enum": [
                                                              "desktop",
                                                              "mobile",
                                                              "tablet"
                                                            ]
                                                          }
                                                        }
                                                      },
                                                      "additionalProperties": false
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "used_total_clicks": {
                                                  "type": "integer",
                                                  "minimum": -9007199254740991,
                                                  "maximum": 9007199254740991
                                                },
                                                "used_daily_clicks": {
                                                  "type": "integer",
                                                  "minimum": -9007199254740991,
                                                  "maximum": 9007199254740991
                                                },
                                                "exhausted": {
                                                  "type": "boolean"
                                                },
                                                "health_ok": {
                                                  "anyOf": [
                                                    {
                                                      "type": "boolean"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "health_checked_at": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                },
                                                "auto_disabled_at": {
                                                  "anyOf": [
                                                    {
                                                      "type": "string",
                                                      "format": "date-time",
                                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                                    },
                                                    {
                                                      "type": "null"
                                                    }
                                                  ]
                                                }
                                              },
                                              "required": [
                                                "id",
                                                "url",
                                                "weight",
                                                "active",
                                                "limits",
                                                "used_total_clicks",
                                                "used_daily_clicks",
                                                "exhausted",
                                                "health_ok",
                                                "health_checked_at",
                                                "auto_disabled_at"
                                              ],
                                              "additionalProperties": false
                                            }
                                          }
                                        },
                                        "required": [
                                          "enabled",
                                          "mode",
                                          "sticky_ttl_seconds",
                                          "fallback_url",
                                          "auto_disable_unhealthy",
                                          "destinations"
                                        ],
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "ios_url": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "deprecated": true,
                                    "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                                  },
                                  "android_url": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ],
                                    "deprecated": true,
                                    "description": "Deprecated since the `mobile` section: acts as the store URL fallback when `mobile` does not set one for the platform. Prefer `mobile.ios.store_url` / `mobile.android.store_url`."
                                  },
                                  "utm": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "utm_source": {
                                            "type": "string",
                                            "maxLength": 120
                                          },
                                          "utm_medium": {
                                            "type": "string",
                                            "maxLength": 120
                                          },
                                          "utm_campaign": {
                                            "type": "string",
                                            "maxLength": 120
                                          },
                                          "utm_term": {
                                            "type": "string",
                                            "maxLength": 120
                                          },
                                          "utm_content": {
                                            "type": "string",
                                            "maxLength": 120
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "og_override": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "properties": {
                                          "title": {
                                            "type": "string",
                                            "maxLength": 140
                                          },
                                          "description": {
                                            "type": "string",
                                            "maxLength": 300
                                          },
                                          "image_url": {
                                            "type": "string",
                                            "maxLength": 2048,
                                            "format": "uri"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "pixel_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "qr_preset_id": {
                                    "anyOf": [
                                      {
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "public_stats": {
                                    "type": "boolean"
                                  },
                                  "archived_at": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "created_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                  }
                                },
                                "required": [
                                  "id",
                                  "short_url",
                                  "domain_id",
                                  "domain",
                                  "slug",
                                  "url",
                                  "title",
                                  "note",
                                  "folder_id",
                                  "tags",
                                  "redirect_type",
                                  "expires_at",
                                  "expired_url",
                                  "has_password",
                                  "targeting",
                                  "ab_test",
                                  "rules",
                                  "workspace_rules_off",
                                  "mobile",
                                  "rotator",
                                  "ios_url",
                                  "android_url",
                                  "utm",
                                  "og_override",
                                  "pixel_ids",
                                  "qr_preset_id",
                                  "public_stats",
                                  "archived_at",
                                  "created_at"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "status",
                              "index",
                              "link"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "status": {
                                "type": "string",
                                "const": "error"
                              },
                              "index": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "error": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "message": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "message"
                                ],
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "status",
                              "index",
                              "error"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/links/{id}/preview": {
      "post": {
        "operationId": "previewLinkRules",
        "summary": "Preview traffic rules without a click",
        "description": "Describes a visitor (country, device, traffic type, User-Agent) and returns the traffic rule that fires and the destination the visitor would get. The same pure core decides it here and in the redirector, so the preview cannot drift from real behaviour.\n\nRequires a workspace key (`lp_live_…`). Required scope: `links:read`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Link id (lnk_…)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "country": {
                    "default": "",
                    "type": "string",
                    "maxLength": 2
                  },
                  "region": {
                    "default": "",
                    "type": "string",
                    "maxLength": 80
                  },
                  "city": {
                    "default": "",
                    "type": "string",
                    "maxLength": 120
                  },
                  "asn": {
                    "default": 0,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 4294967295
                  },
                  "ip": {
                    "default": "",
                    "type": "string",
                    "maxLength": 49
                  },
                  "timezone": {
                    "default": "",
                    "type": "string",
                    "maxLength": 64
                  },
                  "user_agent": {
                    "default": "",
                    "type": "string",
                    "maxLength": 512
                  },
                  "referer": {
                    "default": "",
                    "type": "string",
                    "maxLength": 2048
                  },
                  "has_utm": {
                    "default": false,
                    "type": "boolean"
                  },
                  "device": {
                    "default": "unknown",
                    "type": "string",
                    "enum": [
                      "desktop",
                      "mobile",
                      "tablet",
                      "unknown"
                    ]
                  },
                  "os": {
                    "default": "other",
                    "type": "string",
                    "enum": [
                      "ios",
                      "android",
                      "windows",
                      "macos",
                      "linux",
                      "other"
                    ]
                  },
                  "language": {
                    "default": "",
                    "type": "string",
                    "maxLength": 35
                  },
                  "visitor_type": {
                    "default": "human",
                    "type": "string",
                    "enum": [
                      "human",
                      "search_bot",
                      "social_preview",
                      "seo_crawler",
                      "ai_crawler",
                      "monitoring",
                      "security_scanner",
                      "library",
                      "headless",
                      "feed_reader",
                      "automated",
                      "datacenter",
                      "proxy",
                      "vpn",
                      "tor",
                      "unknown"
                    ]
                  },
                  "verified_bot": {
                    "default": false,
                    "type": "boolean"
                  },
                  "proxy_type": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "DCH",
                          "PUB",
                          "VPN",
                          "SES",
                          "TOR",
                          "WEB"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "quality_score": {
                    "default": 100,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "visit": {
                    "default": "first",
                    "type": "string",
                    "enum": [
                      "first",
                      "repeat"
                    ]
                  },
                  "at": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                  },
                  "visitor_hash": {
                    "default": "7f3a1c05deadbeef",
                    "type": "string",
                    "pattern": "^[0-9a-f]{8,64}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "rule_id": {
                          "type": "string"
                        },
                        "rule_label": {
                          "type": "string"
                        },
                        "rule_index": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "action": {
                          "type": "string"
                        },
                        "destination": {
                          "type": "string"
                        },
                        "status": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "ab_variant": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "rule_id",
                        "rule_label",
                        "rule_index",
                        "action",
                        "destination",
                        "status",
                        "ab_variant",
                        "source"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/links/{id}/qr": {
      "get": {
        "operationId": "getLinkQr",
        "summary": "Render the QR code of a link",
        "description": "Returns a styled QR code. The style comes from `preset`, the link preset or the workspace default preset.\n\nRequires a workspace key (`lp_live_…`). Required scope: `qr:read`.",
        "tags": [
          "Links"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Link id (lnk_…)"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "default": "png",
              "type": "string",
              "enum": [
                "png",
                "svg"
              ]
            }
          },
          {
            "name": "preset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "default": 1024,
              "type": "integer",
              "minimum": 64,
              "maximum": 4096
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PNG or SVG image of the QR code",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/analytics/summary": {
      "get": {
        "operationId": "getAnalyticsSummary",
        "summary": "Clicks summary",
        "description": "Totals for the requested period plus the previous period of the same length. Without dates the last 30 days are shown; the period is truncated by the plan retention.\n\nRequires a workspace key (`lp_live_…`). Required scope: `analytics:read`.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "current": {
                          "type": "object",
                          "properties": {
                            "clicks": {
                              "type": "number"
                            },
                            "visitors": {
                              "type": "number"
                            },
                            "links": {
                              "type": "number"
                            },
                            "qr_clicks": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "clicks",
                            "visitors",
                            "links",
                            "qr_clicks"
                          ],
                          "additionalProperties": false
                        },
                        "previous": {
                          "type": "object",
                          "properties": {
                            "clicks": {
                              "type": "number"
                            },
                            "visitors": {
                              "type": "number"
                            },
                            "links": {
                              "type": "number"
                            },
                            "qr_clicks": {
                              "type": "number"
                            }
                          },
                          "required": [
                            "clicks",
                            "visitors",
                            "links",
                            "qr_clicks"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "current",
                        "previous"
                      ],
                      "additionalProperties": false
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "retention_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "truncated",
                        "retention_days"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "period"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/analytics/timeseries": {
      "get": {
        "operationId": "getAnalyticsTimeseries",
        "summary": "Clicks over time",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `analytics:read`.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "granularity",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "bucket": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "number"
                          },
                          "visitors": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "bucket",
                          "clicks",
                          "visitors"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "granularity": {
                      "type": "string",
                      "enum": [
                        "hour",
                        "day",
                        "week",
                        "month"
                      ]
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "retention_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "truncated",
                        "retention_days"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "granularity",
                    "period"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/analytics/breakdown": {
      "get": {
        "operationId": "getAnalyticsBreakdown",
        "summary": "Breakdown by dimension",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `analytics:read`.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "dimension",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "country",
                "city",
                "device",
                "browser",
                "os",
                "referer",
                "utm_source",
                "utm_medium",
                "utm_campaign",
                "region",
                "network",
                "visitor_type",
                "proxy_type",
                "quality",
                "local_hour"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "number"
                          },
                          "visitors": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "value",
                          "clicks",
                          "visitors"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "dimension": {
                      "type": "string",
                      "enum": [
                        "country",
                        "city",
                        "device",
                        "browser",
                        "os",
                        "referer",
                        "utm_source",
                        "utm_medium",
                        "utm_campaign",
                        "region",
                        "network",
                        "visitor_type",
                        "proxy_type",
                        "quality",
                        "local_hour"
                      ]
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "retention_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "truncated",
                        "retention_days"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "dimension",
                    "period"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/analytics/links/top": {
      "get": {
        "operationId": "getTopLinks",
        "summary": "Top links",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `analytics:read`.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "link_id": {
                            "type": "string"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "short_url": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "number"
                          },
                          "visitors": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "link_id",
                          "domain",
                          "slug",
                          "short_url",
                          "clicks",
                          "visitors"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "retention_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "truncated",
                        "retention_days"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "period"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/analytics/export.csv": {
      "get": {
        "operationId": "exportAnalyticsCsv",
        "summary": "Export click events as CSV",
        "description": "Streams up to 100,000 click events for the period.\n\nRequires a workspace key (`lp_live_…`). Required scope: `analytics:read`.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
                },
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              ]
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV stream of click events",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/domains": {
      "get": {
        "operationId": "listDomains",
        "summary": "List domains available to the workspace",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `domains:read`.",
        "tags": [
          "Domains"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "hostname": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string",
                            "enum": [
                              "redirect",
                              "dashboard"
                            ]
                          },
                          "connection": {
                            "type": "string",
                            "enum": [
                              "cname",
                              "ip"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending_dns",
                              "pending_ssl",
                              "active",
                              "error",
                              "disabled"
                            ]
                          },
                          "shared": {
                            "type": "boolean"
                          },
                          "workspace_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "hostname",
                          "purpose",
                          "connection",
                          "status",
                          "shared",
                          "workspace_id",
                          "error",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createDomain",
        "summary": "Connect a custom domain",
        "description": "Available when the workspace plan allows custom domains.\n\nRequires a workspace key (`lp_live_…`). Required scope: `domains:write`.",
        "tags": [
          "Domains"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 255
                  },
                  "connection": {
                    "type": "string",
                    "enum": [
                      "cname",
                      "ip"
                    ]
                  }
                },
                "required": [
                  "hostname"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "hostname": {
                          "type": "string"
                        },
                        "purpose": {
                          "type": "string",
                          "enum": [
                            "redirect",
                            "dashboard"
                          ]
                        },
                        "connection": {
                          "type": "string",
                          "enum": [
                            "cname",
                            "ip"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending_dns",
                            "pending_ssl",
                            "active",
                            "error",
                            "disabled"
                          ]
                        },
                        "shared": {
                          "type": "boolean"
                        },
                        "workspace_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "error": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "dns_records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "TXT",
                                  "CNAME",
                                  "A",
                                  "AAAA"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "purpose": {
                                "type": "string"
                              },
                              "required": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "type",
                              "name",
                              "value",
                              "purpose",
                              "required"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "hostname",
                        "purpose",
                        "connection",
                        "status",
                        "shared",
                        "workspace_id",
                        "error",
                        "created_at",
                        "dns_records"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/domains/{id}": {
      "get": {
        "operationId": "getDomain",
        "summary": "Domain status and required DNS records",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `domains:read`.",
        "tags": [
          "Domains"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Domain id (dom_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "hostname": {
                          "type": "string"
                        },
                        "purpose": {
                          "type": "string",
                          "enum": [
                            "redirect",
                            "dashboard"
                          ]
                        },
                        "connection": {
                          "type": "string",
                          "enum": [
                            "cname",
                            "ip"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending_dns",
                            "pending_ssl",
                            "active",
                            "error",
                            "disabled"
                          ]
                        },
                        "shared": {
                          "type": "boolean"
                        },
                        "workspace_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "error": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "dns_records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "TXT",
                                  "CNAME",
                                  "A",
                                  "AAAA"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              },
                              "purpose": {
                                "type": "string"
                              },
                              "required": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "type",
                              "name",
                              "value",
                              "purpose",
                              "required"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "id",
                        "hostname",
                        "purpose",
                        "connection",
                        "status",
                        "shared",
                        "workspace_id",
                        "error",
                        "created_at",
                        "dns_records"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDomain",
        "summary": "Disconnect a domain",
        "description": "The record stays in the `disabled` state and holds the hostname for a day before it can be claimed by another tenant.\n\nRequires a workspace key (`lp_live_…`). Required scope: `domains:write`.",
        "tags": [
          "Domains"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Domain id (dom_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "const": "disabled"
                        }
                      },
                      "required": [
                        "id",
                        "status"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/workspace": {
      "get": {
        "operationId": "getWorkspace",
        "summary": "Current workspace, limits and usage",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `workspace:read`.",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "trial",
                            "active",
                            "past_due",
                            "suspended",
                            "closed"
                          ]
                        },
                        "trial_ends_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "plan": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "limits": {
                                  "type": "object",
                                  "properties": {
                                    "max_links": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "tracked_clicks_month": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_domains": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_seats": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "api_access": {
                                      "type": "boolean"
                                    },
                                    "custom_qr": {
                                      "type": "boolean"
                                    },
                                    "targeting": {
                                      "type": "boolean"
                                    },
                                    "ab_tests": {
                                      "type": "boolean"
                                    },
                                    "password_links": {
                                      "type": "boolean"
                                    },
                                    "utm_templates": {
                                      "type": "boolean"
                                    },
                                    "public_stats": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "bio_pages": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "max_bio_pages": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_storage_mb": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "rotator": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "mobile_deeplinks": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "traffic_rules": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "conversions": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "geo_analytics": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "realtime": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "assistant_tools": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "email_reports": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "pdf_reports": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "max_traffic_rules": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_destinations": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_conversions_month": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "click_packs": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "data_retention_days": {
                                      "type": "integer",
                                      "exclusiveMinimum": 0,
                                      "maximum": 730
                                    }
                                  },
                                  "required": [
                                    "max_links",
                                    "tracked_clicks_month",
                                    "max_domains",
                                    "max_seats",
                                    "api_access",
                                    "custom_qr",
                                    "targeting",
                                    "ab_tests",
                                    "password_links",
                                    "utm_templates",
                                    "public_stats",
                                    "bio_pages",
                                    "max_bio_pages",
                                    "max_storage_mb",
                                    "rotator",
                                    "mobile_deeplinks",
                                    "traffic_rules",
                                    "conversions",
                                    "geo_analytics",
                                    "realtime",
                                    "assistant_tools",
                                    "email_reports",
                                    "pdf_reports",
                                    "max_traffic_rules",
                                    "max_destinations",
                                    "max_conversions_month",
                                    "click_packs",
                                    "data_retention_days"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "limits"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "usage": {
                          "type": "object",
                          "properties": {
                            "links": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            },
                            "domains": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            },
                            "tracked_clicks_month": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "links",
                            "domains",
                            "tracked_clicks_month"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "status",
                        "trial_ends_at",
                        "created_at",
                        "plan",
                        "usage"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/events": {
      "get": {
        "operationId": "listEvents",
        "summary": "Workspace audit trail",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `workspace:read`.",
        "tags": [
          "Workspace"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string"
                          },
                          "target_type": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "target_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "actor": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "api_key"
                                ]
                              },
                              "id": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "type",
                              "id"
                            ],
                            "additionalProperties": false
                          },
                          "meta": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "action",
                          "target_type",
                          "target_id",
                          "actor",
                          "meta",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner": {
      "get": {
        "operationId": "getPartner",
        "summary": "Partner profile, plan and usage",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `partner:read`.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "trial",
                            "active",
                            "past_due",
                            "suspended",
                            "closed",
                            "grace"
                          ]
                        },
                        "connect_status": {
                          "type": "string",
                          "enum": [
                            "none",
                            "onboarding",
                            "active",
                            "restricted"
                          ]
                        },
                        "platform_fee_bps": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "plan": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "code": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                },
                                "limits": {
                                  "type": "object",
                                  "properties": {
                                    "max_redirect_domains": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_dashboard_domains": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_workspaces": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_team_seats": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "tracked_clicks_month": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "max_links": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 0,
                                          "maximum": 9007199254740991
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "api_access": {
                                      "type": "boolean"
                                    },
                                    "custom_dashboard_domain": {
                                      "type": "boolean"
                                    },
                                    "remove_branding": {
                                      "type": "boolean"
                                    },
                                    "custom_email_sender": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "status_page": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "affiliate_program": {
                                      "default": false,
                                      "type": "boolean"
                                    },
                                    "dedicated_ip": {
                                      "type": "boolean"
                                    },
                                    "priority_support": {
                                      "type": "boolean"
                                    }
                                  },
                                  "required": [
                                    "max_redirect_domains",
                                    "max_dashboard_domains",
                                    "max_workspaces",
                                    "max_team_seats",
                                    "tracked_clicks_month",
                                    "max_links",
                                    "api_access",
                                    "custom_dashboard_domain",
                                    "remove_branding",
                                    "custom_email_sender",
                                    "status_page",
                                    "affiliate_program",
                                    "dedicated_ip",
                                    "priority_support"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "required": [
                                "id",
                                "code",
                                "name",
                                "limits"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "usage": {
                          "type": "object",
                          "properties": {
                            "clients": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            },
                            "redirect_domains": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            },
                            "dashboard_domains": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            },
                            "links": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            },
                            "tracked_clicks_month": {
                              "type": "object",
                              "properties": {
                                "used": {
                                  "type": "integer",
                                  "minimum": -9007199254740991,
                                  "maximum": 9007199254740991
                                },
                                "limit": {
                                  "anyOf": [
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "used",
                                "limit"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "clients",
                            "redirect_domains",
                            "dashboard_domains",
                            "links",
                            "tracked_clicks_month"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "status",
                        "connect_status",
                        "platform_fee_bps",
                        "created_at",
                        "plan",
                        "usage"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/clients": {
      "get": {
        "operationId": "listClients",
        "summary": "List clients with subscriptions",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `clients:read`.",
        "tags": [
          "Partner clients"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "trial",
                "active",
                "past_due",
                "suspended",
                "closed"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "trial",
                              "active",
                              "past_due",
                              "suspended",
                              "closed"
                            ]
                          },
                          "plan_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "trial_ends_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "subscription": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "trialing",
                                      "active",
                                      "past_due",
                                      "canceled",
                                      "unpaid",
                                      "incomplete",
                                      "incomplete_expired",
                                      "paused"
                                    ]
                                  },
                                  "interval": {
                                    "type": "string",
                                    "enum": [
                                      "month",
                                      "year"
                                    ]
                                  },
                                  "current_period_end": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "format": "date-time",
                                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "cancel_at_period_end": {
                                    "type": "boolean"
                                  }
                                },
                                "required": [
                                  "status",
                                  "interval",
                                  "current_period_end",
                                  "cancel_at_period_end"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "slug",
                          "status",
                          "plan_id",
                          "trial_ends_at",
                          "created_at",
                          "subscription"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createClient",
        "summary": "Create a client",
        "description": "Creates a workspace on the given plan (or the default trial plan) and emails an owner invitation to `email`.\n\nRequires a partner key (`lpp_live_…`). Required scope: `clients:write`.",
        "tags": [
          "Partner clients"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 320,
                    "format": "email",
                    "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                  },
                  "plan_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "email"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "trial",
                            "active",
                            "past_due",
                            "suspended",
                            "closed"
                          ]
                        },
                        "plan_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "trial_ends_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "subscription": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "trialing",
                                    "active",
                                    "past_due",
                                    "canceled",
                                    "unpaid",
                                    "incomplete",
                                    "incomplete_expired",
                                    "paused"
                                  ]
                                },
                                "interval": {
                                  "type": "string",
                                  "enum": [
                                    "month",
                                    "year"
                                  ]
                                },
                                "current_period_end": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "cancel_at_period_end": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "status",
                                "interval",
                                "current_period_end",
                                "cancel_at_period_end"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "status",
                        "plan_id",
                        "trial_ends_at",
                        "created_at",
                        "subscription"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/clients/{id}": {
      "get": {
        "operationId": "getClient",
        "summary": "Retrieve a client",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `clients:read`.",
        "tags": [
          "Partner clients"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id (ws_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "trial",
                            "active",
                            "past_due",
                            "suspended",
                            "closed"
                          ]
                        },
                        "plan_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "trial_ends_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "subscription": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "trialing",
                                    "active",
                                    "past_due",
                                    "canceled",
                                    "unpaid",
                                    "incomplete",
                                    "incomplete_expired",
                                    "paused"
                                  ]
                                },
                                "interval": {
                                  "type": "string",
                                  "enum": [
                                    "month",
                                    "year"
                                  ]
                                },
                                "current_period_end": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "cancel_at_period_end": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "status",
                                "interval",
                                "current_period_end",
                                "cancel_at_period_end"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "status",
                        "plan_id",
                        "trial_ends_at",
                        "created_at",
                        "subscription"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateClient",
        "summary": "Change plan, suspend or resume a client",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `clients:write`.",
        "tags": [
          "Partner clients"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id (ws_…)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "plan_id": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "suspended"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "trial",
                            "active",
                            "past_due",
                            "suspended",
                            "closed"
                          ]
                        },
                        "plan_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "trial_ends_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "subscription": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "status": {
                                  "type": "string",
                                  "enum": [
                                    "trialing",
                                    "active",
                                    "past_due",
                                    "canceled",
                                    "unpaid",
                                    "incomplete",
                                    "incomplete_expired",
                                    "paused"
                                  ]
                                },
                                "interval": {
                                  "type": "string",
                                  "enum": [
                                    "month",
                                    "year"
                                  ]
                                },
                                "current_period_end": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date-time",
                                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "cancel_at_period_end": {
                                  "type": "boolean"
                                }
                              },
                              "required": [
                                "status",
                                "interval",
                                "current_period_end",
                                "cancel_at_period_end"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "slug",
                        "status",
                        "plan_id",
                        "trial_ends_at",
                        "created_at",
                        "subscription"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/plans": {
      "get": {
        "operationId": "listPlans",
        "summary": "List partner plans",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `plans:read`.",
        "tags": [
          "Partner plans"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "monthly_price_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "yearly_price_cents": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "currency": {
                            "type": "string"
                          },
                          "trial_days": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "limits": {
                            "type": "object",
                            "properties": {
                              "max_links": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "tracked_clicks_month": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "max_domains": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "max_seats": {
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "api_access": {
                                "type": "boolean"
                              },
                              "custom_qr": {
                                "type": "boolean"
                              },
                              "targeting": {
                                "type": "boolean"
                              },
                              "ab_tests": {
                                "type": "boolean"
                              },
                              "password_links": {
                                "type": "boolean"
                              },
                              "utm_templates": {
                                "type": "boolean"
                              },
                              "public_stats": {
                                "default": false,
                                "type": "boolean"
                              },
                              "bio_pages": {
                                "default": false,
                                "type": "boolean"
                              },
                              "max_bio_pages": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "max_storage_mb": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "rotator": {
                                "default": false,
                                "type": "boolean"
                              },
                              "mobile_deeplinks": {
                                "default": false,
                                "type": "boolean"
                              },
                              "traffic_rules": {
                                "default": false,
                                "type": "boolean"
                              },
                              "conversions": {
                                "default": false,
                                "type": "boolean"
                              },
                              "geo_analytics": {
                                "default": false,
                                "type": "boolean"
                              },
                              "realtime": {
                                "default": false,
                                "type": "boolean"
                              },
                              "assistant_tools": {
                                "default": false,
                                "type": "boolean"
                              },
                              "email_reports": {
                                "default": false,
                                "type": "boolean"
                              },
                              "pdf_reports": {
                                "default": false,
                                "type": "boolean"
                              },
                              "max_traffic_rules": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "max_destinations": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "max_conversions_month": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "click_packs": {
                                "default": false,
                                "type": "boolean"
                              },
                              "data_retention_days": {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 730
                              }
                            },
                            "required": [
                              "max_links",
                              "tracked_clicks_month",
                              "max_domains",
                              "max_seats",
                              "api_access",
                              "custom_qr",
                              "targeting",
                              "ab_tests",
                              "password_links",
                              "utm_templates",
                              "public_stats",
                              "bio_pages",
                              "max_bio_pages",
                              "max_storage_mb",
                              "rotator",
                              "mobile_deeplinks",
                              "traffic_rules",
                              "conversions",
                              "geo_analytics",
                              "realtime",
                              "assistant_tools",
                              "email_reports",
                              "pdf_reports",
                              "max_traffic_rules",
                              "max_destinations",
                              "max_conversions_month",
                              "click_packs",
                              "data_retention_days"
                            ],
                            "additionalProperties": false
                          },
                          "is_public": {
                            "type": "boolean"
                          },
                          "is_default_trial": {
                            "type": "boolean"
                          },
                          "archived_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "monthly_price_cents",
                          "yearly_price_cents",
                          "currency",
                          "trial_days",
                          "limits",
                          "is_public",
                          "is_default_trial",
                          "archived_at",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createPlan",
        "summary": "Create a plan",
        "description": "Publishing a paid plan requires active Connect payouts.\n\nRequires a partner key (`lpp_live_…`). Required scope: `plans:write`.",
        "tags": [
          "Partner plans"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "monthly_price_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000
                  },
                  "yearly_price_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 100000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "trial_days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 90
                  },
                  "limits": {
                    "type": "object",
                    "properties": {
                      "max_links": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tracked_clicks_month": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_domains": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_seats": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "api_access": {
                        "type": "boolean"
                      },
                      "custom_qr": {
                        "type": "boolean"
                      },
                      "targeting": {
                        "type": "boolean"
                      },
                      "ab_tests": {
                        "type": "boolean"
                      },
                      "password_links": {
                        "type": "boolean"
                      },
                      "utm_templates": {
                        "type": "boolean"
                      },
                      "public_stats": {
                        "default": false,
                        "type": "boolean"
                      },
                      "bio_pages": {
                        "default": false,
                        "type": "boolean"
                      },
                      "max_bio_pages": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_storage_mb": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "rotator": {
                        "default": false,
                        "type": "boolean"
                      },
                      "mobile_deeplinks": {
                        "default": false,
                        "type": "boolean"
                      },
                      "traffic_rules": {
                        "default": false,
                        "type": "boolean"
                      },
                      "conversions": {
                        "default": false,
                        "type": "boolean"
                      },
                      "geo_analytics": {
                        "default": false,
                        "type": "boolean"
                      },
                      "realtime": {
                        "default": false,
                        "type": "boolean"
                      },
                      "assistant_tools": {
                        "default": false,
                        "type": "boolean"
                      },
                      "email_reports": {
                        "default": false,
                        "type": "boolean"
                      },
                      "pdf_reports": {
                        "default": false,
                        "type": "boolean"
                      },
                      "max_traffic_rules": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_destinations": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_conversions_month": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "click_packs": {
                        "default": false,
                        "type": "boolean"
                      },
                      "data_retention_days": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 730
                      }
                    },
                    "required": [
                      "max_links",
                      "tracked_clicks_month",
                      "max_domains",
                      "max_seats",
                      "api_access",
                      "custom_qr",
                      "targeting",
                      "ab_tests",
                      "password_links",
                      "utm_templates",
                      "data_retention_days"
                    ]
                  },
                  "is_public": {
                    "type": "boolean"
                  },
                  "is_default_trial": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "monthly_price_cents",
                  "limits"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "monthly_price_cents": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "yearly_price_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "currency": {
                          "type": "string"
                        },
                        "trial_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limits": {
                          "type": "object",
                          "properties": {
                            "max_links": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "tracked_clicks_month": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_domains": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_seats": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "api_access": {
                              "type": "boolean"
                            },
                            "custom_qr": {
                              "type": "boolean"
                            },
                            "targeting": {
                              "type": "boolean"
                            },
                            "ab_tests": {
                              "type": "boolean"
                            },
                            "password_links": {
                              "type": "boolean"
                            },
                            "utm_templates": {
                              "type": "boolean"
                            },
                            "public_stats": {
                              "default": false,
                              "type": "boolean"
                            },
                            "bio_pages": {
                              "default": false,
                              "type": "boolean"
                            },
                            "max_bio_pages": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_storage_mb": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rotator": {
                              "default": false,
                              "type": "boolean"
                            },
                            "mobile_deeplinks": {
                              "default": false,
                              "type": "boolean"
                            },
                            "traffic_rules": {
                              "default": false,
                              "type": "boolean"
                            },
                            "conversions": {
                              "default": false,
                              "type": "boolean"
                            },
                            "geo_analytics": {
                              "default": false,
                              "type": "boolean"
                            },
                            "realtime": {
                              "default": false,
                              "type": "boolean"
                            },
                            "assistant_tools": {
                              "default": false,
                              "type": "boolean"
                            },
                            "email_reports": {
                              "default": false,
                              "type": "boolean"
                            },
                            "pdf_reports": {
                              "default": false,
                              "type": "boolean"
                            },
                            "max_traffic_rules": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_destinations": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_conversions_month": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "click_packs": {
                              "default": false,
                              "type": "boolean"
                            },
                            "data_retention_days": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 730
                            }
                          },
                          "required": [
                            "max_links",
                            "tracked_clicks_month",
                            "max_domains",
                            "max_seats",
                            "api_access",
                            "custom_qr",
                            "targeting",
                            "ab_tests",
                            "password_links",
                            "utm_templates",
                            "public_stats",
                            "bio_pages",
                            "max_bio_pages",
                            "max_storage_mb",
                            "rotator",
                            "mobile_deeplinks",
                            "traffic_rules",
                            "conversions",
                            "geo_analytics",
                            "realtime",
                            "assistant_tools",
                            "email_reports",
                            "pdf_reports",
                            "max_traffic_rules",
                            "max_destinations",
                            "max_conversions_month",
                            "click_packs",
                            "data_retention_days"
                          ],
                          "additionalProperties": false
                        },
                        "is_public": {
                          "type": "boolean"
                        },
                        "is_default_trial": {
                          "type": "boolean"
                        },
                        "archived_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "description",
                        "monthly_price_cents",
                        "yearly_price_cents",
                        "currency",
                        "trial_days",
                        "limits",
                        "is_public",
                        "is_default_trial",
                        "archived_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/plans/{id}": {
      "patch": {
        "operationId": "updatePlan",
        "summary": "Update a plan",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `plans:write`.",
        "tags": [
          "Partner plans"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Plan id (prc_…)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "monthly_price_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000000
                  },
                  "yearly_price_cents": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 100000000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "trial_days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 90
                  },
                  "limits": {
                    "type": "object",
                    "properties": {
                      "max_links": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tracked_clicks_month": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_domains": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_seats": {
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "api_access": {
                        "type": "boolean"
                      },
                      "custom_qr": {
                        "type": "boolean"
                      },
                      "targeting": {
                        "type": "boolean"
                      },
                      "ab_tests": {
                        "type": "boolean"
                      },
                      "password_links": {
                        "type": "boolean"
                      },
                      "utm_templates": {
                        "type": "boolean"
                      },
                      "public_stats": {
                        "default": false,
                        "type": "boolean"
                      },
                      "bio_pages": {
                        "default": false,
                        "type": "boolean"
                      },
                      "max_bio_pages": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_storage_mb": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "rotator": {
                        "default": false,
                        "type": "boolean"
                      },
                      "mobile_deeplinks": {
                        "default": false,
                        "type": "boolean"
                      },
                      "traffic_rules": {
                        "default": false,
                        "type": "boolean"
                      },
                      "conversions": {
                        "default": false,
                        "type": "boolean"
                      },
                      "geo_analytics": {
                        "default": false,
                        "type": "boolean"
                      },
                      "realtime": {
                        "default": false,
                        "type": "boolean"
                      },
                      "assistant_tools": {
                        "default": false,
                        "type": "boolean"
                      },
                      "email_reports": {
                        "default": false,
                        "type": "boolean"
                      },
                      "pdf_reports": {
                        "default": false,
                        "type": "boolean"
                      },
                      "max_traffic_rules": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_destinations": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "max_conversions_month": {
                        "default": null,
                        "anyOf": [
                          {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "click_packs": {
                        "default": false,
                        "type": "boolean"
                      },
                      "data_retention_days": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 730
                      }
                    },
                    "required": [
                      "max_links",
                      "tracked_clicks_month",
                      "max_domains",
                      "max_seats",
                      "api_access",
                      "custom_qr",
                      "targeting",
                      "ab_tests",
                      "password_links",
                      "utm_templates",
                      "data_retention_days"
                    ]
                  },
                  "is_public": {
                    "type": "boolean"
                  },
                  "is_default_trial": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "monthly_price_cents",
                  "limits"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "monthly_price_cents": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "yearly_price_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "currency": {
                          "type": "string"
                        },
                        "trial_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limits": {
                          "type": "object",
                          "properties": {
                            "max_links": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "tracked_clicks_month": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_domains": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_seats": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "api_access": {
                              "type": "boolean"
                            },
                            "custom_qr": {
                              "type": "boolean"
                            },
                            "targeting": {
                              "type": "boolean"
                            },
                            "ab_tests": {
                              "type": "boolean"
                            },
                            "password_links": {
                              "type": "boolean"
                            },
                            "utm_templates": {
                              "type": "boolean"
                            },
                            "public_stats": {
                              "default": false,
                              "type": "boolean"
                            },
                            "bio_pages": {
                              "default": false,
                              "type": "boolean"
                            },
                            "max_bio_pages": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_storage_mb": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rotator": {
                              "default": false,
                              "type": "boolean"
                            },
                            "mobile_deeplinks": {
                              "default": false,
                              "type": "boolean"
                            },
                            "traffic_rules": {
                              "default": false,
                              "type": "boolean"
                            },
                            "conversions": {
                              "default": false,
                              "type": "boolean"
                            },
                            "geo_analytics": {
                              "default": false,
                              "type": "boolean"
                            },
                            "realtime": {
                              "default": false,
                              "type": "boolean"
                            },
                            "assistant_tools": {
                              "default": false,
                              "type": "boolean"
                            },
                            "email_reports": {
                              "default": false,
                              "type": "boolean"
                            },
                            "pdf_reports": {
                              "default": false,
                              "type": "boolean"
                            },
                            "max_traffic_rules": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_destinations": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_conversions_month": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "click_packs": {
                              "default": false,
                              "type": "boolean"
                            },
                            "data_retention_days": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 730
                            }
                          },
                          "required": [
                            "max_links",
                            "tracked_clicks_month",
                            "max_domains",
                            "max_seats",
                            "api_access",
                            "custom_qr",
                            "targeting",
                            "ab_tests",
                            "password_links",
                            "utm_templates",
                            "public_stats",
                            "bio_pages",
                            "max_bio_pages",
                            "max_storage_mb",
                            "rotator",
                            "mobile_deeplinks",
                            "traffic_rules",
                            "conversions",
                            "geo_analytics",
                            "realtime",
                            "assistant_tools",
                            "email_reports",
                            "pdf_reports",
                            "max_traffic_rules",
                            "max_destinations",
                            "max_conversions_month",
                            "click_packs",
                            "data_retention_days"
                          ],
                          "additionalProperties": false
                        },
                        "is_public": {
                          "type": "boolean"
                        },
                        "is_default_trial": {
                          "type": "boolean"
                        },
                        "archived_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "description",
                        "monthly_price_cents",
                        "yearly_price_cents",
                        "currency",
                        "trial_days",
                        "limits",
                        "is_public",
                        "is_default_trial",
                        "archived_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "archivePlan",
        "summary": "Archive a plan",
        "description": "Existing subscriptions keep working; the plan is hidden from new clients.\n\nRequires a partner key (`lpp_live_…`). Required scope: `plans:write`.",
        "tags": [
          "Partner plans"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Plan id (prc_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "monthly_price_cents": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "yearly_price_cents": {
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "currency": {
                          "type": "string"
                        },
                        "trial_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "limits": {
                          "type": "object",
                          "properties": {
                            "max_links": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "tracked_clicks_month": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_domains": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_seats": {
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "api_access": {
                              "type": "boolean"
                            },
                            "custom_qr": {
                              "type": "boolean"
                            },
                            "targeting": {
                              "type": "boolean"
                            },
                            "ab_tests": {
                              "type": "boolean"
                            },
                            "password_links": {
                              "type": "boolean"
                            },
                            "utm_templates": {
                              "type": "boolean"
                            },
                            "public_stats": {
                              "default": false,
                              "type": "boolean"
                            },
                            "bio_pages": {
                              "default": false,
                              "type": "boolean"
                            },
                            "max_bio_pages": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_storage_mb": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "rotator": {
                              "default": false,
                              "type": "boolean"
                            },
                            "mobile_deeplinks": {
                              "default": false,
                              "type": "boolean"
                            },
                            "traffic_rules": {
                              "default": false,
                              "type": "boolean"
                            },
                            "conversions": {
                              "default": false,
                              "type": "boolean"
                            },
                            "geo_analytics": {
                              "default": false,
                              "type": "boolean"
                            },
                            "realtime": {
                              "default": false,
                              "type": "boolean"
                            },
                            "assistant_tools": {
                              "default": false,
                              "type": "boolean"
                            },
                            "email_reports": {
                              "default": false,
                              "type": "boolean"
                            },
                            "pdf_reports": {
                              "default": false,
                              "type": "boolean"
                            },
                            "max_traffic_rules": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_destinations": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "max_conversions_month": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 9007199254740991
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "click_packs": {
                              "default": false,
                              "type": "boolean"
                            },
                            "data_retention_days": {
                              "type": "integer",
                              "exclusiveMinimum": 0,
                              "maximum": 730
                            }
                          },
                          "required": [
                            "max_links",
                            "tracked_clicks_month",
                            "max_domains",
                            "max_seats",
                            "api_access",
                            "custom_qr",
                            "targeting",
                            "ab_tests",
                            "password_links",
                            "utm_templates",
                            "public_stats",
                            "bio_pages",
                            "max_bio_pages",
                            "max_storage_mb",
                            "rotator",
                            "mobile_deeplinks",
                            "traffic_rules",
                            "conversions",
                            "geo_analytics",
                            "realtime",
                            "assistant_tools",
                            "email_reports",
                            "pdf_reports",
                            "max_traffic_rules",
                            "max_destinations",
                            "max_conversions_month",
                            "click_packs",
                            "data_retention_days"
                          ],
                          "additionalProperties": false
                        },
                        "is_public": {
                          "type": "boolean"
                        },
                        "is_default_trial": {
                          "type": "boolean"
                        },
                        "archived_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "description",
                        "monthly_price_cents",
                        "yearly_price_cents",
                        "currency",
                        "trial_days",
                        "limits",
                        "is_public",
                        "is_default_trial",
                        "archived_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/domains": {
      "get": {
        "operationId": "listPartnerDomains",
        "summary": "List all domains (partner and client owned)",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `domains:read`.",
        "tags": [
          "Partner domains"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "hostname": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string",
                            "enum": [
                              "redirect",
                              "dashboard"
                            ]
                          },
                          "connection": {
                            "type": "string",
                            "enum": [
                              "cname",
                              "ip"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending_dns",
                              "pending_ssl",
                              "active",
                              "error",
                              "disabled"
                            ]
                          },
                          "shared": {
                            "type": "boolean"
                          },
                          "workspace_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "error": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "hostname",
                          "purpose",
                          "connection",
                          "status",
                          "shared",
                          "workspace_id",
                          "error",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createPartnerDomain",
        "summary": "Connect a partner domain",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `domains:write`.",
        "tags": [
          "Partner domains"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 255
                  },
                  "connection": {
                    "type": "string",
                    "enum": [
                      "cname",
                      "ip"
                    ]
                  }
                },
                "required": [
                  "hostname"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "hostname": {
                          "type": "string"
                        },
                        "purpose": {
                          "type": "string",
                          "enum": [
                            "redirect",
                            "dashboard"
                          ]
                        },
                        "connection": {
                          "type": "string",
                          "enum": [
                            "cname",
                            "ip"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending_dns",
                            "pending_ssl",
                            "active",
                            "error",
                            "disabled"
                          ]
                        },
                        "shared": {
                          "type": "boolean"
                        },
                        "workspace_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "error": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "hostname",
                        "purpose",
                        "connection",
                        "status",
                        "shared",
                        "workspace_id",
                        "error",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/payments": {
      "get": {
        "operationId": "listPayments",
        "summary": "Client payments with fee breakdown",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `payments:read`.",
        "tags": [
          "Partner billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "365d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "workspace_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amount_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "application_fee_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "stripe_fee_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "partner_net_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "paid",
                              "refunded",
                              "partially_refunded",
                              "disputed"
                            ]
                          },
                          "refunded_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "paid_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "workspace_id",
                          "amount_cents",
                          "application_fee_cents",
                          "stripe_fee_cents",
                          "partner_net_cents",
                          "currency",
                          "status",
                          "refunded_cents",
                          "paid_at",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/payouts": {
      "get": {
        "operationId": "listPayouts",
        "summary": "Transfers to the partner account",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `payments:read`.",
        "tags": [
          "Partner billing"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "payment_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amount_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string"
                          },
                          "reversed": {
                            "type": "boolean"
                          },
                          "reversed_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "payment_id",
                          "amount_cents",
                          "currency",
                          "reversed",
                          "reversed_cents",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/partner/analytics/overview": {
      "get": {
        "operationId": "getPartnerAnalyticsOverview",
        "summary": "Clicks overview across all clients",
        "description": "Requires a partner key (`lpp_live_…`). Required scope: `analytics:read`.",
        "tags": [
          "Partner"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "365d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "workspace_id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "clicks": {
                            "type": "number"
                          },
                          "visitors": {
                            "type": "number"
                          },
                          "links": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "workspace_id",
                          "name",
                          "status",
                          "clicks",
                          "visitors",
                          "links"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "period": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "to": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "retention_days": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "from",
                        "to",
                        "truncated",
                        "retention_days"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "period"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "summary": "List webhook endpoints",
        "description": "Works with both key kinds; the key prefix selects the scope. Required scope: `webhooks:read`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "link.created",
                                "link.updated",
                                "link.deleted",
                                "link.destination_down",
                                "link.destination_recovered",
                                "domain.pending_ssl",
                                "domain.activated",
                                "domain.error",
                                "workspace.subscribed",
                                "workspace.past_due",
                                "workspace.suspended",
                                "workspace.limits_exceeded",
                                "payment.succeeded",
                                "payment.refunded",
                                "payment.disputed",
                                "payout.paid",
                                "payout.failed",
                                "click.threshold",
                                "bio.lead.created",
                                "conversion.created",
                                "alert.triggered",
                                "click_pack.activated"
                              ]
                            }
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled",
                              "failing"
                            ]
                          },
                          "failure_count": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "url",
                          "events",
                          "status",
                          "failure_count",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createWebhook",
        "summary": "Create a webhook endpoint",
        "description": "The signing secret is returned once. Workspace keys subscribe to link, domain and click events; partner keys additionally to workspace and payment events.\n\nWorks with both key kinds; the key prefix selects the scope. Required scope: `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  "events": {
                    "minItems": 1,
                    "maxItems": 22,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "link.created",
                        "link.updated",
                        "link.deleted",
                        "link.destination_down",
                        "link.destination_recovered",
                        "domain.pending_ssl",
                        "domain.activated",
                        "domain.error",
                        "workspace.subscribed",
                        "workspace.past_due",
                        "workspace.suspended",
                        "workspace.limits_exceeded",
                        "payment.succeeded",
                        "payment.refunded",
                        "payment.disputed",
                        "payout.paid",
                        "payout.failed",
                        "click.threshold",
                        "bio.lead.created",
                        "conversion.created",
                        "alert.triggered",
                        "click_pack.activated"
                      ]
                    }
                  }
                },
                "required": [
                  "url",
                  "events"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "link.created",
                              "link.updated",
                              "link.deleted",
                              "link.destination_down",
                              "link.destination_recovered",
                              "domain.pending_ssl",
                              "domain.activated",
                              "domain.error",
                              "workspace.subscribed",
                              "workspace.past_due",
                              "workspace.suspended",
                              "workspace.limits_exceeded",
                              "payment.succeeded",
                              "payment.refunded",
                              "payment.disputed",
                              "payout.paid",
                              "payout.failed",
                              "click.threshold",
                              "bio.lead.created",
                              "conversion.created",
                              "alert.triggered",
                              "click_pack.activated"
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "disabled",
                            "failing"
                          ]
                        },
                        "failure_count": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "secret": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "events",
                        "status",
                        "failure_count",
                        "created_at",
                        "secret"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "summary": "Retrieve a webhook",
        "description": "Works with both key kinds; the key prefix selects the scope. Required scope: `webhooks:read`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id (whk_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "link.created",
                              "link.updated",
                              "link.deleted",
                              "link.destination_down",
                              "link.destination_recovered",
                              "domain.pending_ssl",
                              "domain.activated",
                              "domain.error",
                              "workspace.subscribed",
                              "workspace.past_due",
                              "workspace.suspended",
                              "workspace.limits_exceeded",
                              "payment.succeeded",
                              "payment.refunded",
                              "payment.disputed",
                              "payout.paid",
                              "payout.failed",
                              "click.threshold",
                              "bio.lead.created",
                              "conversion.created",
                              "alert.triggered",
                              "click_pack.activated"
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "disabled",
                            "failing"
                          ]
                        },
                        "failure_count": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "events",
                        "status",
                        "failure_count",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Update a webhook",
        "description": "Setting `status` to `active` also re-enables a failing endpoint.\n\nWorks with both key kinds; the key prefix selects the scope. Required scope: `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id (whk_…)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  "events": {
                    "minItems": 1,
                    "maxItems": 22,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "link.created",
                        "link.updated",
                        "link.deleted",
                        "link.destination_down",
                        "link.destination_recovered",
                        "domain.pending_ssl",
                        "domain.activated",
                        "domain.error",
                        "workspace.subscribed",
                        "workspace.past_due",
                        "workspace.suspended",
                        "workspace.limits_exceeded",
                        "payment.succeeded",
                        "payment.refunded",
                        "payment.disputed",
                        "payout.paid",
                        "payout.failed",
                        "click.threshold",
                        "bio.lead.created",
                        "conversion.created",
                        "alert.triggered",
                        "click_pack.activated"
                      ]
                    }
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "disabled"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "link.created",
                              "link.updated",
                              "link.deleted",
                              "link.destination_down",
                              "link.destination_recovered",
                              "domain.pending_ssl",
                              "domain.activated",
                              "domain.error",
                              "workspace.subscribed",
                              "workspace.past_due",
                              "workspace.suspended",
                              "workspace.limits_exceeded",
                              "payment.succeeded",
                              "payment.refunded",
                              "payment.disputed",
                              "payout.paid",
                              "payout.failed",
                              "click.threshold",
                              "bio.lead.created",
                              "conversion.created",
                              "alert.triggered",
                              "click_pack.activated"
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "disabled",
                            "failing"
                          ]
                        },
                        "failure_count": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "url",
                        "events",
                        "status",
                        "failure_count",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Delete a webhook",
        "description": "Works with both key kinds; the key prefix selects the scope. Required scope: `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id (whk_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "deleted"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "summary": "Send a test event",
        "description": "Works with both key kinds; the key prefix selects the scope. Required scope: `webhooks:write`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id (whk_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "listWebhookDeliveries",
        "summary": "Delivery log",
        "description": "Works with both key kinds; the key prefix selects the scope. Required scope: `webhooks:read`.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Webhook id (whk_…)"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "event_type": {
                            "type": "string"
                          },
                          "payload": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          },
                          "response_status": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "attempt": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "delivered_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "next_retry_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "event_type",
                          "payload",
                          "response_status",
                          "attempt",
                          "delivered_at",
                          "next_retry_at",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/conversions": {
      "post": {
        "operationId": "createConversion",
        "summary": "Record a conversion",
        "description": "Attributes an order, signup or any custom goal to a click. `click_id` is the signed value the redirect appended to the destination URL (`lp_cid` by default): forged or tampered values are rejected, and conversions outside the workspace attribution window return `attribution_expired`. Repeated deliveries of the same `order_id` are deduplicated atomically — the stored conversion is returned with `duplicate: true`. Amounts are integer minor units (cents) only. Supports the `Idempotency-Key` header.\n\nRequires a workspace key (`lp_live_…`). Required scope: `conversions:write`.",
        "tags": [
          "Conversions"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "click_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "goal": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64
                  },
                  "order_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "amount_cents": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 2000000000
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "pattern": "^[A-Za-z]{3}$"
                  },
                  "metadata": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64
                    },
                    "additionalProperties": {
                      "type": "string",
                      "maxLength": 256
                    }
                  }
                },
                "required": [
                  "click_id",
                  "goal"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "goal": {
                          "type": "string"
                        },
                        "goal_type": {
                          "type": "string",
                          "enum": [
                            "purchase",
                            "signup",
                            "lead",
                            "custom"
                          ]
                        },
                        "link_id": {
                          "type": "string"
                        },
                        "click_id": {
                          "type": "string"
                        },
                        "order_id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "amount_cents": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "currency": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "api",
                            "browser"
                          ]
                        },
                        "country": {
                          "type": "string"
                        },
                        "device": {
                          "type": "string"
                        },
                        "traffic_source": {
                          "type": "string"
                        },
                        "ab_variant": {
                          "type": "string"
                        },
                        "is_suspect": {
                          "type": "boolean"
                        },
                        "clicked_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        },
                        "duplicate": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "goal",
                        "goal_type",
                        "link_id",
                        "click_id",
                        "order_id",
                        "amount_cents",
                        "currency",
                        "source",
                        "country",
                        "device",
                        "traffic_source",
                        "ab_variant",
                        "is_suspect",
                        "clicked_at",
                        "created_at",
                        "duplicate"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listConversions",
        "summary": "List conversions",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `conversions:read`.",
        "tags": [
          "Conversions"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "goal_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "goal": {
                            "type": "string"
                          },
                          "goal_type": {
                            "type": "string",
                            "enum": [
                              "purchase",
                              "signup",
                              "lead",
                              "custom"
                            ]
                          },
                          "link_id": {
                            "type": "string"
                          },
                          "click_id": {
                            "type": "string"
                          },
                          "order_id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "amount_cents": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "currency": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "api",
                              "browser"
                            ]
                          },
                          "country": {
                            "type": "string"
                          },
                          "device": {
                            "type": "string"
                          },
                          "traffic_source": {
                            "type": "string"
                          },
                          "ab_variant": {
                            "type": "string"
                          },
                          "is_suspect": {
                            "type": "boolean"
                          },
                          "clicked_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          },
                          "duplicate": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "goal",
                          "goal_type",
                          "link_id",
                          "click_id",
                          "order_id",
                          "amount_cents",
                          "currency",
                          "source",
                          "country",
                          "device",
                          "traffic_source",
                          "ab_variant",
                          "is_suspect",
                          "clicked_at",
                          "created_at",
                          "duplicate"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/alerts/rules": {
      "get": {
        "operationId": "listAlertRules",
        "summary": "List alert rules",
        "description": "Alert rules of the workspace: what is watched, through which channels the notification is delivered and how long repeats are suppressed.\n\nRequires a workspace key (`lp_live_…`). Required scope: `alerts:read`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "alert_rule"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "clicks_spike",
                              "clicks_drop",
                              "bot_share_spike",
                              "first_conversion",
                              "clicks_threshold",
                              "destination_down",
                              "quota_exhausted",
                              "quota_approaching"
                            ]
                          },
                          "config": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "clicks_spike"
                                  },
                                  "window_minutes": {
                                    "type": "integer",
                                    "minimum": 15,
                                    "maximum": 1440
                                  },
                                  "min_clicks": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "factor_percent": {
                                    "type": "integer",
                                    "minimum": 110,
                                    "maximum": 10000
                                  }
                                },
                                "required": [
                                  "type",
                                  "window_minutes",
                                  "min_clicks",
                                  "factor_percent"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "clicks_drop"
                                  },
                                  "window_minutes": {
                                    "type": "integer",
                                    "minimum": 15,
                                    "maximum": 1440
                                  },
                                  "min_previous_clicks": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "factor_percent": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "required": [
                                  "type",
                                  "window_minutes",
                                  "min_previous_clicks",
                                  "factor_percent"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "bot_share_spike"
                                  },
                                  "window_minutes": {
                                    "type": "integer",
                                    "minimum": 15,
                                    "maximum": 1440
                                  },
                                  "min_clicks": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000
                                  },
                                  "share_percent": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  }
                                },
                                "required": [
                                  "type",
                                  "window_minutes",
                                  "min_clicks",
                                  "share_percent"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "first_conversion"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "clicks_threshold"
                                  },
                                  "threshold": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 1000000000
                                  }
                                },
                                "required": [
                                  "type",
                                  "threshold"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "destination_down"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "quota_exhausted"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "quota_approaching"
                                  },
                                  "percent": {
                                    "type": "integer",
                                    "minimum": 50,
                                    "maximum": 99
                                  }
                                },
                                "required": [
                                  "type",
                                  "percent"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "channels": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "email",
                                "webhook",
                                "telegram",
                                "slack"
                              ]
                            }
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled"
                            ]
                          },
                          "suppress_minutes": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "last_notified_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "type",
                          "config",
                          "channels",
                          "status",
                          "suppress_minutes",
                          "last_notified_at",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAlertRule",
        "summary": "Create an alert rule",
        "description": "The shape of `config` is fixed by `type`: a threshold rule cannot be created with spike settings. The `webhook` channel is delivered as the `alert.triggered` webhook event, other channels through the notification queue. Supports the `Idempotency-Key` header.\n\nRequires a workspace key (`lp_live_…`). Required scope: `alerts:write`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "clicks_spike",
                      "clicks_drop",
                      "bot_share_spike",
                      "first_conversion",
                      "clicks_threshold",
                      "destination_down",
                      "quota_exhausted",
                      "quota_approaching"
                    ]
                  },
                  "config": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "clicks_spike"
                          },
                          "window_minutes": {
                            "type": "integer",
                            "minimum": 15,
                            "maximum": 1440
                          },
                          "min_clicks": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000
                          },
                          "factor_percent": {
                            "type": "integer",
                            "minimum": 110,
                            "maximum": 10000
                          }
                        },
                        "required": [
                          "type",
                          "window_minutes",
                          "min_clicks",
                          "factor_percent"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "clicks_drop"
                          },
                          "window_minutes": {
                            "type": "integer",
                            "minimum": 15,
                            "maximum": 1440
                          },
                          "min_previous_clicks": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000
                          },
                          "factor_percent": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 90
                          }
                        },
                        "required": [
                          "type",
                          "window_minutes",
                          "min_previous_clicks",
                          "factor_percent"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "bot_share_spike"
                          },
                          "window_minutes": {
                            "type": "integer",
                            "minimum": 15,
                            "maximum": 1440
                          },
                          "min_clicks": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000
                          },
                          "share_percent": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          }
                        },
                        "required": [
                          "type",
                          "window_minutes",
                          "min_clicks",
                          "share_percent"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "first_conversion"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "clicks_threshold"
                          },
                          "threshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000000
                          }
                        },
                        "required": [
                          "type",
                          "threshold"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "destination_down"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "quota_exhausted"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "quota_approaching"
                          },
                          "percent": {
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 99
                          }
                        },
                        "required": [
                          "type",
                          "percent"
                        ]
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "email",
                        "webhook",
                        "telegram",
                        "slack"
                      ]
                    }
                  },
                  "suppress_minutes": {
                    "default": 60,
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 10080
                  }
                },
                "required": [
                  "type",
                  "config",
                  "channels"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "object": {
                          "type": "string",
                          "const": "alert_rule"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "clicks_spike",
                            "clicks_drop",
                            "bot_share_spike",
                            "first_conversion",
                            "clicks_threshold",
                            "destination_down",
                            "quota_exhausted",
                            "quota_approaching"
                          ]
                        },
                        "config": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "clicks_spike"
                                },
                                "window_minutes": {
                                  "type": "integer",
                                  "minimum": 15,
                                  "maximum": 1440
                                },
                                "min_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "factor_percent": {
                                  "type": "integer",
                                  "minimum": 110,
                                  "maximum": 10000
                                }
                              },
                              "required": [
                                "type",
                                "window_minutes",
                                "min_clicks",
                                "factor_percent"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "clicks_drop"
                                },
                                "window_minutes": {
                                  "type": "integer",
                                  "minimum": 15,
                                  "maximum": 1440
                                },
                                "min_previous_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "factor_percent": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 90
                                }
                              },
                              "required": [
                                "type",
                                "window_minutes",
                                "min_previous_clicks",
                                "factor_percent"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "bot_share_spike"
                                },
                                "window_minutes": {
                                  "type": "integer",
                                  "minimum": 15,
                                  "maximum": 1440
                                },
                                "min_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "share_percent": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 100
                                }
                              },
                              "required": [
                                "type",
                                "window_minutes",
                                "min_clicks",
                                "share_percent"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "first_conversion"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "clicks_threshold"
                                },
                                "threshold": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000
                                }
                              },
                              "required": [
                                "type",
                                "threshold"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "destination_down"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "quota_exhausted"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "quota_approaching"
                                },
                                "percent": {
                                  "type": "integer",
                                  "minimum": 50,
                                  "maximum": 99
                                }
                              },
                              "required": [
                                "type",
                                "percent"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "email",
                              "webhook",
                              "telegram",
                              "slack"
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "disabled"
                          ]
                        },
                        "suppress_minutes": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "last_notified_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "object",
                        "type",
                        "config",
                        "channels",
                        "status",
                        "suppress_minutes",
                        "last_notified_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/alerts/rules/{id}": {
      "patch": {
        "operationId": "updateAlertRule",
        "summary": "Update an alert rule",
        "description": "The rule type is immutable — it defines the shape of the settings. Use `status` to mute a rule during planned maintenance.\n\nRequires a workspace key (`lp_live_…`). Required scope: `alerts:write`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "config": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "clicks_spike"
                          },
                          "window_minutes": {
                            "type": "integer",
                            "minimum": 15,
                            "maximum": 1440
                          },
                          "min_clicks": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000
                          },
                          "factor_percent": {
                            "type": "integer",
                            "minimum": 110,
                            "maximum": 10000
                          }
                        },
                        "required": [
                          "type",
                          "window_minutes",
                          "min_clicks",
                          "factor_percent"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "clicks_drop"
                          },
                          "window_minutes": {
                            "type": "integer",
                            "minimum": 15,
                            "maximum": 1440
                          },
                          "min_previous_clicks": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000
                          },
                          "factor_percent": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 90
                          }
                        },
                        "required": [
                          "type",
                          "window_minutes",
                          "min_previous_clicks",
                          "factor_percent"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "bot_share_spike"
                          },
                          "window_minutes": {
                            "type": "integer",
                            "minimum": 15,
                            "maximum": 1440
                          },
                          "min_clicks": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000
                          },
                          "share_percent": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          }
                        },
                        "required": [
                          "type",
                          "window_minutes",
                          "min_clicks",
                          "share_percent"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "first_conversion"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "clicks_threshold"
                          },
                          "threshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 1000000000
                          }
                        },
                        "required": [
                          "type",
                          "threshold"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "destination_down"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "quota_exhausted"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "quota_approaching"
                          },
                          "percent": {
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 99
                          }
                        },
                        "required": [
                          "type",
                          "percent"
                        ]
                      }
                    ]
                  },
                  "channels": {
                    "minItems": 1,
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "email",
                        "webhook",
                        "telegram",
                        "slack"
                      ]
                    }
                  },
                  "suppress_minutes": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 10080
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "active",
                      "disabled"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "object": {
                          "type": "string",
                          "const": "alert_rule"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "clicks_spike",
                            "clicks_drop",
                            "bot_share_spike",
                            "first_conversion",
                            "clicks_threshold",
                            "destination_down",
                            "quota_exhausted",
                            "quota_approaching"
                          ]
                        },
                        "config": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "clicks_spike"
                                },
                                "window_minutes": {
                                  "type": "integer",
                                  "minimum": 15,
                                  "maximum": 1440
                                },
                                "min_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "factor_percent": {
                                  "type": "integer",
                                  "minimum": 110,
                                  "maximum": 10000
                                }
                              },
                              "required": [
                                "type",
                                "window_minutes",
                                "min_clicks",
                                "factor_percent"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "clicks_drop"
                                },
                                "window_minutes": {
                                  "type": "integer",
                                  "minimum": 15,
                                  "maximum": 1440
                                },
                                "min_previous_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "factor_percent": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 90
                                }
                              },
                              "required": [
                                "type",
                                "window_minutes",
                                "min_previous_clicks",
                                "factor_percent"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "bot_share_spike"
                                },
                                "window_minutes": {
                                  "type": "integer",
                                  "minimum": 15,
                                  "maximum": 1440
                                },
                                "min_clicks": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000
                                },
                                "share_percent": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 100
                                }
                              },
                              "required": [
                                "type",
                                "window_minutes",
                                "min_clicks",
                                "share_percent"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "first_conversion"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "clicks_threshold"
                                },
                                "threshold": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 1000000000
                                }
                              },
                              "required": [
                                "type",
                                "threshold"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "destination_down"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "quota_exhausted"
                                }
                              },
                              "required": [
                                "type"
                              ],
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "properties": {
                                "type": {
                                  "type": "string",
                                  "const": "quota_approaching"
                                },
                                "percent": {
                                  "type": "integer",
                                  "minimum": 50,
                                  "maximum": 99
                                }
                              },
                              "required": [
                                "type",
                                "percent"
                              ],
                              "additionalProperties": false
                            }
                          ]
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "email",
                              "webhook",
                              "telegram",
                              "slack"
                            ]
                          }
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "disabled"
                          ]
                        },
                        "suppress_minutes": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "last_notified_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "object",
                        "type",
                        "config",
                        "channels",
                        "status",
                        "suppress_minutes",
                        "last_notified_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAlertRule",
        "summary": "Delete an alert rule",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `alerts:write`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "id"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "object": {
                          "type": "string",
                          "const": "alert_rule"
                        }
                      },
                      "required": [
                        "id",
                        "object"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/alerts/events": {
      "get": {
        "operationId": "listAlertEvents",
        "summary": "List alert events",
        "description": "History of rule firings, newest first. `dedup_key` identifies the event: repeated processing of the same event never produces a second row. `suppressed: true` means the event was recorded but not delivered because the suppression window had not elapsed.\n\nRequires a workspace key (`lp_live_…`). Required scope: `alerts:read`.",
        "tags": [
          "Alerts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "rule_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "alert_event"
                          },
                          "rule_id": {
                            "type": "string"
                          },
                          "rule_type": {
                            "type": "string",
                            "enum": [
                              "clicks_spike",
                              "clicks_drop",
                              "bot_share_spike",
                              "first_conversion",
                              "clicks_threshold",
                              "destination_down",
                              "quota_exhausted",
                              "quota_approaching"
                            ]
                          },
                          "dedup_key": {
                            "type": "string"
                          },
                          "values": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {
                              "anyOf": [
                                {
                                  "type": "number"
                                },
                                {
                                  "type": "string"
                                }
                              ]
                            }
                          },
                          "suppressed": {
                            "type": "boolean"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "rule_id",
                          "rule_type",
                          "dedup_key",
                          "values",
                          "suppressed",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/reports": {
      "get": {
        "operationId": "listReports",
        "summary": "List abuse reports about links of the workspace",
        "description": "The moderation queue of the workspace: what visitors reported about its links and how far the review got. Reports themselves are created only by the report form of the redirector, never through the API — a tenant key able to file reports would let anyone inflate a neighbour queue. The email of the reporter is never returned.\n\nRequires a workspace key (`lp_live_…`). Required scope: `reports:read`.",
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "reviewing",
                "upheld",
                "dismissed"
              ]
            }
          },
          {
            "name": "link_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "object": {
                            "type": "string",
                            "const": "abuse_report"
                          },
                          "link": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "short_url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "domain": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              },
                              "trust_status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "trusted",
                                  "flagged",
                                  "blocked"
                                ]
                              }
                            },
                            "required": [
                              "id",
                              "short_url",
                              "domain",
                              "slug",
                              "url",
                              "trust_status"
                            ],
                            "additionalProperties": false
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "phishing",
                              "malware",
                              "spam",
                              "adult",
                              "copyright",
                              "automation",
                              "other"
                            ]
                          },
                          "source": {
                            "type": "string",
                            "enum": [
                              "visitor",
                              "system",
                              "operator"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "open",
                              "reviewing",
                              "upheld",
                              "dismissed"
                            ]
                          },
                          "details": {
                            "type": "string"
                          },
                          "resolution": {
                            "type": "string"
                          },
                          "resolved_at": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time",
                                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                          }
                        },
                        "required": [
                          "id",
                          "object",
                          "link",
                          "reason",
                          "source",
                          "status",
                          "details",
                          "resolution",
                          "resolved_at",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "pagination": {
                      "type": "object",
                      "properties": {
                        "next_cursor": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "next_cursor",
                        "has_more"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/reports/{id}": {
      "get": {
        "operationId": "getReport",
        "summary": "Retrieve an abuse report",
        "description": "Requires a workspace key (`lp_live_…`). Required scope: `reports:read`.",
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Report id (abr_…)"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "object": {
                          "type": "string",
                          "const": "abuse_report"
                        },
                        "link": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "short_url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "domain": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "trust_status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "trusted",
                                "flagged",
                                "blocked"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "short_url",
                            "domain",
                            "slug",
                            "url",
                            "trust_status"
                          ],
                          "additionalProperties": false
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "phishing",
                            "malware",
                            "spam",
                            "adult",
                            "copyright",
                            "automation",
                            "other"
                          ]
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "visitor",
                            "system",
                            "operator"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "reviewing",
                            "upheld",
                            "dismissed"
                          ]
                        },
                        "details": {
                          "type": "string"
                        },
                        "resolution": {
                          "type": "string"
                        },
                        "resolved_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "object",
                        "link",
                        "reason",
                        "source",
                        "status",
                        "details",
                        "resolution",
                        "resolved_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateReport",
        "summary": "Move an abuse report through the review",
        "description": "Take the report into review (`reviewing`) or agree with it (`upheld` — the link is blocked immediately and dropped from the redirector cache). `dismissed` is refused: rejecting a complaint about your own link is the decision of the partner, who sees the whole client queue. Decided reports are final — a second decision returns `conflict`.\n\nRequires a workspace key (`lp_live_…`). Required scope: `reports:write`.",
        "tags": [
          "Reports"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Report id (abr_…)"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "reviewing",
                      "upheld",
                      "dismissed"
                    ]
                  },
                  "resolution": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "object": {
                          "type": "string",
                          "const": "abuse_report"
                        },
                        "link": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "short_url": {
                              "type": "string",
                              "format": "uri"
                            },
                            "domain": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            },
                            "url": {
                              "type": "string"
                            },
                            "trust_status": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "trusted",
                                "flagged",
                                "blocked"
                              ]
                            }
                          },
                          "required": [
                            "id",
                            "short_url",
                            "domain",
                            "slug",
                            "url",
                            "trust_status"
                          ],
                          "additionalProperties": false
                        },
                        "reason": {
                          "type": "string",
                          "enum": [
                            "phishing",
                            "malware",
                            "spam",
                            "adult",
                            "copyright",
                            "automation",
                            "other"
                          ]
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "visitor",
                            "system",
                            "operator"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "open",
                            "reviewing",
                            "upheld",
                            "dismissed"
                          ]
                        },
                        "details": {
                          "type": "string"
                        },
                        "resolution": {
                          "type": "string"
                        },
                        "resolved_at": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time",
                              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
                        }
                      },
                      "required": [
                        "id",
                        "object",
                        "link",
                        "reason",
                        "source",
                        "status",
                        "details",
                        "resolution",
                        "resolved_at",
                        "created_at"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Not found — foreign resources are indistinguishable from missing ones",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "List assistant tools",
        "description": "Catalog of tools an AI assistant can call, each with a JSON Schema of its arguments and the scopes it requires. The catalog itself needs no scope: it lists what could be done, not workspace data.\n\nRequires a workspace key (`lp_live_…`). Required scope: `—`.",
        "tags": [
          "Tools"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "enum": [
                              "list_links",
                              "get_link",
                              "create_link",
                              "update_link",
                              "analytics_summary",
                              "analytics_breakdown",
                              "analytics_top_links",
                              "analytics_timeseries",
                              "list_alert_rules",
                              "update_alert_rule"
                            ]
                          },
                          "description": {
                            "type": "string"
                          },
                          "scopes": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "mutates": {
                            "type": "boolean"
                          },
                          "input_schema": {
                            "type": "object",
                            "propertyNames": {
                              "type": "string"
                            },
                            "additionalProperties": {}
                          }
                        },
                        "required": [
                          "name",
                          "description",
                          "scopes",
                          "mutates",
                          "input_schema"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/tools/call": {
      "post": {
        "operationId": "callTool",
        "summary": "Call an assistant tool",
        "description": "Runs one tool with the rights of the API key: the scopes of the tool are checked against the scopes of the key, the plan gate and the rate limit are the same as for the rest of the API, and the workspace comes from the key. Tool arguments have no workspace field — reaching another tenant is not expressible.\n\nRequires a workspace key (`lp_live_…`). Required scope: `depends on the tool`.",
        "tags": [
          "Tools"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "enum": [
                      "list_links",
                      "get_link",
                      "create_link",
                      "update_link",
                      "analytics_summary",
                      "analytics_breakdown",
                      "analytics_top_links",
                      "analytics_timeseries",
                      "list_alert_rules",
                      "update_alert_rule"
                    ]
                  },
                  "arguments": {
                    "default": {},
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string",
                          "enum": [
                            "list_links",
                            "get_link",
                            "create_link",
                            "update_link",
                            "analytics_summary",
                            "analytics_breakdown",
                            "analytics_top_links",
                            "analytics_timeseries",
                            "list_alert_rules",
                            "update_alert_rule"
                          ]
                        },
                        "result": {}
                      },
                      "required": [
                        "name",
                        "result"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "data"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcpRpc",
        "summary": "Model Context Protocol endpoint",
        "description": "JSON-RPC 2.0 transport of the Model Context Protocol over the same tool catalog as /tools: initialize, ping, tools/list, tools/call and notifications, one request or a batch of up to 100. The assistant acts with the rights of the API key — scopes, plan gates and the rate limit are identical to REST, and every batched call spends its own rate-limit token. Protocol-level failures are JSON-RPC error objects; transport failures (401/403/429) are regular HTTP errors.\n\nRequires a workspace key (`lp_live_…`). Required scope: `depends on the tool`.",
        "tags": [
          "Tools"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "jsonrpc": {
                        "type": "string",
                        "const": "2.0"
                      },
                      "method": {
                        "type": "string"
                      },
                      "id": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "params": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      }
                    },
                    "required": [
                      "jsonrpc",
                      "method"
                    ]
                  },
                  {
                    "minItems": 1,
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "jsonrpc": {
                          "type": "string",
                          "const": "2.0"
                        },
                        "method": {
                          "type": "string"
                        },
                        "id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "params": {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "jsonrpc",
                        "method"
                      ]
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "jsonrpc": {
                          "type": "string",
                          "const": "2.0"
                        },
                        "id": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "result": {},
                        "error": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "number"
                            },
                            "message": {
                              "type": "string"
                            },
                            "data": {}
                          },
                          "required": [
                            "code",
                            "message"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "jsonrpc",
                        "id"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "jsonrpc": {
                            "type": "string",
                            "const": "2.0"
                          },
                          "id": {
                            "anyOf": [
                              {
                                "type": "string"
                              },
                              {
                                "type": "number"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "result": {},
                          "error": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "number"
                              },
                              "message": {
                                "type": "string"
                              },
                              "data": {}
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "jsonrpc",
                          "id"
                        ],
                        "additionalProperties": false
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid, revoked or expired API key",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Wrong key kind, missing scope or plan restriction",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "422": {
            "description": "Validation failed",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded; see Retry-After",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "unauthorized",
                            "forbidden",
                            "insufficient_scope",
                            "plan_restricted",
                            "account_suspended",
                            "not_found",
                            "invalid_request",
                            "validation_failed",
                            "conflict",
                            "rate_limited",
                            "quota_exceeded",
                            "not_configured",
                            "internal",
                            "invalid_click_id",
                            "attribution_expired"
                          ]
                        },
                        "message": {
                          "type": "string"
                        },
                        "doc_url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "path",
                              "message"
                            ],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": [
                        "code",
                        "message",
                        "doc_url"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  }
}
