> ## 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 a persisted keyword research job

> Enqueue a bulk keyword research job. The job is processed asynchronously by the Python worker. Poll the returned job ID to retrieve results once status transitions to 'completed'. Counts against keyword_lookups_daily quota.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/keywords/research
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}/keywords/research:
    post:
      tags:
        - Keywords
      summary: Start a persisted keyword research job
      description: >-
        Enqueue a bulk keyword research job. The job is processed asynchronously
        by the Python worker. Poll the returned job ID to retrieve results once
        status transitions to 'completed'. Counts against keyword_lookups_daily
        quota.
      operationId: start_keyword_research_v1_projects__project_id__keywords_research_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/StartKeywordResearchRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_KeywordResearchJobResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    StartKeywordResearchRequest:
      properties:
        research_type:
          type: string
          title: Research Type
          description: '''bulk'', ''suggestions'', or ''domain_keywords'''
        input_params:
          additionalProperties: true
          type: object
          title: Input Params
          description: keywords list, location_code, language_code, etc.
        refresh_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Refresh Id
          description: If provided, resets the existing job instead of creating a new one.
      type: object
      required:
        - research_type
        - input_params
      title: StartKeywordResearchRequest
      description: |-
        Request body for starting a persisted bulk keyword research job.

        Attributes:
            research_type: One of 'bulk', 'suggestions', or 'domain_keywords'.
            input_params: Payload forwarded to the worker — keywords list,
                location_code, language_code, domain, etc.
    APIResponse_KeywordResearchJobResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/KeywordResearchJobResponse'
            - type: 'null'
      type: object
      title: APIResponse[KeywordResearchJobResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KeywordResearchJobResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        org_id:
          type: string
          format: uuid
          title: Org Id
        project_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Project Id
        status:
          type: string
          title: Status
        research_type:
          type: string
          title: Research Type
        input_params:
          additionalProperties: true
          type: object
          title: Input Params
        results_data:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Results Data
        result_count:
          type: integer
          title: Result Count
          default: 0
        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
        - org_id
        - status
        - research_type
        - input_params
        - created_at
        - updated_at
      title: KeywordResearchJobResponse
      description: |-
        Full response model for a KeywordResearchJob record.

        Attributes:
            id: UUID of the job record.
            org_id: Organization this job belongs to.
            project_id: Optional project scope.
            status: Current lifecycle state (pending, processing, completed, failed).
            research_type: Type of research that was requested.
            input_params: Original request parameters passed to the worker.
            results_data: Keyword result rows once the job completes.
            result_count: Number of result rows returned.
            error_message: Error detail when status is 'failed'.
            completed_at: Timestamp when the job transitioned to completed/failed.
            created_by: UUID of the user who started the job.
            created_at: Record creation timestamp.
            updated_at: Record last-modified timestamp.
    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

````