> ## Documentation Index
> Fetch the complete documentation index at: https://docs.h0p.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Update short link

> Update an existing short link's configuration.

**Updatable:** Domain, slug, destination, folder, tags, routing rules, QR code, password, max clicks, expiration, cloaking, meta tags
**Automatic:** URL threat recheck, QR code template sync if domain changed, tag/folder count updates
**Note:** All fields optional - only send fields to update



## OpenAPI

````yaml https://api.h0p.co/doc patch /short-link/{id}
openapi: 3.0.0
info:
  version: 0.0.3
  title: h0p API
  description: >-
    # h0p URL Shortener API


    A modern, feature-rich URL shortener API with advanced analytics, custom
    domains, QR codes, and comprehensive link management capabilities.


    ## Features


    - 🔗 **Short Link Management**: Create, update, and delete short links with
    custom slugs

    - 🌐 **Custom Domains**: Use your own domains with DNS verification and deep
    linking support

    - 📊 **Analytics**: Detailed click tracking with geolocation, device, and
    referrer data

    - 🎨 **QR Codes**: Generate customizable QR codes with branding options

    - 🏷️ **Organization**: Folders and tags for better link organization

    - 🔐 **Security**: Password protection, expiration dates, and click limits

    - 🎯 **Smart Rules**: Geographic, language, and device-based routing

    - 🪝 **Webhooks**: Real-time notifications for link events

    - 🔑 **API Keys**: Programmatic access with granular permissions

    - ⚡ **Rate Limiting**: Built-in protection against abuse


    ## Authentication


    This API supports two authentication methods:


    1. **Session Authentication**: Cookie-based authentication for web
    applications

    2. **API Key Authentication**: Header-based authentication for programmatic
    access


    See the security schemes section below for implementation details.


    ## Rate Limits


    - Free plan: 10 short links, 1 custom domain, 3 tags

    - Premium plan: unlimited short links, 100 custom domains, 100 tags, 100
    folders, advanced features


    ## Support


    For questions, feature requests, or bug reports, please contact
    support@h0p.co
  termsOfService: https://h0p.co/terms
  contact:
    name: h0p Support
    email: contact@h0p.co
servers:
  - url: https://api.h0p.co
    description: Production API server
security: []
tags:
  - name: Domain
    description: >-
      Custom domain management with DNS verification, QR templates, and deep
      linking support
  - name: Short Link
    description: >-
      Create and manage short links with advanced features like smart routing,
      password protection, and custom QR codes
  - name: Folder
    description: >-
      Organize short links into folders for better management and statistics
      tracking
  - name: Tag
    description: Categorize and filter short links using customizable tags
  - name: Files
    description: Upload images for QR codes, meta tags, and organization branding
  - name: Statistics
    description: >-
      Access detailed analytics grouped by geographic, device, and traffic
      dimensions
