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

# Start backlink gap analysis

> Start an async backlink gap analysis comparing your domain against up to 4 competitor domains. Results are persisted in the database. Poll GET /backlinks/gap/{gap_id} to track progress.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/backlinks/gap
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}/backlinks/gap:
    post:
      tags:
        - Backlink Analysis
      summary: Start backlink gap analysis
      description: >-
        Start an async backlink gap analysis comparing your domain against up to
        4 competitor domains. Results are persisted in the database. Poll GET
        /backlinks/gap/{gap_id} to track progress.
      operationId: start_gap_analysis_v1_projects__project_id__backlinks_gap_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/StartGapAnalysisRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_BacklinkGapResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    StartGapAnalysisRequest:
      properties:
        target_domain:
          type: string
          title: Target Domain
          description: Your domain to find link-building opportunities for.
        competitor_domains:
          items:
            type: string
          type: array
          maxItems: 4
          minItems: 1
          title: Competitor Domains
          description: List of 1-4 competitor domains to compare against.
      type: object
      required:
        - target_domain
        - competitor_domains
      title: StartGapAnalysisRequest
      description: Request body for starting a backlink gap analysis.
    APIResponse_BacklinkGapResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/BacklinkGapResponse'
            - type: 'null'
      type: object
      title: APIResponse[BacklinkGapResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BacklinkGapResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        project_id:
          type: string
          format: uuid
          title: Project Id
        target_domain:
          type: string
          title: Target Domain
        competitor_domains:
          items:
            type: string
          type: array
          title: Competitor Domains
        status:
          type: string
          title: Status
        results_data:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Results Data
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
        created_by:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Created 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
        - target_domain
        - competitor_domains
        - status
        - created_at
        - updated_at
      title: BacklinkGapResponse
      description: Backlink gap analysis result.
    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

````