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

# Search for Platform Entities

> This endpoint allows for a powerful, full-text search across all indexed entities within a user's tenancy scope. By default, it searches all resources within the user's organization. You can narrow the scope to a specific workspace or apply fine-grained filters based on entity type and creation date to pinpoint the exact information you need.



## OpenAPI

````yaml /api/en/search.yaml get /search
openapi: 3.0.3
info:
  title: Altostrat Search API
  version: 1.0.0
  description: >-
    The Altostrat Search API provides a unified, multi-tenant interface for
    querying indexed entities and documentation across the entire SDX platform.

    It acts as a centralized discovery layer, allowing developers to find any
    resource—from network configurations and automation scripts to support
    tickets and user guides—without needing to query individual microservices.

    This API allows you to programmatically manage:

    - **Entity Search:** Query for any indexed resource within your organization
    or a specific workspace. Results are tenant-aware, ensuring data isolation.

    - **Documentation Search:** Perform targeted searches against Altostrat's
    official developer documentation and API reference guides.

    Developers use this API to build powerful, context-aware search experiences
    directly into their applications and integrations, accelerating resource
    discovery for end-users.
servers:
  - url: https://v1.api.altostrat.io
    description: Altostrat Production API Server
security: []
tags:
  - name: Entity Search
    description: >-
      Endpoints for searching platform-wide entities like devices,
      configurations, and documents.
  - name: Documentation Search
    description: >-
      Endpoints for searching the official Altostrat developer documentation and
      API reference.
paths:
  /search:
    get:
      tags:
        - Entity Search
      summary: Search for Platform Entities
      description: >-
        This endpoint allows for a powerful, full-text search across all indexed
        entities within a user's tenancy scope. By default, it searches all
        resources within the user's organization. You can narrow the scope to a
        specific workspace or apply fine-grained filters based on entity type
        and creation date to pinpoint the exact information you need.
      operationId: searchEntities
      parameters:
        - name: q
          in: query
          required: true
          description: >-
            The primary search query string. The search engine performs a fuzzy
            search across entity names, descriptions, and key metadata fields.
          schema:
            type: string
            minLength: 1
            maxLength: 255
          example: alpha project
        - name: workspace_id
          in: query
          required: false
          description: >-
            The unique identifier for a Workspace (`ws_...`). Specifying this ID
            scopes the search exclusively to entities within that workspace,
            overriding the broader organization-level scope. Cannot be used with
            `org_id`.
          schema:
            type: string
          example: ws_sz47boIRd2XfDRk3G0
        - name: org_id
          in: query
          required: false
          description: >-
            The unique identifier for an Organization (`org_...`). Allows an
            administrator to override the default search scope from their own
            organization to another. Cannot be used with `workspace_id`.
          schema:
            type: string
          example: org_MyoAolMD2GACSFi8
        - name: types
          in: query
          required: false
          description: >-
            An array of entity types to filter the search results. Only entities
            matching one of the provided types will be returned.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
          example:
            - document
            - spreadsheet
        - name: created_from
          in: query
          required: false
          description: >-
            The start date for a date-range filter on the entity's creation
            timestamp. Formatted as YYYY-MM-DD.
          schema:
            type: string
            format: date
          example: '2025-01-01'
        - name: created_to
          in: query
          required: false
          description: >-
            The end date for a date-range filter on the entity's creation
            timestamp. Formatted as YYYY-MM-DD.
          schema:
            type: string
            format: date
          example: '2025-12-31'
        - name: page
          in: query
          required: false
          description: The page number of the result set to retrieve.
          schema:
            type: integer
            default: 1
            minimum: 1
          example: 2
      responses:
        '200':
          description: A paginated list of matching entities.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedEntitySearchResponse'
        '400':
          description: >-
            Bad Request - The request was malformed or a required parameter was
            missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - The request is missing a valid authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable Entity - The request was well-formed but contained
            semantic errors (e.g., invalid date format).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error - Something went wrong on our end.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    PaginatedEntitySearchResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/EntitySearchResult'
        links:
          $ref: '#/components/schemas/PaginationLinks'
        meta:
          $ref: '#/components/schemas/PaginationMeta'
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_missing
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'q' parameter is required for this request.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_missing
    EntitySearchResult:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the indexed entity.
          example: doc_1
        name:
          type: string
          description: The human-readable name of the entity.
          example: Project Alpha Documentation
        type:
          type: string
          description: The category or type of the entity.
          example: document
        description:
          type: string
          description: A brief summary or description of the entity.
          example: >-
            Comprehensive documentation for the Alpha project including API
            specifications and user guides.
        org_id:
          type: string
          description: >-
            The unique identifier for the Organization (`org_...`) that owns
            this entity.
          example: org_MyoAolMD2GACSFi8
        workspace_id:
          type: string
          description: >-
            The unique identifier for the Workspace (`ws_...`) this entity
            belongs to.
          example: ws_sz47boIRd2XfDRk3G0
        metadata:
          type: object
          description: >-
            A flexible object containing key-value pairs of additional,
            non-standard data associated with the entity at the time of
            indexing. The contents of this object are also searchable.
          example:
            category: technical
            resource_id": res_doc_001
        created_at:
          type: string
          format: date-time
          description: The timestamp when the entity was created, in ISO 8601 format.
          example: '2025-11-04T08:36:48.000000Z'
        updated_at:
          type: string
          format: date-time
          description: The timestamp when the entity was last updated, in ISO 8601 format.
          example: '2025-11-07T08:36:48.000000Z'
        relevance_percentage:
          type: integer
          description: >-
            A normalized score from 0 to 100 indicating how relevant the result
            is to the query, with 100 being the most relevant result in the set.
            Useful for ranking and displaying results.
          example: 95
        scout_score:
          type: number
          format: float
          description: >-
            The raw relevance score returned by the search engine. Higher is
            better.
          example: 123456789
    PaginationLinks:
      type: object
      properties:
        first:
          type: string
          format: uri
          description: The URL for the first page of results.
          example: https://v1.api.altostrat.io/search?page=1
        last:
          type: string
          format: uri
          description: The URL for the last page of results.
          example: https://v1.api.altostrat.io/search?page=5
        prev:
          type: string
          format: uri
          nullable: true
          description: >-
            The URL for the previous page of results, or null if this is the
            first page.
          example: null
        next:
          type: string
          format: uri
          nullable: true
          description: >-
            The URL for the next page of results, or null if this is the last
            page.
          example: https://v1.api.altostrat.io/search?page=2
    PaginationMeta:
      type: object
      properties:
        current_page:
          type: integer
          description: The current page number.
          example: 1
        from:
          type: integer
          description: The result number of the first item on the current page.
          example: 1
        last_page:
          type: integer
          description: The last available page number.
          example: 5
        path:
          type: string
          format: uri
          description: The base URL for the resource.
          example: https://v1.api.altostrat.io/search
        per_page:
          type: integer
          description: The number of items per page.
          example: 20
        to:
          type: integer
          description: The result number of the last item on the current page.
          example: 20
        total:
          type: integer
          description: The total number of matching items.
          example: 95
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Enter your bearer token in the format: Bearer {token}'

````