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

# Find similar entities

> Finds similar entities to the given query



## OpenAPI

````yaml /openapi/squad-api.json post /organisations/{orgId}/workspaces/{workspaceId}/similarity-search
openapi: 3.1.0
info:
  title: Squad API
  version: 4.8.0
  description: API for managing Squad resources
  contact:
    name: Squad Support
    url: https://www.meetsquad.ai/support
    email: help@meetsquad.ai
servers:
  - url: https://api.meetsquad.ai
    description: Production server
  - url: https://uat.api.meetsquad.ai
    description: Staging server
  - url: https://dev.api.meetsquad.ai
    description: Development server
security: []
tags:
  - name: Organisations
  - name: Workspaces
  - name: Goals
  - name: Opportunities
  - name: Solutions
  - name: Feedback
  - name: Submit Feedback
  - name: Insights
  - name: Knowledge
  - name: Metrics
  - name: Topics
  - name: Integrations
  - name: AI & Search
  - name: Onboarding
paths:
  /organisations/{orgId}/workspaces/{workspaceId}/similarity-search:
    post:
      tags:
        - AI & Search
      summary: Find similar entities
      description: Finds similar entities to the given query
      operationId: similaritySearch
      parameters:
        - in: path
          name: orgId
          schema:
            type: string
          required: true
          description: Organization ID
          example: a5f3c6e1-9d20-4f7b-8e31-d09a2b63c184
        - in: path
          name: workspaceId
          schema:
            type: string
          required: true
          description: Workspace ID
          example: c0e195d9-b918-4a3a-bd8b-f730361d044f
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  description: Query string
                  example: Number of tokens used
                  type: string
                filters:
                  description: List of Pinecone sources to search over
                  example:
                    - knowledge-base
                    - insights
                    - opportunities
                    - solutions
                  type: array
                  items:
                    type: string
                    enum:
                      - knowledge-base
                      - insights
                      - opportunities
                      - solutions
              required:
                - query
                - filters
      responses:
        '200':
          description: Similarity search completed successfully
          content:
            application/json:
              schema:
                description: Response containing a similarity search result
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SimilaritySearchResponse'
                required:
                  - data
                additionalProperties: false
        '400':
          description: Bad Request - Invalid input
          content:
            application/json:
              schema:
                description: >-
                  Bad Request - Invalid input parameters or missing required
                  fields
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: INVALID_REQUEST
                        type: string
                      description:
                        description: Human-readable error description
                        example: One or more fields are invalid
                        type: string
                      fields:
                        description: List of field names that are missing or invalid
                        example:
                          - title
                          - description
                        type: array
                        items:
                          type: string
                      validationErrors:
                        description: >-
                          Detailed validation error information for each invalid
                          field
                        example:
                          invalidFields:
                            title:
                              type: too_small
                              message: Title must be at least 3 characters long
                              path:
                                - title
                            deadline:
                              type: invalid_date
                              message: Deadline must be a valid date in the future
                              path:
                                - deadline
                        type: object
                        propertyNames:
                          type: string
                        additionalProperties: {}
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '401':
          description: Unauthorized - Authentication required
          content:
            application/json:
              schema:
                description: Unauthorized - Missing or invalid authentication token
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: UNAUTHORISED_ERROR
                        type: string
                      description:
                        description: Human-readable error description
                        example: User is unauthenticated
                        type: string
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                description: Forbidden - Insufficient permissions to access this resource
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: UNAUTHORISED_ERROR
                        type: string
                      description:
                        description: Human-readable error description
                        example: User is unauthorised
                        type: string
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                description: >-
                  Internal Server Error - An unexpected error occurred on the
                  server
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        description: Error code identifier
                        example: INTERNAL_SERVER_ERROR
                        type: string
                      description:
                        description: Human-readable error description
                        example: An unexpected error occurred on the server
                        type: string
                    required:
                      - code
                      - description
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
      security:
        - bearerAuth: []
components:
  schemas:
    SimilaritySearchResponse:
      description: Similarity search response data
      type: object
      properties:
        opportunities:
          description: Array of matched opportunities
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              score:
                type: number
              metadata:
                type: object
                properties:
                  nodeId:
                    type: string
                  content:
                    type: string
                required:
                  - nodeId
                additionalProperties: false
            required:
              - id
            additionalProperties: false
        knowledge:
          description: Array of matched knowledge items
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              score:
                type: number
              metadata:
                type: object
                properties:
                  id:
                    type: string
                  content:
                    type: string
                required:
                  - id
                additionalProperties: false
            required:
              - id
            additionalProperties: false
        insights:
          description: Array of matched insights items
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              score:
                type: number
              metadata:
                type: object
                properties:
                  nodeId:
                    type: string
                  insightId:
                    type: string
                  content:
                    type: string
                required:
                  - nodeId
                additionalProperties: false
            required:
              - id
            additionalProperties: false
        solutions:
          description: Array of matched solutions items
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              score:
                type: number
              metadata:
                type: object
                properties:
                  nodeId:
                    type: string
                  status:
                    description: Solution status
                    example: Backlog
                    type: string
                    enum:
                      - Backlog
                      - New
                      - Planned
                      - InDevelopment
                      - Complete
                      - Cancelled
                      - Live
                  content:
                    type: string
                required:
                  - nodeId
                  - status
                additionalProperties: false
            required:
              - id
            additionalProperties: false
        totalResults:
          description: Total number of results
          type: number
      required:
        - totalResults
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT authentication for organization-scoped endpoints.

````