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

# Analyze a brand or confirm a new project

> Two-step onboarding over Server-Sent Events. `action: analyze` researches a URL and proposes competitors and topics. `action: confirm` creates the project and generates prompts.

The response stream emits `data:` lines with progress events followed by a final event with `status: "complete"` and the payload.



## OpenAPI

````yaml /api-reference/openapi.json post /onboard
openapi: 3.1.0
info:
  title: OpenLens API
  version: 1.4.0
  description: >-
    Public REST API for OpenLens. Onboard clients, run scans across the major AI
    platforms, read visibility metrics, and download client-ready reports. Beta
    — endpoints may evolve before GA.
  contact:
    name: OpenLens support
    email: contact@aibread.com
servers:
  - url: https://openlens.com/api
security:
  - bearerAuth: []
tags:
  - name: Onboarding
  - name: Runs
  - name: Metrics
  - name: Citations
  - name: Deliverables
  - name: Resources
  - name: Account
  - name: Workstreams
paths:
  /onboard:
    post:
      tags:
        - Onboarding
      summary: Analyze a brand or confirm a new project
      description: >-
        Two-step onboarding over Server-Sent Events. `action: analyze`
        researches a URL and proposes competitors and topics. `action: confirm`
        creates the project and generates prompts.


        The response stream emits `data:` lines with progress events followed by
        a final event with `status: "complete"` and the payload.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - analyze
                    url:
                      type: string
                      format: uri
                  required:
                    - action
                    - url
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - confirm
                    brandName:
                      type: string
                    url:
                      type: string
                      format: uri
                    industryType:
                      type: string
                      enum:
                        - saas
                        - media
                        - agency
                        - ecommerce
                        - other
                    location:
                      type:
                        - string
                        - 'null'
                    languages:
                      type:
                        - string
                        - 'null'
                    competitors:
                      type: array
                      items:
                        oneOf:
                          - type: string
                          - type: object
                            properties:
                              name:
                                type: string
                              url:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - name
                    topicList:
                      type: array
                      items:
                        oneOf:
                          - type: string
                          - type: object
                            properties:
                              name:
                                type: string
                              category:
                                type:
                                  - string
                                  - 'null'
                            required:
                              - name
                    activePlatforms:
                      type: array
                      items:
                        type: string
                        enum:
                          - chatgpt
                          - chatgpt_app
                          - claude
                          - gemini
                          - gemini_app
                          - grok_app
                          - grok_api
                          - perplexity
                          - perplexity_app
                          - google_app
                          - deepseek
                        description: >-
                          LLM platform identifier. Newer scraper-backed ids end
                          in `_app`; `chatgpt`, `perplexity`, and `gemini` are
                          legacy and not returned by current runs.
                    promptsPerTopic:
                      type: integer
                      minimum: 1
                      maximum: 30
                    projectId:
                      type: string
                      format: uuid
                      description: Reuse an existing project instead of creating one.
                    promptAttributes:
                      type: array
                      items:
                        type: string
                    generateBrandedPrompts:
                      type: boolean
                  required:
                    - action
                    - brandName
      responses:
        '200':
          description: >-
            Server-Sent Events stream. The final event has `status: "complete"`
            with the result payload (analyze: brand/competitor/topic
            suggestions; confirm: `{ projectId }`).
          content:
            text/event-stream:
              schema:
                type: string
        '400':
          description: Missing or invalid request parameter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Monthly included API calls for your tier are used up (code
            `USAGE_LIMIT`). Body includes a `limit` object — `{ limitHit,
            currentTier, targetTier, feature, cap, used, resetAt }` — describing
            the cap and the upgrade that lifts it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Resource not found or not owned by your account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limit, project cap, or daily quota hit. Body includes a `code`
            field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error. Retry; if persistent, contact support.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
          description: Stable machine code for programmatic handling, when applicable.
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Clerk API key. Create one from your account settings under API Keys.

````