{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xn-s7y-xn-3ds443g/json-schema/xn-s7y-xn-3ds443g-create-link-request-schema.json",
  "title": "CreateLinkRequest",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xn-s7y-xn-3ds443g-openapi.json#/components/schemas/CreateLinkRequest",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "url"
      ],
      "properties": {
        "url": {
          "$ref": "#/$defs/HttpUrl",
          "description": "Destination URL. Same absolute http(s) URL as PATCH."
        },
        "alias": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$",
          "maxLength": 32,
          "description": "Optional custom short code. Stored lowercase; lookup is case-insensitive. Must not be reserved."
        },
        "customSlug": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$",
          "maxLength": 32,
          "description": "Compatibility alias of `alias`. If both are set they must match (case-insensitive) or the API returns 409 FIELD_CONFLICT.",
          "deprecated": true
        },
        "source": {
          "type": "string",
          "maxLength": 64,
          "description": "Caller hint only — not trusted click attribution."
        },
        "title": {
          "type": "string",
          "maxLength": 256
        },
        "locale": {
          "description": "en or zh-CN. Aliases zh-cn, zh-Hans, zh-hans, zh_Hans, zh_hans become zh-CN. Rejects Traditional Chinese, EN, ZH-CN, and bare zh. Blank is en. Does not rewrite URLs, names, or location. Routes stay /zh-cn.",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "en",
                "zh-CN",
                "zh-cn",
                "zh-Hans",
                "zh-hans",
                "zh_Hans",
                "zh_hans"
              ]
            },
            {
              "type": "string",
              "pattern": "^\\s*$"
            }
          ]
        }
      },
      "additionalProperties": false,
      "not": {
        "required": [
          "longUrl"
        ]
      }
    },
    {
      "type": "object",
      "required": [
        "longUrl"
      ],
      "properties": {
        "longUrl": {
          "$ref": "#/$defs/HttpUrl",
          "description": "Compatibility name for destination URL. Mutually exclusive with `url`.",
          "deprecated": true
        },
        "alias": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$",
          "maxLength": 32,
          "description": "Optional custom short code. Stored lowercase; lookup is case-insensitive. Must not be reserved."
        },
        "customSlug": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,31}$",
          "maxLength": 32,
          "description": "Compatibility alias of `alias`. If both are set they must match (case-insensitive) or the API returns 409 FIELD_CONFLICT.",
          "deprecated": true
        },
        "source": {
          "type": "string",
          "maxLength": 64,
          "description": "Caller hint only — not trusted click attribution."
        },
        "title": {
          "type": "string",
          "maxLength": 256
        },
        "locale": {
          "description": "en or zh-CN. Aliases zh-cn, zh-Hans, zh-hans, zh_Hans, zh_hans become zh-CN. Rejects Traditional Chinese, EN, ZH-CN, and bare zh. Blank is en. Does not rewrite URLs, names, or location. Routes stay /zh-cn.",
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "en",
                "zh-CN",
                "zh-cn",
                "zh-Hans",
                "zh-hans",
                "zh_Hans",
                "zh_hans"
              ]
            },
            {
              "type": "string",
              "pattern": "^\\s*$"
            }
          ]
        }
      },
      "additionalProperties": false,
      "not": {
        "required": [
          "url"
        ]
      }
    }
  ],
  "$defs": {
    "HttpUrl": {
      "type": "string",
      "minLength": 8,
      "maxLength": 2048,
      "format": "uri",
      "pattern": "^https?://",
      "description": "Absolute http or https URL for create, batch, and PATCH destinations. Scheme is lowercase http:// or https:// with no surrounding whitespace."
    }
  }
}