paths:
  /short-link/{id}:
    patch:
      tags:
        - Short Link
      summary: Update short link
      description: >-
        Update an existing short link's configuration.


        **Updatable:** Domain, slug, destination, folder, tags, routing rules,
        QR code, password, max clicks, expiration, cloaking, meta tags

        **Automatic:** URL threat recheck, QR code template sync if domain
        changed, tag/folder count updates

        **Note:** All fields optional - only send fields to update
      parameters:
        - schema:
            type: string
            format: uuid
            example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
            description: Unique identifier in UUID v7 format
          required: true
          description: Unique identifier in UUID v7 format
          name: id
          in: path
      requestBody:
        required: true
        description: Fields to update (partial update supported)
        content:
          application/json:
            schema:
              type: object
              properties:
                domainId:
                  type: string
                  format: uuid
                  example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                  description: UUID of the domain to use
                domain:
                  type: string
                  example: links.example.com
                  description: Domain name to use (alternative to domainId)
                folderId:
                  type: string
                  nullable: true
                  format: uuid
                  example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                  description: UUID of folder to organize link
                tags:
                  type: array
                  nullable: true
                  items:
                    type: string
                    minLength: 1
                    maxLength: 30
                  minItems: 0
                  maxItems: 10
                  example:
                    - marketing
                    - campaign-2024
                    - social-media
                  description: Array of tag names to associate
                slug:
                  type: string
                  minLength: 1
                  maxLength: 50
                  pattern: ^(?![-_])[A-Za-z0-9-_]{1,50}(?<![-_])$
                  example: summer-sale
                  description: Custom slug for the short link
                maxClicks:
                  type: number
                  nullable: true
                  minimum: 1
                  exclusiveMinimum: true
                  example: 1000
                  description: Maximum number of clicks before link expires
                expiresAt:
                  type: string
                  nullable: true
                  format: date-time
                  example: '2024-12-31T23:59:59Z'
                  description: Link expiration date/time
                password:
                  type: string
                  nullable: true
                  minLength: 5
                  maxLength: 25
                  example: secretpass123
                  description: Password to protect link access
                cloaking:
                  type: boolean
                  example: false
                  description: Hide destination URL in browser
                enableDeepLinking:
                  type: boolean
                  example: true
                  description: Enable automatic deep linking to mobile apps
                rules:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      priority:
                        type: number
                        minimum: 0
                        example: 0
                        description: Rule evaluation priority (0 = highest)
                      countries:
                        type: array
                        nullable: true
                        items:
                          type: string
                          maxLength: 3
                        minItems: 1
                        maxItems: 150
                        example:
                          - US
                          - CA
                          - GB
                        description: ISO 3166-1 alpha-2 country codes
                      languages:
                        type: array
                        nullable: true
                        items:
                          type: string
                          maxLength: 5
                        minItems: 1
                        maxItems: 50
                        example:
                          - en
                          - fr
                          - es-MX
                        description: Language codes (ISO 639-1 with optional region)
                      osTypes:
                        type: array
                        nullable: true
                        items:
                          type: string
                          enum:
                            - windows
                            - macos
                            - linux
                            - ios
                            - android
                            - other
                        minItems: 1
                        example:
                          - ios
                          - android
                        description: Operating system types
                      destination:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - link
                              - mail
                              - phone
                            description: Type of destination
                            example: link
                          value:
                            type: string
                            description: Destination value (URL, email, or phone)
                            example: https://example.com
                          threatTypes:
                            type: array
                            nullable: true
                            items:
                              type: string
                              enum:
                                - MALWARE
                                - SOCIAL_ENGINEERING
                                - UNWANTED_SOFTWARE
                                - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
                              description: >-
                                Type of threat detected by Google Web Risk API.


                                **Threat types:**

                                - `MALWARE`: Website contains malicious software
                                that can harm devices

                                - `SOCIAL_ENGINEERING`: Deceptive site
                                attempting to trick users (phishing)

                                - `UNWANTED_SOFTWARE`: Site distributes unwanted
                                software or adware

                                - `SOCIAL_ENGINEERING_EXTENDED_COVERAGE`:
                                Extended detection of social engineering threats


                                **Note:** Threats are automatically detected
                                when creating or updating links. Users are
                                warned but not blocked from creating links with
                                threats.
                              example: MALWARE
                            description: Array of detected threats from Google Web Risk API
                            example:
                              - MALWARE
                          enableDeepLinking:
                            type: boolean
                            example: true
                            description: Deep linking enabled status
                          iosDeepLink:
                            type: string
                            nullable: true
                            example: instagram://media?id=123456789
                            description: iOS app deep link URL scheme
                          androidDeepLink:
                            type: string
                            nullable: true
                            example: >-
                              intent://instagram.com/p/ABC123#Intent;package=com.instagram.android;scheme=https;end
                            description: Android app deep link URL scheme
                        required:
                          - type
                          - value
                        description: Destination URL for this rule
                        example:
                          type: link
                          value: https://example.com
                          threatTypes: null
                    required:
                      - priority
                      - destination
                    description: Smart routing rule
                    example:
                      priority: 0
                      countries:
                        - US
                        - CA
                      languages:
                        - en
                      osTypes:
                        - ios
                        - android
                      destination:
                        type: link
                        value: https://example.com/mobile-us
                        threatTypes: null
                  minItems: 0
                  description: Smart routing rules array
                qrCode:
                  type: object
                  properties:
                    options:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - svg
                            - canvas
                          example: svg
                          description: Output format for QR code generation
                        width:
                          type: number
                          minimum: 100
                          exclusiveMinimum: true
                          example: 300
                          description: QR code width in pixels
                          maximum: 2000
                        height:
                          type: number
                          minimum: 100
                          exclusiveMinimum: true
                          example: 300
                          description: QR code height in pixels
                          maximum: 2000
                        margin:
                          type: number
                          minimum: 0
                          example: 4
                          description: Quiet zone margin around QR code (in modules)
                        data:
                          type: string
                          example: https://example.com/abc123
                          description: Data to encode in QR code
                        image:
                          type: string
                          format: uri
                          example: https://example.com/logo.png
                          description: Logo/image URL to embed in QR code center
                        imageOptions:
                          type: object
                          properties:
                            hideBackgroundDots:
                              type: boolean
                              example: true
                              description: Hide QR dots behind the logo image
                            imageSize:
                              type: number
                              minimum: 0
                              maximum: 1
                              example: 0.4
                              description: Logo size relative to QR code (0-1)
                            crossOrigin:
                              type: string
                              example: anonymous
                              description: CORS setting for loading external images
                            margin:
                              type: number
                              minimum: 0
                              example: 10
                              description: Padding around logo in pixels
                          description: Logo image customization options
                        dotsOptions:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - dots
                                - rounded
                                - classy
                                - classy-rounded
                                - square
                                - extra-rounded
                              description: Visual style for QR code data dots
                              example: rounded
                            color:
                              type: string
                              pattern: ^#[0-9A-Fa-f]{6}$
                              example: '#000000'
                              description: Hex color for QR code dots
                            gradient:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - radial
                                    - linear
                                  description: Gradient type
                                  example: linear
                                rotation:
                                  type: number
                                  example: 45
                                  description: Gradient rotation angle in degrees
                                  minimum: 0
                                  maximum: 360
                                colorStops:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      offset:
                                        type: number
                                        minimum: 0
                                        maximum: 1
                                        example: 0.5
                                        description: Position of color stop (0-1)
                                      color:
                                        type: string
                                        pattern: ^#[0-9A-Fa-f]{6}$
                                        example: '#3B82F6'
                                        description: Hex color code for this stop
                                    required:
                                      - offset
                                      - color
                                    description: Color stop definition for gradient
                                  minItems: 2
                                  description: Array of color stops defining the gradient
                                  example:
                                    - offset: 0
                                      color: '#3B82F6'
                                    - offset: 1
                                      color: '#8B5CF6'
                              required:
                                - type
                                - colorStops
                              description: Gradient configuration for dots
                            roundSize:
                              type: boolean
                              example: true
                              description: Apply rounding size algorithm
                          description: Customization options for QR code data dots
                        cornersSquareOptions:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - dot
                                - square
                                - extra-rounded
                                - dots
                                - rounded
                                - classy
                                - classy-rounded
                              description: Visual style for corner squares (outer ring)
                              example: square
                            color:
                              type: string
                              pattern: ^#[0-9A-Fa-f]{6}$
                              example: '#3B82F6'
                              description: Hex color for corner squares
                            gradient:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - radial
                                    - linear
                                  description: Gradient type
                                  example: linear
                                rotation:
                                  type: number
                                  example: 45
                                  description: Gradient rotation angle in degrees
                                  minimum: 0
                                  maximum: 360
                                colorStops:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      offset:
                                        type: number
                                        minimum: 0
                                        maximum: 1
                                        example: 0.5
                                        description: Position of color stop (0-1)
                                      color:
                                        type: string
                                        pattern: ^#[0-9A-Fa-f]{6}$
                                        example: '#3B82F6'
                                        description: Hex color code for this stop
                                    required:
                                      - offset
                                      - color
                                    description: Color stop definition for gradient
                                  minItems: 2
                                  description: Array of color stops defining the gradient
                                  example:
                                    - offset: 0
                                      color: '#3B82F6'
                                    - offset: 1
                                      color: '#8B5CF6'
                              required:
                                - type
                                - colorStops
                              description: Gradient for corner squares
                          description: Customization for corner position detection squares
                        cornersDotOptions:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - dot
                                - square
                                - dots
                                - rounded
                                - classy
                                - classy-rounded
                                - extra-rounded
                              description: Visual style for corner dots (inner dot)
                              example: dot
                            color:
                              type: string
                              pattern: ^#[0-9A-Fa-f]{6}$
                              example: '#8B5CF6'
                              description: Hex color for corner dots
                            gradient:
                              type: object
                              properties:
                                type:
                                  type: string
                                  enum:
                                    - radial
                                    - linear
                                  description: Gradient type
                                  example: linear
                                rotation:
                                  type: number
                                  example: 45
                                  description: Gradient rotation angle in degrees
                                  minimum: 0
                                  maximum: 360
                                colorStops:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      offset:
                                        type: number
                                        minimum: 0
                                        maximum: 1
                                        example: 0.5
                                        description: Position of color stop (0-1)
                                      color:
                                        type: string
                                        pattern: ^#[0-9A-Fa-f]{6}$
                                        example: '#3B82F6'
                                        description: Hex color code for this stop
                                    required:
                                      - offset
                                      - color
                                    description: Color stop definition for gradient
                                  minItems: 2
                                  description: Array of color stops defining the gradient
                                  example:
                                    - offset: 0
                                      color: '#3B82F6'
                                    - offset: 1
                                      color: '#8B5CF6'
                              required:
                                - type
                                - colorStops
                              description: Gradient for corner dots
                          description: Customization for corner position detection dots
                        backgroundOptions:
                          type: object
                          properties:
                            round:
                              type: number
                              minimum: 0
                              maximum: 1
                              example: 0.1
                              description: Background corner rounding (0-1)
                            color:
                              type: string
                              pattern: ^#[0-9A-Fa-f]{6}$
                              example: '#FFFFFF'
                              description: Hex color for QR code background
                          description: Background customization options
                      required:
                        - data
                      description: QR code generation and styling options
                    imageId:
                      type: string
                      nullable: true
                      format: uuid
                      example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                      description: UUID of uploaded logo image file
                  required:
                    - options
                  description: Custom QR code configuration for this link
                destination:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - link
                        - mail
                        - phone
                      description: Type of destination
                      example: link
                    value:
                      type: string
                      description: Destination value (URL, email, or phone)
                      example: https://example.com
                    threatTypes:
                      type: array
                      nullable: true
                      items:
                        type: string
                        enum:
                          - MALWARE
                          - SOCIAL_ENGINEERING
                          - UNWANTED_SOFTWARE
                          - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
                        description: >-
                          Type of threat detected by Google Web Risk API.


                          **Threat types:**

                          - `MALWARE`: Website contains malicious software that
                          can harm devices

                          - `SOCIAL_ENGINEERING`: Deceptive site attempting to
                          trick users (phishing)

                          - `UNWANTED_SOFTWARE`: Site distributes unwanted
                          software or adware

                          - `SOCIAL_ENGINEERING_EXTENDED_COVERAGE`: Extended
                          detection of social engineering threats


                          **Note:** Threats are automatically detected when
                          creating or updating links. Users are warned but not
                          blocked from creating links with threats.
                        example: MALWARE
                      description: Array of detected threats from Google Web Risk API
                      example:
                        - MALWARE
                    enableDeepLinking:
                      type: boolean
                      example: true
                      description: Deep linking enabled status
                    iosDeepLink:
                      type: string
                      nullable: true
                      example: instagram://media?id=123456789
                      description: iOS app deep link URL scheme
                    androidDeepLink:
                      type: string
                      nullable: true
                      example: >-
                        intent://instagram.com/p/ABC123#Intent;package=com.instagram.android;scheme=https;end
                      description: Android app deep link URL scheme
                  required:
                    - type
                    - value
                  description: Main destination URL/email/phone
                  example:
                    type: link
                    value: https://example.com
                    threatTypes: null
                metaTags:
                  type: object
                  nullable: true
                  properties:
                    title:
                      type: string
                      maxLength: 200
                      example: Check out this amazing product!
                      description: Custom title for social media sharing preview
                    description:
                      type: string
                      maxLength: 500
                      example: >-
                        Discover our new product line with exclusive features
                        and unbeatable prices.
                      description: Custom description for social media sharing preview
                    imageId:
                      type: string
                      nullable: true
                      format: uuid
                      example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                      description: UUID of uploaded preview image file
                  description: Custom Open Graph meta tags
                  example:
                    title: Amazing Product Launch 2024
                    description: >-
                      Be the first to discover our revolutionary new product
                      with exclusive early access.
                    imageId: 01933eb8-541f-7000-a9f4-e4eee80ff04e
              required:
                - destination
              description: Short link creation/update request
              example:
                domain: links.example.com
                slug: summer-sale
                destination:
                  type: link
                  value: https://example.com/products/summer-sale
                  threatTypes: null
                tags:
                  - marketing
                  - sale
                folderId: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                maxClicks: 1000
                expiresAt: '2024-12-31T23:59:59Z'
      responses:
        '200':
          description: Short link updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  domain:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                        description: Domain UUID
                      domain:
                        type: string
                        example: links.example.com
                        description: Domain name
                      isPrimary:
                        type: boolean
                        example: true
                        description: >-
                          Whether this is the primary domain for the
                          organization
                      isVerified:
                        type: boolean
                        example: true
                        description: Whether domain DNS is fully verified and active
                      createdAt:
                        type: string
                        nullable: true
                        format: date-time
                        example: '2024-01-15T10:30:00Z'
                        description: Domain creation timestamp
                    required:
                      - id
                      - domain
                      - isPrimary
                      - isVerified
                      - createdAt
                    description: Domain details
                  rules:
                    type: array
                    items:
                      type: object
                      properties:
                        priority:
                          type: number
                          minimum: 0
                          example: 0
                          description: Rule evaluation priority (0 = highest)
                        countries:
                          type: array
                          nullable: true
                          items:
                            type: string
                            maxLength: 3
                          minItems: 1
                          maxItems: 150
                          example:
                            - US
                            - CA
                            - GB
                          description: ISO 3166-1 alpha-2 country codes
                        languages:
                          type: array
                          nullable: true
                          items:
                            type: string
                            maxLength: 5
                          minItems: 1
                          maxItems: 50
                          example:
                            - en
                            - fr
                            - es-MX
                          description: Language codes (ISO 639-1 with optional region)
                        osTypes:
                          type: array
                          nullable: true
                          items:
                            type: string
                            enum:
                              - windows
                              - macos
                              - linux
                              - ios
                              - android
                              - other
                          minItems: 1
                          example:
                            - ios
                            - android
                          description: Operating system types
                        destination:
                          type: object
                          properties:
                            type:
                              type: string
                              enum:
                                - link
                                - mail
                                - phone
                              description: Type of destination
                              example: link
                            value:
                              type: string
                              description: Destination value (URL, email, or phone)
                              example: https://example.com
                            threatTypes:
                              type: array
                              nullable: true
                              items:
                                type: string
                                enum:
                                  - MALWARE
                                  - SOCIAL_ENGINEERING
                                  - UNWANTED_SOFTWARE
                                  - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
                                description: >-
                                  Type of threat detected by Google Web Risk
                                  API.


                                  **Threat types:**

                                  - `MALWARE`: Website contains malicious
                                  software that can harm devices

                                  - `SOCIAL_ENGINEERING`: Deceptive site
                                  attempting to trick users (phishing)

                                  - `UNWANTED_SOFTWARE`: Site distributes
                                  unwanted software or adware

                                  - `SOCIAL_ENGINEERING_EXTENDED_COVERAGE`:
                                  Extended detection of social engineering
                                  threats


                                  **Note:** Threats are automatically detected
                                  when creating or updating links. Users are
                                  warned but not blocked from creating links
                                  with threats.
                                example: MALWARE
                              description: >-
                                Array of detected threats from Google Web Risk
                                API
                              example:
                                - MALWARE
                            enableDeepLinking:
                              type: boolean
                              example: true
                              description: Deep linking enabled status
                            iosDeepLink:
                              type: string
                              nullable: true
                              example: instagram://media?id=123456789
                              description: iOS app deep link URL scheme
                            androidDeepLink:
                              type: string
                              nullable: true
                              example: >-
                                intent://instagram.com/p/ABC123#Intent;package=com.instagram.android;scheme=https;end
                              description: Android app deep link URL scheme
                          required:
                            - type
                            - value
                          description: Destination URL for this rule
                          example:
                            type: link
                            value: https://example.com
                            threatTypes: null
                        id:
                          type: string
                          format: uuid
                      required:
                        - priority
                        - destination
                        - id
                    description: Smart routing rules with IDs
                  qrCode:
                    type: object
                    nullable: true
                    properties:
                      options:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - svg
                              - canvas
                            example: svg
                            description: Output format for QR code generation
                          width:
                            type: number
                            minimum: 100
                            exclusiveMinimum: true
                            example: 300
                            description: QR code width in pixels
                            maximum: 2000
                          height:
                            type: number
                            minimum: 100
                            exclusiveMinimum: true
                            example: 300
                            description: QR code height in pixels
                            maximum: 2000
                          margin:
                            type: number
                            minimum: 0
                            example: 4
                            description: Quiet zone margin around QR code (in modules)
                          data:
                            type: string
                            example: https://example.com/abc123
                            description: Data to encode in QR code
                          image:
                            type: string
                            format: uri
                            example: https://example.com/logo.png
                            description: Logo/image URL to embed in QR code center
                          imageOptions:
                            type: object
                            properties:
                              hideBackgroundDots:
                                type: boolean
                                example: true
                                description: Hide QR dots behind the logo image
                              imageSize:
                                type: number
                                minimum: 0
                                maximum: 1
                                example: 0.4
                                description: Logo size relative to QR code (0-1)
                              crossOrigin:
                                type: string
                                example: anonymous
                                description: CORS setting for loading external images
                              margin:
                                type: number
                                minimum: 0
                                example: 10
                                description: Padding around logo in pixels
                            description: Logo image customization options
                          dotsOptions:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - dots
                                  - rounded
                                  - classy
                                  - classy-rounded
                                  - square
                                  - extra-rounded
                                description: Visual style for QR code data dots
                                example: rounded
                              color:
                                type: string
                                pattern: ^#[0-9A-Fa-f]{6}$
                                example: '#000000'
                                description: Hex color for QR code dots
                              gradient:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - radial
                                      - linear
                                    description: Gradient type
                                    example: linear
                                  rotation:
                                    type: number
                                    example: 45
                                    description: Gradient rotation angle in degrees
                                    minimum: 0
                                    maximum: 360
                                  colorStops:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        offset:
                                          type: number
                                          minimum: 0
                                          maximum: 1
                                          example: 0.5
                                          description: Position of color stop (0-1)
                                        color:
                                          type: string
                                          pattern: ^#[0-9A-Fa-f]{6}$
                                          example: '#3B82F6'
                                          description: Hex color code for this stop
                                      required:
                                        - offset
                                        - color
                                      description: Color stop definition for gradient
                                    minItems: 2
                                    description: Array of color stops defining the gradient
                                    example:
                                      - offset: 0
                                        color: '#3B82F6'
                                      - offset: 1
                                        color: '#8B5CF6'
                                required:
                                  - type
                                  - colorStops
                                description: Gradient configuration for dots
                              roundSize:
                                type: boolean
                                example: true
                                description: Apply rounding size algorithm
                            description: Customization options for QR code data dots
                          cornersSquareOptions:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - dot
                                  - square
                                  - extra-rounded
                                  - dots
                                  - rounded
                                  - classy
                                  - classy-rounded
                                description: Visual style for corner squares (outer ring)
                                example: square
                              color:
                                type: string
                                pattern: ^#[0-9A-Fa-f]{6}$
                                example: '#3B82F6'
                                description: Hex color for corner squares
                              gradient:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - radial
                                      - linear
                                    description: Gradient type
                                    example: linear
                                  rotation:
                                    type: number
                                    example: 45
                                    description: Gradient rotation angle in degrees
                                    minimum: 0
                                    maximum: 360
                                  colorStops:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        offset:
                                          type: number
                                          minimum: 0
                                          maximum: 1
                                          example: 0.5
                                          description: Position of color stop (0-1)
                                        color:
                                          type: string
                                          pattern: ^#[0-9A-Fa-f]{6}$
                                          example: '#3B82F6'
                                          description: Hex color code for this stop
                                      required:
                                        - offset
                                        - color
                                      description: Color stop definition for gradient
                                    minItems: 2
                                    description: Array of color stops defining the gradient
                                    example:
                                      - offset: 0
                                        color: '#3B82F6'
                                      - offset: 1
                                        color: '#8B5CF6'
                                required:
                                  - type
                                  - colorStops
                                description: Gradient for corner squares
                            description: >-
                              Customization for corner position detection
                              squares
                          cornersDotOptions:
                            type: object
                            properties:
                              type:
                                type: string
                                enum:
                                  - dot
                                  - square
                                  - dots
                                  - rounded
                                  - classy
                                  - classy-rounded
                                  - extra-rounded
                                description: Visual style for corner dots (inner dot)
                                example: dot
                              color:
                                type: string
                                pattern: ^#[0-9A-Fa-f]{6}$
                                example: '#8B5CF6'
                                description: Hex color for corner dots
                              gradient:
                                type: object
                                properties:
                                  type:
                                    type: string
                                    enum:
                                      - radial
                                      - linear
                                    description: Gradient type
                                    example: linear
                                  rotation:
                                    type: number
                                    example: 45
                                    description: Gradient rotation angle in degrees
                                    minimum: 0
                                    maximum: 360
                                  colorStops:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        offset:
                                          type: number
                                          minimum: 0
                                          maximum: 1
                                          example: 0.5
                                          description: Position of color stop (0-1)
                                        color:
                                          type: string
                                          pattern: ^#[0-9A-Fa-f]{6}$
                                          example: '#3B82F6'
                                          description: Hex color code for this stop
                                      required:
                                        - offset
                                        - color
                                      description: Color stop definition for gradient
                                    minItems: 2
                                    description: Array of color stops defining the gradient
                                    example:
                                      - offset: 0
                                        color: '#3B82F6'
                                      - offset: 1
                                        color: '#8B5CF6'
                                required:
                                  - type
                                  - colorStops
                                description: Gradient for corner dots
                            description: Customization for corner position detection dots
                          backgroundOptions:
                            type: object
                            properties:
                              round:
                                type: number
                                minimum: 0
                                maximum: 1
                                example: 0.1
                                description: Background corner rounding (0-1)
                              color:
                                type: string
                                pattern: ^#[0-9A-Fa-f]{6}$
                                example: '#FFFFFF'
                                description: Hex color for QR code background
                            description: Background customization options
                        required:
                          - data
                        description: QR code generation and styling options
                      imageId:
                        type: string
                        nullable: true
                        format: uuid
                        example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                        description: UUID of uploaded logo image file
                    required:
                      - options
                    description: QR code configuration
                  destination:
                    type: object
                    nullable: true
                    properties:
                      type:
                        type: string
                        enum:
                          - link
                          - mail
                          - phone
                        description: Type of destination
                        example: link
                      value:
                        type: string
                        description: Destination value (URL, email, or phone)
                        example: https://example.com
                      threatTypes:
                        type: array
                        nullable: true
                        items:
                          type: string
                          enum:
                            - MALWARE
                            - SOCIAL_ENGINEERING
                            - UNWANTED_SOFTWARE
                            - SOCIAL_ENGINEERING_EXTENDED_COVERAGE
                          description: >-
                            Type of threat detected by Google Web Risk API.


                            **Threat types:**

                            - `MALWARE`: Website contains malicious software
                            that can harm devices

                            - `SOCIAL_ENGINEERING`: Deceptive site attempting to
                            trick users (phishing)

                            - `UNWANTED_SOFTWARE`: Site distributes unwanted
                            software or adware

                            - `SOCIAL_ENGINEERING_EXTENDED_COVERAGE`: Extended
                            detection of social engineering threats


                            **Note:** Threats are automatically detected when
                            creating or updating links. Users are warned but not
                            blocked from creating links with threats.
                          example: MALWARE
                        description: Array of detected threats from Google Web Risk API
                        example:
                          - MALWARE
                      enableDeepLinking:
                        type: boolean
                        example: true
                        description: Deep linking enabled status
                      iosDeepLink:
                        type: string
                        nullable: true
                        example: instagram://media?id=123456789
                        description: iOS app deep link URL scheme
                      androidDeepLink:
                        type: string
                        nullable: true
                        example: >-
                          intent://instagram.com/p/ABC123#Intent;package=com.instagram.android;scheme=https;end
                        description: Android app deep link URL scheme
                    required:
                      - type
                      - value
                    description: Main destination configuration
                    example:
                      type: link
                      value: https://example.com
                      threatTypes: null
                  metaTags:
                    type: object
                    nullable: true
                    properties:
                      title:
                        type: string
                        nullable: true
                        example: Amazing Product Launch 2024
                        description: Custom title for social sharing
                      description:
                        type: string
                        nullable: true
                        example: >-
                          Be the first to discover our revolutionary new
                          product.
                        description: Custom description for social sharing
                      imageId:
                        type: string
                        nullable: true
                        format: uuid
                        example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                        description: UUID of preview image
                      image:
                        type: object
                        nullable: true
                        properties:
                          id:
                            type: string
                            format: uuid
                            example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                            description: Image file UUID
                          key:
                            type: string
                            example: meta-tag/01933eb8-541f-7000-a9f4-e4eee80ff04e.png
                            description: S3 storage key for the image
                        required:
                          - id
                          - key
                        description: Image file details
                    required:
                      - title
                      - description
                      - imageId
                      - image
                    description: Meta tags configuration
                    example:
                      title: Amazing Product Launch 2024
                      description: Be the first to discover our revolutionary new product.
                      imageId: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                      image:
                        id: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                        key: meta-tag/01933eb8-541f-7000-a9f4-e4eee80ff04e.png
                  tags:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                          example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                          description: Tag UUID
                        name:
                          type: string
                          example: social-media
                          description: Tag name
                        color:
                          type: string
                          nullable: true
                          example: '#10B981'
                          description: Tag color
                      required:
                        - id
                        - name
                        - color
                      description: Compact tag object
                    description: Associated tags
                  id:
                    type: string
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Short link UUID
                  organizationId:
                    type: string
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Organization UUID
                  isActive:
                    type: boolean
                    example: true
                    description: Whether link is active
                  qrCodeId:
                    type: string
                    nullable: true
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: QR code configuration UUID
                  domainId:
                    type: string
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Domain UUID
                  folderId:
                    type: string
                    nullable: true
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Folder UUID
                  slug:
                    type: string
                    example: summer-sale
                    description: Short link slug
                  originUrl:
                    type: string
                    format: uri
                    example: https://links.example.com/summer-sale
                    description: Complete short URL
                  expiresAt:
                    type: string
                    nullable: true
                    format: date-time
                    example: '2024-12-31T23:59:59Z'
                    description: Expiration timestamp
                  maxClicks:
                    type: number
                    nullable: true
                    example: 1000
                    description: Maximum click limit
                  currentClicks:
                    type: number
                    example: 247
                    description: Current click count
                    minimum: 0
                  hasPassword:
                    type: boolean
                    example: false
                    description: Whether link is password protected
                  cloaking:
                    type: boolean
                    example: false
                    description: Whether destination is hidden
                  destinationId:
                    type: string
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Destination configuration UUID
                  createdAt:
                    type: string
                    format: date-time
                    example: '2024-01-15T10:30:00Z'
                    description: Creation timestamp
                  updatedAt:
                    type: string
                    format: date-time
                    example: '2024-01-16T14:20:00Z'
                    description: Last update timestamp
                required:
                  - domain
                  - rules
                  - qrCode
                  - destination
                  - metaTags
                  - tags
                  - id
                  - organizationId
                  - isActive
                  - qrCodeId
                  - domainId
                  - folderId
                  - slug
                  - originUrl
                  - expiresAt
                  - maxClicks
                  - currentClicks
                  - hasPassword
                  - cloaking
                  - destinationId
                  - createdAt
                  - updatedAt
                description: Complete short link with all nested objects
        '403':
          description: >-
            Forbidden - Plan limit reached or  not available. Upgrade your plan
            to continue.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - PLAN_LIMIT_REACHED
                      - FEATURE_NOT_AVAILABLE
                    description: Error code for plan restrictions
                  message:
                    type: string
                    example: >-
                      You have reached the maximum number of domains (10) for
                      your plan
                    description: Description of the plan limitation
                required:
                  - code
                  - message
              example:
                code: PLAN_LIMIT_REACHED
                message: You have reached the maximum number of domains for your plan.
        '404':
          description: Domain not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                    description: Machine-readable error code
                  message:
                    type: string
                    example: The provided slug is already in use
                    description: Human-readable error message
                required:
                  - code
        '409':
          description: Slug already used
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                    description: Machine-readable error code
                  message:
                    type: string
                    example: The provided slug is already in use
                    description: Human-readable error message
                required:
                  - code
      security:
        - ApiKey: []
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API Key authentication for programmatic access.


        **How to use:**

        1. Create an API key from your dashboard settings

        2. Include the key in the `x-api-key` header with each request

        3. API keys have granular permissions (domains, shortLinks, files,
        stats, apiKeys)


        **Example:**

        ```

        curl -H "x-api-key: your-api-key-here"
        https://api.h0p.co/short-link/list

        ```


        **Types of API keys:**

        - **User keys**: Linked to your user account (one per organization)

        - **Bot keys**: Autonomous machine users (one per organization)


        **Security notes:**

        - Keep your API keys secure and never commit them to version control

        - API keys cannot access authentication endpoints (/auth/*)

        - Keys can be revoked at any time from the dashboard

````