> ## 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.

# Create tag

> Create a new tag to label and filter short links. Tags help categorize links across multiple folders.



## OpenAPI

````yaml https://api.h0p.co/doc post /tag
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:
  /tag:
    post:
      tags:
        - Tag
      summary: Create tag
      description: >-
        Create a new tag to label and filter short links. Tags help categorize
        links across multiple folders.
      requestBody:
        required: true
        description: Tag name and optional color
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 30
                  example: social-media
                  description: Tag name
                color:
                  type: string
                  pattern: ^#[0-9A-Fa-f]{6}$
                  example: '#10B981'
                  description: Tag color (hex)
              required:
                - name
              description: Tag creation request
              example:
                name: social-media
                color: '#10B981'
      responses:
        '200':
          description: Tag successfully retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Tag UUID
                  organizationId:
                    type: string
                    format: uuid
                    example: 01933eb8-541f-7000-a9f4-e4eee80ff04e
                    description: Organization UUID
                  name:
                    type: string
                    minLength: 1
                    maxLength: 30
                    example: social-media
                    description: Tag name
                  color:
                    type: string
                    nullable: true
                    pattern: ^#[0-9A-Fa-f]{6}$
                    example: '#10B981'
                    description: Tag color (hex)
                  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:
                  - id
                  - organizationId
                  - name
                  - color
                  - createdAt
                  - updatedAt
                description: Complete tag object
        '403':
          description: Tag limit reached - Maximum tags for plan exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - TAG_LIMIT_REACHED
                    description: Tag limit error code
                  message:
                    type: string
                    example: >-
                      You have reached the maximum number of tags (50) for your
                      plan
                    description: Detailed error message
                required:
                  - code
                  - message
              example:
                code: TAG_LIMIT_REACHED
                message: You have reached the maximum number of tags (50) for your plan
        '409':
          description: >-
            Conflict - A resource with the specified unique identifier already
            exists
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - ALREADY_EXIST
                    description: >-
                      Error code indicating a resource with the same unique
                      identifier already exists
                required:
                  - code
              example:
                code: ALREADY_EXIST
      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

````