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

# Add competitor domain

> Add a competitor domain to a project. Duplicate domains are silently returned.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/competitors
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/competitors:
    post:
      tags:
        - Competitors
      summary: Add competitor domain
      description: >-
        Add a competitor domain to a project. Duplicate domains are silently
        returned.
      operationId: add_competitor_v1_projects__project_id__competitors_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddCompetitorRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_CompetitorResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    AddCompetitorRequest:
      properties:
        domain:
          type: string
          maxLength: 255
          minLength: 1
          title: Domain
          description: Competitor domain (e.g., 'competitor.com').
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
          description: Optional display name for the competitor.
      type: object
      required:
        - domain
      title: AddCompetitorRequest
      description: Request body for adding a competitor domain to a project.
    APIResponse_CompetitorResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/CompetitorResponse'
            - type: 'null'
      type: object
      title: APIResponse[CompetitorResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CompetitorResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        domain:
          type: string
          title: Domain
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        added_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Added By
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
      type: object
      required:
        - id
        - project_id
        - domain
        - created_at
        - updated_at
      title: CompetitorResponse
      description: A competitor domain record.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````