# Create a New Tag

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /tags/create:
    post:
      summary: Create a New Tag
      deprecated: false
      description: >
        Creates a new tag in the specified workspace. Tags are used to organize
        and categorize email accounts and campaigns.


        **Required Fields:**

        - `name`: Display name for the tag (1-100 characters)

        - `color`: Hex color code for visual identification (#FF5733 or #F57)

        - `description`: Optional description of the tag's purpose

        **Note:** Tag names are case-insensitive and must be unique within the
        workspace.
      tags:
        - Tags
        - Tags
      parameters:
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - workspace_id
                - name
                - color
              properties:
                workspace_id:
                  type: string
                  pattern: ^[0-9a-fA-F]{24}$
                  description: workspace identifier
                  examples:
                    - 507f1f77bcf86cd799439011
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Display name for the tag
                  examples:
                    - VIP Clients
                color:
                  type: string
                  pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
                  description: Hex color code for the tag (3 or 6 digits)
                  examples:
                    - '#FF5733'
                description:
                  type: string
                  maxLength: 500
                  description: Optional description of the tag's purpose
                  examples:
                    - High-value clients requiring special attention
              x-apidog-orders:
                - workspace_id
                - name
                - color
                - description
            examples:
              vip_clients:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  name: PlusVibe DFY
                  color: '#FF5733'
                  description: Best setup for deliverability
                summary: Create VIP Clients tag
                description: Tag for identifying high-value clients
              campaign_tag:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  name: Q4 2024 Campaign
                  color: '#3498DB'
                  description: Email accounts dedicated to Q4 marketing campaign
                summary: Create campaign tag
                description: Tag for organizing specific campaign
              simple_tag:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  name: High Priority
                  color: '#E74C3C'
                  description: ''
                summary: Create simple tag
                description: Basic tag with minimal information
      responses:
        '200':
          description: Tag created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  tag_id:
                    type: string
                    description: The ID of the added tag
                required:
                  - status
                  - tag_id
                x-apidog-orders:
                  - status
                  - tag_id
              example:
                status: success
                tag_id: 68c2ad7ea8b1ea94b4b08818
          headers: {}
          x-apidog-name: OK
        '400':
          description: Bad Request - Validation Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  message:
                    type: string
                    examples:
                      - Validation Error
                  error:
                    type: string
                    examples:
                      - Validation Error
                  errors:
                    type: array
                    items:
                      type: string
                    description: Array of specific validation error messages
                x-apidog-orders:
                  - success
                  - message
                  - error
                  - errors
              examples:
                '2':
                  summary: Missing required fields
                  value:
                    success: false
                    message: Validation Error
                    error: Validation Error
                    errors:
                      - '"name" is required'
                      - '"color" is required'
                '3':
                  summary: Invalid hex color format
                  value:
                    success: false
                    message: Validation Error
                    error: Validation Error
                    errors:
                      - >-
                        Color must be a valid hex color code (e.g., #FF5733 or
                        #F57)
                '4':
                  summary: Tag name already exists
                  value:
                    success: false
                    message: Tag already exists, please try a new name.
                    error: Tag already exists, please try a new name.
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  message:
                    type: string
                    examples:
                      - Unauthorized access
                  error:
                    type: string
                    examples:
                      - Invalid API key
                x-apidog-orders:
                  - success
                  - message
                  - error
          headers: {}
          x-apidog-name: Unauthorized
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  message:
                    type: string
                    examples:
                      - Internal server error
                  error:
                    type: string
                    examples:
                      - Database connection failed
                x-apidog-orders:
                  - success
                  - message
                  - error
          headers: {}
          x-apidog-name: Server Error
      security: []
      x-apidog-folder: Tags
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-21404673-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
