{
  "openapi": "3.1.0",
  "info": {
    "title": "openshrtr API for AI agents",
    "version": "1.0.0",
    "summary": "Short links that tell a human from a bot.",
    "description": "openshrtr shortens links and judges every click: a person or a machine. An AI agent can open an account with one API request and get a key, free within published limits, with no email and no human. With the key it creates short links and reads how many clicks came from people the analyzer confirmed and how many from machines.\n\nLimits:\n\n- Sign-up: 3 accounts in a row from one address, then one every 10 minutes; 300 new agent accounts per UTC day for the whole service.\n\n- Links: up to 100 per account; up to 60 new links an hour.\n\n- Requests: 120 a minute per key; 600 a minute per address for all keys together (agents behind one cloud address share it).\n\n- Idle accounts: an agent account without links whose key has not been used for 30 days is deleted.\n\n- Price: none. There is no paid plan and no card; these limits are the offer.\n\nCounters:\n\n- clicks: Every recorded click on the link.\n\n- humans: Clicks the analyzer confirmed as a person. The same number the dashboard shows as Humans.\n\n- human_devices: Distinct devices among the confirmed humans (by device fingerprint).\n\n- machines: Clicks that are not confirmed humans and carry a machine sign: a User-Agent that names a bot or a tool, a data-center address, a burst, or the analyzer's machine verdict.\n\n- unclear: The analyzer ran but found neither a machine sign nor enough evidence of a person.\n\n- no_verdict: The check did not finish (no JavaScript, the visitor left early, a prefetch) and no machine sign was seen.\n\nclicks = humans + machines + unclear + no_verdict. Each click is in exactly one group, and the group of a click is its `kind`.\n\nNo rates are computed. humans divided by clicks is the share of recorded clicks confirmed as people; it is not a delivery rate and not a conversion rate.\n\nRules:\n\n- No phishing, no malware, no spam. Links like that, and the accounts behind them, are disabled without notice.\n\n- No uptime guarantee and no promise to keep data. Limits may change; this page always shows the ones in force.\n\n- Each account sees and changes only its own links."
  },
  "externalDocs": {
    "description": "Full instructions",
    "url": "https://openshrtr.com/agents"
  },
  "servers": [
    {
      "url": "https://openshrtr.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer sk_…"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "The same key in X-API-Key."
      }
    }
  },
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "index",
        "summary": "What this API is",
        "description": "A short pointer: the service, whether agent sign-up is open, and where the documentation is. No key needed.",
        "security": [],
        "responses": {
          "200": {
            "description": "What this API is",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The pointer.",
                  "properties": {
                    "service": {
                      "type": "string",
                      "description": "Service name."
                    },
                    "about": {
                      "type": "string",
                      "description": "One sentence about the service."
                    },
                    "signup_open": {
                      "type": "boolean",
                      "description": "Whether POST /api/v1/agents accepts new accounts right now."
                    },
                    "signup": {
                      "type": "string",
                      "description": "How to create an account."
                    },
                    "docs": {
                      "type": "object",
                      "description": "Documentation.",
                      "properties": {
                        "html": {
                          "type": "string",
                          "description": "Full instructions."
                        },
                        "markdown": {
                          "type": "string",
                          "description": "The same in Markdown."
                        },
                        "openapi": {
                          "type": "string",
                          "description": "OpenAPI 3.1 description."
                        }
                      },
                      "required": [
                        "html",
                        "markdown",
                        "openapi"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "service",
                    "about",
                    "signup_open",
                    "signup",
                    "docs"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "service": "openshrtr",
                  "about": "Short links that tell a human from a bot.",
                  "signup_open": true,
                  "signup": "POST https://openshrtr.com/api/v1/agents",
                  "docs": {
                    "html": "https://openshrtr.com/agents",
                    "markdown": "https://openshrtr.com/llms.txt",
                    "openapi": "https://openshrtr.com/openapi.json"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/agents": {
      "post": {
        "operationId": "signup",
        "summary": "Create an agent account and a key",
        "description": "One request, no key, no email. The answer holds the API key and a 12-word phrase; both are shown only once, the service keeps only their hashes.\n\nThe key and the phrase are secrets: they belong out of logs, out of replies to users and out of public places. Whoever holds either of them controls the account.\n\nFrom one address: 3 sign-ups in a row, then one every 10 minutes. For the whole service: 300 new agent accounts per UTC day.",
        "security": [],
        "responses": {
          "201": {
            "description": "Create an agent account and a key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The new account.",
                  "properties": {
                    "api_key": {
                      "type": "string",
                      "description": "The key for every other request. Shown only here."
                    },
                    "phrase": {
                      "type": "string",
                      "description": "12 words to sign in to the dashboard as a person. Shown only here."
                    },
                    "account": {
                      "type": "object",
                      "description": "The account.",
                      "properties": {
                        "label": {
                          "type": "string",
                          "description": "How the account is shown in the dashboard: \"key:\" and the first 8 hex digits of the phrase hash."
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The name given at sign-up, or null."
                        },
                        "origin": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "\"agent\" for accounts created through this API; null for accounts created on the website.",
                          "enum": [
                            "agent",
                            null
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "description": "When the account was created (ISO 8601, UTC)."
                        }
                      },
                      "required": [
                        "label",
                        "name",
                        "origin",
                        "created_at"
                      ],
                      "additionalProperties": false
                    },
                    "limits": {
                      "type": "object",
                      "description": "Limits of this account, as enforced now.",
                      "properties": {
                        "links_per_account": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Links this account can hold, or null for no limit."
                        },
                        "new_links_per_hour": {
                          "type": "integer",
                          "description": "New links per hour per account."
                        },
                        "requests_per_minute": {
                          "type": "integer",
                          "description": "Requests per minute per key."
                        }
                      },
                      "required": [
                        "links_per_account",
                        "new_links_per_hour",
                        "requests_per_minute"
                      ],
                      "additionalProperties": false
                    },
                    "docs": {
                      "type": "string",
                      "description": "The documentation."
                    },
                    "sign_in": {
                      "type": "string",
                      "description": "Where a person signs in with the phrase."
                    }
                  },
                  "required": [
                    "api_key",
                    "phrase",
                    "account",
                    "limits",
                    "docs",
                    "sign_in"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "api_key": "sk_q8Xv2mN4pL6tR9wY1zA3cE5gJ7kM0oQs",
                  "phrase": "orbit sauce timber glow minute vessel cradle eager throw lunar quote spike",
                  "account": {
                    "label": "key:1a2b3c4d",
                    "name": "my-agent",
                    "origin": "agent",
                    "created_at": "2026-11-26T10:00:00.000Z"
                  },
                  "limits": {
                    "links_per_account": 100,
                    "new_links_per_hour": 60,
                    "requests_per_minute": 120
                  },
                  "docs": "https://openshrtr.com/agents",
                  "sign_in": "https://openshrtr.com/login"
                }
              }
            }
          },
          "400": {
            "description": "Error: invalid_json, invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Error: signup_paused",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "413": {
            "description": "Error: body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited, daily_signup_limit",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Optional. An empty body is fine.",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "How the agent calls itself, up to 80 characters. Shown to the service administrator as plain text; control characters are removed."
                  }
                },
                "required": [],
                "additionalProperties": false
              },
              "example": {
                "name": "my-agent"
              }
            }
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "me",
        "summary": "The account, its limits and usage",
        "description": "Who the key belongs to, how many links the account holds and the limits in force.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "The account, its limits and usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The account and usage.",
                  "properties": {
                    "account": {
                      "type": "object",
                      "description": "The account.",
                      "properties": {
                        "label": {
                          "type": "string",
                          "description": "How the account is shown in the dashboard: \"key:\" and the first 8 hex digits of the phrase hash."
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The name given at sign-up, or null."
                        },
                        "origin": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "\"agent\" for accounts created through this API; null for accounts created on the website.",
                          "enum": [
                            "agent",
                            null
                          ]
                        },
                        "created_at": {
                          "type": "string",
                          "description": "When the account was created (ISO 8601, UTC)."
                        }
                      },
                      "required": [
                        "label",
                        "name",
                        "origin",
                        "created_at"
                      ],
                      "additionalProperties": false
                    },
                    "links": {
                      "type": "object",
                      "description": "Links of the account.",
                      "properties": {
                        "used": {
                          "type": "integer",
                          "description": "Links the account holds now, active or not."
                        },
                        "limit": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "How many it can hold, or null for no limit."
                        }
                      },
                      "required": [
                        "used",
                        "limit"
                      ],
                      "additionalProperties": false
                    },
                    "limits": {
                      "type": "object",
                      "description": "Limits of this account, as enforced now.",
                      "properties": {
                        "links_per_account": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Links this account can hold, or null for no limit."
                        },
                        "new_links_per_hour": {
                          "type": "integer",
                          "description": "New links per hour per account."
                        },
                        "requests_per_minute": {
                          "type": "integer",
                          "description": "Requests per minute per key."
                        }
                      },
                      "required": [
                        "links_per_account",
                        "new_links_per_hour",
                        "requests_per_minute"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "account",
                    "links",
                    "limits"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "account": {
                    "label": "key:1a2b3c4d",
                    "name": "my-agent",
                    "origin": "agent",
                    "created_at": "2026-11-26T10:00:00.000Z"
                  },
                  "links": {
                    "used": 1,
                    "limit": 100
                  },
                  "limits": {
                    "links_per_account": 100,
                    "new_links_per_hour": 60,
                    "requests_per_minute": 120
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: conflicting_api_keys",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/links": {
      "post": {
        "operationId": "create",
        "summary": "Create a short link",
        "description": "Every link opens the check page first (the deep check is always on), so each click gets a verdict when the visitor's browser runs the page script.\n\nThe account holds up to 100 links (deleting one frees a place; disabling does not) and creates up to 60 links an hour.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "201": {
            "description": "Create a short link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A short link.",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "The short code: the part of the address after the domain."
                    },
                    "url": {
                      "type": "string",
                      "description": "The full short address to share."
                    },
                    "target": {
                      "type": "string",
                      "description": "Where people are sent."
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Your label for the link, or null."
                    },
                    "decoy": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Where machines are sent, or null when there is no decoy."
                    },
                    "active": {
                      "type": "boolean",
                      "description": "false: the link answers \"Link not found\" to visitors; its counters stay."
                    },
                    "created_at": {
                      "type": "string",
                      "description": "When the link was created (ISO 8601, UTC)."
                    },
                    "last_click_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The latest click (ISO 8601, UTC), or null."
                    },
                    "counts": {
                      "type": "object",
                      "description": "Counters of the link. clicks = humans + machines + unclear + no_verdict.",
                      "properties": {
                        "clicks": {
                          "type": "integer",
                          "description": "Every recorded click on the link."
                        },
                        "humans": {
                          "type": "integer",
                          "description": "Clicks the analyzer confirmed as a person. The same number the dashboard shows as Humans."
                        },
                        "human_devices": {
                          "type": "integer",
                          "description": "Distinct devices among the confirmed humans (by device fingerprint)."
                        },
                        "machines": {
                          "type": "integer",
                          "description": "Clicks that are not confirmed humans and carry a machine sign: a User-Agent that names a bot or a tool, a data-center address, a burst, or the analyzer's machine verdict."
                        },
                        "unclear": {
                          "type": "integer",
                          "description": "The analyzer ran but found neither a machine sign nor enough evidence of a person."
                        },
                        "no_verdict": {
                          "type": "integer",
                          "description": "The check did not finish (no JavaScript, the visitor left early, a prefetch) and no machine sign was seen."
                        }
                      },
                      "required": [
                        "clicks",
                        "humans",
                        "human_devices",
                        "machines",
                        "unclear",
                        "no_verdict"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "code",
                    "url",
                    "target",
                    "title",
                    "decoy",
                    "active",
                    "created_at",
                    "last_click_at",
                    "counts"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "code": "k7Qm2x",
                  "url": "https://shrtr.win/k7Qm2x",
                  "target": "https://example.com/page",
                  "title": null,
                  "decoy": null,
                  "active": true,
                  "created_at": "2026-11-26T10:00:00.000Z",
                  "last_click_at": null,
                  "counts": {
                    "clicks": 0,
                    "humans": 0,
                    "human_devices": 0,
                    "machines": 0,
                    "unclear": 0,
                    "no_verdict": 0
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: invalid_json, invalid_request, invalid_target, invalid_decoy, invalid_domain",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "403": {
            "description": "Error: link_limit_reached",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "413": {
            "description": "Error: body_too_large",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The new link.",
                "properties": {
                  "target": {
                    "type": "string",
                    "description": "Where people are sent: an http or https address up to 2048 characters, without a user name or password, not on this service's own domains. Without a scheme, https:// is assumed."
                  },
                  "title": {
                    "type": "string",
                    "description": "Your label, up to 200 characters."
                  },
                  "domain": {
                    "type": "string",
                    "description": "Short domain for the link, one of `shrtr.win`, `openshrtr.com`; by default `shrtr.win`."
                  },
                  "decoy": {
                    "type": "string",
                    "description": "Where machines are sent instead of the target: an http or https address without a user name or password, or \"rickroll\" for a harmless video. Omit for no decoy: then machines reach the target too."
                  }
                },
                "required": [
                  "target"
                ],
                "additionalProperties": false
              },
              "example": {
                "target": "https://example.com/page",
                "title": "Spring newsletter"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "list",
        "summary": "List your links with counters",
        "description": "All links of the account, newest first, each with its counters.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "List your links with counters",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Your links.",
                  "properties": {
                    "links": {
                      "type": "array",
                      "description": "Links, newest first.",
                      "items": {
                        "type": "object",
                        "description": "A short link.",
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "The short code: the part of the address after the domain."
                          },
                          "url": {
                            "type": "string",
                            "description": "The full short address to share."
                          },
                          "target": {
                            "type": "string",
                            "description": "Where people are sent."
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Your label for the link, or null."
                          },
                          "decoy": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Where machines are sent, or null when there is no decoy."
                          },
                          "active": {
                            "type": "boolean",
                            "description": "false: the link answers \"Link not found\" to visitors; its counters stay."
                          },
                          "created_at": {
                            "type": "string",
                            "description": "When the link was created (ISO 8601, UTC)."
                          },
                          "last_click_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The latest click (ISO 8601, UTC), or null."
                          },
                          "counts": {
                            "type": "object",
                            "description": "Counters of the link. clicks = humans + machines + unclear + no_verdict.",
                            "properties": {
                              "clicks": {
                                "type": "integer",
                                "description": "Every recorded click on the link."
                              },
                              "humans": {
                                "type": "integer",
                                "description": "Clicks the analyzer confirmed as a person. The same number the dashboard shows as Humans."
                              },
                              "human_devices": {
                                "type": "integer",
                                "description": "Distinct devices among the confirmed humans (by device fingerprint)."
                              },
                              "machines": {
                                "type": "integer",
                                "description": "Clicks that are not confirmed humans and carry a machine sign: a User-Agent that names a bot or a tool, a data-center address, a burst, or the analyzer's machine verdict."
                              },
                              "unclear": {
                                "type": "integer",
                                "description": "The analyzer ran but found neither a machine sign nor enough evidence of a person."
                              },
                              "no_verdict": {
                                "type": "integer",
                                "description": "The check did not finish (no JavaScript, the visitor left early, a prefetch) and no machine sign was seen."
                              }
                            },
                            "required": [
                              "clicks",
                              "humans",
                              "human_devices",
                              "machines",
                              "unclear",
                              "no_verdict"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "code",
                          "url",
                          "target",
                          "title",
                          "decoy",
                          "active",
                          "created_at",
                          "last_click_at",
                          "counts"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "links"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "links": [
                    {
                      "code": "k7Qm2x",
                      "url": "https://shrtr.win/k7Qm2x",
                      "target": "https://example.com/page",
                      "title": null,
                      "decoy": null,
                      "active": true,
                      "created_at": "2026-11-26T10:00:00.000Z",
                      "last_click_at": "2026-11-26T12:30:00.000Z",
                      "counts": {
                        "clicks": 12,
                        "humans": 7,
                        "human_devices": 6,
                        "machines": 3,
                        "unclear": 1,
                        "no_verdict": 1
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/links/{code}": {
      "get": {
        "operationId": "get",
        "summary": "One link: counters, days, recent clicks",
        "description": "Counters, the last 30 UTC days (oldest first, today included) and up to 100 latest clicks, each with its group, machine signs and, where the check ran, the verdict, confidence and evidence. Visitor addresses are never returned.\n\nA code that does not exist and a code of another account get the same 404.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "One link: counters, days, recent clicks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The link in detail.",
                  "properties": {
                    "link": {
                      "type": "object",
                      "description": "A short link.",
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "The short code: the part of the address after the domain."
                        },
                        "url": {
                          "type": "string",
                          "description": "The full short address to share."
                        },
                        "target": {
                          "type": "string",
                          "description": "Where people are sent."
                        },
                        "title": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Your label for the link, or null."
                        },
                        "decoy": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Where machines are sent, or null when there is no decoy."
                        },
                        "active": {
                          "type": "boolean",
                          "description": "false: the link answers \"Link not found\" to visitors; its counters stay."
                        },
                        "created_at": {
                          "type": "string",
                          "description": "When the link was created (ISO 8601, UTC)."
                        },
                        "last_click_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "The latest click (ISO 8601, UTC), or null."
                        },
                        "counts": {
                          "type": "object",
                          "description": "Counters of the link. clicks = humans + machines + unclear + no_verdict.",
                          "properties": {
                            "clicks": {
                              "type": "integer",
                              "description": "Every recorded click on the link."
                            },
                            "humans": {
                              "type": "integer",
                              "description": "Clicks the analyzer confirmed as a person. The same number the dashboard shows as Humans."
                            },
                            "human_devices": {
                              "type": "integer",
                              "description": "Distinct devices among the confirmed humans (by device fingerprint)."
                            },
                            "machines": {
                              "type": "integer",
                              "description": "Clicks that are not confirmed humans and carry a machine sign: a User-Agent that names a bot or a tool, a data-center address, a burst, or the analyzer's machine verdict."
                            },
                            "unclear": {
                              "type": "integer",
                              "description": "The analyzer ran but found neither a machine sign nor enough evidence of a person."
                            },
                            "no_verdict": {
                              "type": "integer",
                              "description": "The check did not finish (no JavaScript, the visitor left early, a prefetch) and no machine sign was seen."
                            }
                          },
                          "required": [
                            "clicks",
                            "humans",
                            "human_devices",
                            "machines",
                            "unclear",
                            "no_verdict"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "code",
                        "url",
                        "target",
                        "title",
                        "decoy",
                        "active",
                        "created_at",
                        "last_click_at",
                        "counts"
                      ],
                      "additionalProperties": false
                    },
                    "daily": {
                      "type": "array",
                      "description": "The last 30 UTC days, oldest first.",
                      "items": {
                        "type": "object",
                        "description": "One UTC day.",
                        "properties": {
                          "date": {
                            "type": "string",
                            "description": "The day, YYYY-MM-DD (UTC)."
                          },
                          "clicks": {
                            "type": "integer",
                            "description": "Clicks that day."
                          },
                          "humans": {
                            "type": "integer",
                            "description": "Confirmed humans that day."
                          },
                          "machines": {
                            "type": "integer",
                            "description": "Machines that day."
                          },
                          "unclear": {
                            "type": "integer",
                            "description": "Unclear that day."
                          },
                          "no_verdict": {
                            "type": "integer",
                            "description": "Without a verdict that day."
                          }
                        },
                        "required": [
                          "date",
                          "clicks",
                          "humans",
                          "machines",
                          "unclear",
                          "no_verdict"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "recent_clicks": {
                      "type": "array",
                      "description": "Up to 100 latest clicks, newest first.",
                      "items": {
                        "type": "object",
                        "description": "One click. Visitor addresses are never returned.",
                        "properties": {
                          "at": {
                            "type": "string",
                            "description": "When the click happened (ISO 8601, UTC)."
                          },
                          "kind": {
                            "type": "string",
                            "description": "The group the click is counted in.",
                            "enum": [
                              "human",
                              "machine",
                              "unclear",
                              "no_verdict"
                            ]
                          },
                          "verdict": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The analyzer's own verdict, or null when the check did not finish.",
                            "enum": [
                              "human",
                              "machine",
                              "unclear",
                              null
                            ]
                          },
                          "confidence": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "How sure the analyzer is of its verdict, 0 to 100, or null. Not an accuracy figure."
                          },
                          "evidence": {
                            "type": "object",
                            "description": "What the analyzer found on each side. Both lists are empty when the check did not run (for example a click by curl); then any machine sign is in signals.",
                            "properties": {
                              "for_machine": {
                                "type": "array",
                                "description": "Signs of automation.",
                                "items": {
                                  "type": "string",
                                  "description": "A sign of automation."
                                }
                              },
                              "for_human": {
                                "type": "array",
                                "description": "Signs of a real device and a person.",
                                "items": {
                                  "type": "string",
                                  "description": "A sign of a real device."
                                }
                              }
                            },
                            "required": [
                              "for_machine",
                              "for_human"
                            ],
                            "additionalProperties": false
                          },
                          "signals": {
                            "type": "object",
                            "description": "Machine signs recorded by the server.",
                            "properties": {
                              "declared_bot": {
                                "type": "boolean",
                                "description": "The User-Agent names a bot or a tool (curl, crawlers, link previews)."
                              },
                              "scanner": {
                                "type": "boolean",
                                "description": "A data-center or proxy address without a privacy-relay sign, or a machine verdict."
                              },
                              "burst": {
                                "type": "boolean",
                                "description": "Part of a burst: five or more different addresses opened the link within two minutes from non-mobile devices."
                              }
                            },
                            "required": [
                              "declared_bot",
                              "scanner",
                              "burst"
                            ],
                            "additionalProperties": false
                          },
                          "engine": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Version of the detection rules that judged the click, or null."
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Country by address, or null."
                          },
                          "country_code": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "ISO 3166-1 alpha-2 country code, or null."
                          },
                          "device": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Device class from the User-Agent, or null."
                          },
                          "os": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Operating system from the User-Agent, or null."
                          },
                          "browser": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Browser from the User-Agent, or null."
                          },
                          "referrer_host": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "The site the visitor came from, or null for a direct open."
                          }
                        },
                        "required": [
                          "at",
                          "kind",
                          "verdict",
                          "confidence",
                          "evidence",
                          "signals",
                          "engine",
                          "country",
                          "country_code",
                          "device",
                          "os",
                          "browser",
                          "referrer_host"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "link",
                    "daily",
                    "recent_clicks"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "link": {
                    "code": "k7Qm2x",
                    "url": "https://shrtr.win/k7Qm2x",
                    "target": "https://example.com/page",
                    "title": null,
                    "decoy": null,
                    "active": true,
                    "created_at": "2026-11-26T10:00:00.000Z",
                    "last_click_at": "2026-11-26T12:30:00.000Z",
                    "counts": {
                      "clicks": 12,
                      "humans": 7,
                      "human_devices": 6,
                      "machines": 3,
                      "unclear": 1,
                      "no_verdict": 1
                    }
                  },
                  "daily": [
                    {
                      "date": "2026-11-26",
                      "clicks": 12,
                      "humans": 7,
                      "machines": 3,
                      "unclear": 1,
                      "no_verdict": 1
                    }
                  ],
                  "recent_clicks": [
                    {
                      "at": "2026-11-26T12:30:00.000Z",
                      "kind": "human",
                      "verdict": "human",
                      "confidence": 85,
                      "evidence": {
                        "for_machine": [],
                        "for_human": [
                          "Time zone Europe/Berlin",
                          "Screen 390x844 @3x"
                        ]
                      },
                      "signals": {
                        "declared_bot": false,
                        "scanner": false,
                        "burst": false
                      },
                      "engine": "2026.11.25",
                      "country": "Germany",
                      "country_code": "DE",
                      "device": "mobile",
                      "os": "iOS",
                      "browser": "Safari",
                      "referrer_host": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Error: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The short code of the link.",
            "schema": {
              "type": "string"
            }
          }
        ]
      },
      "patch": {
        "operationId": "patch",
        "summary": "Turn a link off or on",
        "description": "`{\"active\": false}` makes the link answer \"Link not found\" to visitors; `true` turns it back on. Counters stay.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Turn a link off or on",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "A short link.",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": "The short code: the part of the address after the domain."
                    },
                    "url": {
                      "type": "string",
                      "description": "The full short address to share."
                    },
                    "target": {
                      "type": "string",
                      "description": "Where people are sent."
                    },
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Your label for the link, or null."
                    },
                    "decoy": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Where machines are sent, or null when there is no decoy."
                    },
                    "active": {
                      "type": "boolean",
                      "description": "false: the link answers \"Link not found\" to visitors; its counters stay."
                    },
                    "created_at": {
                      "type": "string",
                      "description": "When the link was created (ISO 8601, UTC)."
                    },
                    "last_click_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "The latest click (ISO 8601, UTC), or null."
                    },
                    "counts": {
                      "type": "object",
                      "description": "Counters of the link. clicks = humans + machines + unclear + no_verdict.",
                      "properties": {
                        "clicks": {
                          "type": "integer",
                          "description": "Every recorded click on the link."
                        },
                        "humans": {
                          "type": "integer",
                          "description": "Clicks the analyzer confirmed as a person. The same number the dashboard shows as Humans."
                        },
                        "human_devices": {
                          "type": "integer",
                          "description": "Distinct devices among the confirmed humans (by device fingerprint)."
                        },
                        "machines": {
                          "type": "integer",
                          "description": "Clicks that are not confirmed humans and carry a machine sign: a User-Agent that names a bot or a tool, a data-center address, a burst, or the analyzer's machine verdict."
                        },
                        "unclear": {
                          "type": "integer",
                          "description": "The analyzer ran but found neither a machine sign nor enough evidence of a person."
                        },
                        "no_verdict": {
                          "type": "integer",
                          "description": "The check did not finish (no JavaScript, the visitor left early, a prefetch) and no machine sign was seen."
                        }
                      },
                      "required": [
                        "clicks",
                        "humans",
                        "human_devices",
                        "machines",
                        "unclear",
                        "no_verdict"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "code",
                    "url",
                    "target",
                    "title",
                    "decoy",
                    "active",
                    "created_at",
                    "last_click_at",
                    "counts"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "code": "k7Qm2x",
                  "url": "https://shrtr.win/k7Qm2x",
                  "target": "https://example.com/page",
                  "title": null,
                  "decoy": null,
                  "active": false,
                  "created_at": "2026-11-26T10:00:00.000Z",
                  "last_click_at": "2026-11-26T12:30:00.000Z",
                  "counts": {
                    "clicks": 12,
                    "humans": 7,
                    "human_devices": 6,
                    "machines": 3,
                    "unclear": 1,
                    "no_verdict": 1
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error: invalid_json, invalid_request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Error: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The short code of the link.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "The change.",
                "properties": {
                  "active": {
                    "type": "boolean",
                    "description": "true to turn the link on, false to turn it off."
                  }
                },
                "required": [
                  "active"
                ],
                "additionalProperties": false
              },
              "example": {
                "active": false
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete",
        "summary": "Delete a link",
        "description": "Deletes the link together with all its clicks. This cannot be undone.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Delete a link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Done.",
                  "properties": {
                    "deleted": {
                      "type": "string",
                      "description": "The code of the deleted link."
                    }
                  },
                  "required": [
                    "deleted"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "deleted": "k7Qm2x"
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "404": {
            "description": "Error: not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "The short code of the link.",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/key/rotate": {
      "post": {
        "operationId": "rotate",
        "summary": "Replace the key",
        "description": "Issues a new key for the same account. The old key stops working at once. The new key is shown only in this answer.",
        "security": [
          {
            "bearer": []
          },
          {
            "apiKeyHeader": []
          }
        ],
        "responses": {
          "200": {
            "description": "Replace the key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "The new key.",
                  "properties": {
                    "api_key": {
                      "type": "string",
                      "description": "The new key."
                    }
                  },
                  "required": [
                    "api_key"
                  ],
                  "additionalProperties": false
                },
                "example": {
                  "api_key": "sk_N3wKeyN3wKeyN3wKeyN3wKeyN3wKeyN3"
                }
              }
            }
          },
          "401": {
            "description": "Error: missing_api_key, invalid_api_key",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "429": {
            "description": "Error: rate_limited",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "An error.",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "What went wrong, in plain words."
                    },
                    "code": {
                      "type": "string",
                      "description": "A stable machine code.",
                      "enum": [
                        "invalid_json",
                        "invalid_request",
                        "invalid_target",
                        "invalid_decoy",
                        "invalid_domain",
                        "conflicting_api_keys",
                        "missing_api_key",
                        "invalid_api_key",
                        "link_limit_reached",
                        "signup_paused",
                        "not_found",
                        "method_not_allowed",
                        "body_too_large",
                        "rate_limited",
                        "daily_signup_limit",
                        "server_error"
                      ]
                    },
                    "docs": {
                      "type": "string",
                      "description": "Where the codes are explained."
                    }
                  },
                  "required": [
                    "error",
                    "code",
                    "docs"
                  ],
                  "additionalProperties": false
                }
              }
            }
          }
        }
      }
    }
  }
}