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

# Search a team

> Search a team's assets by what's seen, said, or written in them, and filter by metadata.



## OpenAPI

````yaml /api-reference/openapi.json post /search/run
openapi: 3.1.0
info:
  title: Aspect API
  description: Manage and search media in Aspect.
  version: 1.0.0
servers:
  - url: https://api.aspect.inc
security:
  - ApiKeyAuth: []
tags:
  - name: Users
  - name: API Keys
  - name: Workspaces
  - name: Teams
  - name: Directories
  - name: Assets
  - name: Attachments
  - name: Filesystem Items
  - name: Collections
  - name: Canvases
  - name: Comments
  - name: Search
  - name: Transcription
  - name: Metadata
  - name: Shares
  - name: Share Templates
  - name: Watermarks
paths:
  /search/run:
    post:
      tags:
        - Search
      summary: Search a team
      description: >-
        Search a team's assets by what's seen, said, or written in them, and
        filter by metadata.
      operationId: search
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SearchRequest:
      properties:
        team_id:
          type: string
          format: uuid
          title: Team ID
          description: ID of the team to search within
        spec:
          $ref: '#/components/schemas/UserSearchSpec'
          title: Spec
          description: >-
            What to search for and how to filter. Needs at least one signal or
            filter.
        limit:
          type: integer
          maximum: 100
          minimum: 1
          title: Limit
          description: Maximum number of assets to return.
          default: 50
        offset:
          type: integer
          minimum: 0
          title: Offset
          description: >-
            Number of matching assets to skip. Only the first 1000 matching
            assets are returned; a page past them is empty.
          default: 0
      additionalProperties: false
      type: object
      required:
        - team_id
        - spec
      title: SearchRequest
      description: API request schema for end-user team search.
    SearchResponse:
      properties:
        assets:
          items:
            $ref: '#/components/schemas/SearchAssetResponse'
          type: array
          title: Search Results
          description: >-
            Matching assets, best match first; a search with only filters sorts
            them by name.
        has_more:
          type: boolean
          title: Has More
          description: >-
            Whether more matching assets follow this page; a page can be short
            even when they do. To get them, send the same request with `offset`
            increased by `limit`.
      type: object
      required:
        - assets
        - has_more
      title: SearchResponse
      description: Top-level response for team search.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserSearchSpec:
      properties:
        signals:
          items:
            $ref: '#/components/schemas/LogicalSignalQuery'
          type: array
          title: Signals
          description: Text queries to run, each against one kind of content
        filters:
          items:
            $ref: '#/components/schemas/Filter'
          type: array
          title: Filters
          description: Filters to apply to search results
      additionalProperties: false
      type: object
      required:
        - signals
      title: UserSearchSpec
      description: What to search for and how to filter.
    SearchAssetResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        type:
          $ref: '#/components/schemas/AssetType'
          description: Type of the asset (video, image, etc)
        name:
          type: string
          title: Name
        size_bytes:
          type: integer
          title: Size Bytes
        media:
          $ref: '#/components/schemas/AssetMedia'
          description: >-
            Intrinsic media properties (dimensions, duration, frame rate,
            timecode, page count)
        mime_type:
          type: string
          title: Mime Type
        is_uploaded:
          type: boolean
          title: Is Uploaded
        is_generated:
          type: boolean
          title: Is Generated
          description: Whether this asset was produced by the AI generation pipeline
          default: false
        workspace_id:
          type: string
          format: uuid
          title: Workspace Id
          description: ID of the workspace this asset belongs to
        team_id:
          type: string
          format: uuid
          title: Team Id
          description: ID of the team this asset belongs to
        parent_id:
          type: string
          format: uuid
          title: Parent Id
          description: ID of the parent resource (directory or team)
        comment_count:
          type: integer
          title: Comment Count
          description: Total number of visible comments on this asset, including replies
        created_by_user_id:
          type: string
          format: uuid
          title: Created By User Id
          description: ID of the user that created the asset
        version_stack_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Version Stack Id
          description: Version stack ID. Null if the asset isn't in a stack.
        version_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Version Number
          description: >-
            Position in the version stack, starting at 1. Null if the asset
            isn't in a stack.
        is_top_version:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Top Version
          description: >-
            True for the top version of a stack. Null if the asset isn't in a
            stack.
        manifest_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Manifest Id
          description: >-
            ID of the asset's current file content. It changes whenever the
            content changes. Null when the asset has no content yet.
        created:
          type: string
          format: date-time
          title: Created
        updated:
          type: string
          format: date-time
          title: Updated
        content_modified_at:
          type: string
          format: date-time
          title: Content Modified At
          description: >-
            When the asset's file content last changed. Renames and metadata
            edits don't change it.
        search:
          $ref: '#/components/schemas/SearchAssetMetadata'
          title: Search
          description: How the asset matched the search
      type: object
      required:
        - id
        - type
        - name
        - size_bytes
        - mime_type
        - is_uploaded
        - workspace_id
        - team_id
        - parent_id
        - comment_count
        - created_by_user_id
        - created
        - updated
        - content_modified_at
        - search
      title: SearchAssetResponse
      description: An asset that matched the search, with the match details in `search`.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    LogicalSignalQuery:
      properties:
        signal:
          $ref: '#/components/schemas/LogicalSignalType'
          title: Signal
          description: User-facing logical signal type to search
        query:
          type: string
          title: Query
          description: Text query for this logical signal type
      additionalProperties: false
      type: object
      required:
        - signal
        - query
      title: LogicalSignalQuery
      description: 'One search signal: what to look for and where.'
    Filter:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Attribute ID from `GET /metadata/attributes`.
        clause:
          $ref: '#/components/schemas/FilterClause'
          description: How to compare the attribute's value with `values`.
        values:
          items: {}
          type: array
          title: Values
          description: >-
            Values to compare with, always a list. Leave it empty for `exists`,
            `not_exists`, `is_true`, and `is_false`. Select attributes take
            option IDs, ID types take IDs, and `datetime` takes ISO 8601
            strings.
      type: object
      required:
        - id
        - clause
      title: Filter
      description: A condition on one attribute's value.
    AssetType:
      type: string
      enum:
        - video
        - image
        - audio
        - document
        - vector
        - other
      title: AssetType
    AssetMedia:
      properties:
        width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Width
          description: Pixel width for visual assets. Null when unknown.
        height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Height
          description: Pixel height for visual assets. Null when unknown.
        duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration
          description: >-
            Duration in seconds for time-based assets. Null for assets without a
            duration.
        frame_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Frame Rate
          description: Frames per second for video assets. Null for non-video assets.
        timecode:
          anyOf:
            - type: string
            - type: 'null'
          title: Timecode
          description: >-
            SMPTE start timecode, such as `01:00:00:00` (`01:00:00;00` for
            drop-frame). Null when the file has none.
        page_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page Count
          description: Number of pages for document assets. Null for non-document assets.
      type: object
      title: AssetMedia
      description: Intrinsic media properties extracted from the asset's content.
    SearchAssetMetadata:
      properties:
        moments:
          items:
            oneOf:
              - $ref: '#/components/schemas/VisualSearchMoment'
              - $ref: '#/components/schemas/TranscriptSearchMoment'
              - $ref: '#/components/schemas/DocumentSearchMoment'
              - $ref: '#/components/schemas/FilenameSearchMoment'
            discriminator:
              propertyName: kind
              mapping:
                document: '#/components/schemas/DocumentSearchMoment'
                filename: '#/components/schemas/FilenameSearchMoment'
                transcript: '#/components/schemas/TranscriptSearchMoment'
                visual: '#/components/schemas/VisualSearchMoment'
          type: array
          title: Moments
          description: Where in the asset the search matched
        confidence:
          $ref: '#/components/schemas/ConfidenceRating'
          title: Confidence
          description: How strong the asset's best match is
      type: object
      required:
        - confidence
      title: SearchAssetMetadata
      description: How an asset matched the search.
    LogicalSignalType:
      type: string
      enum:
        - visual
        - transcript
        - document
        - filename
      title: LogicalSignalType
      description: |-
        Which content a search signal queries.

        - `visual`: What's seen.
        - `transcript`: What's said.
        - `document`: Text in documents.
        - `filename`: The file name.
    FilterClause:
      type: string
      enum:
        - eq
        - neq
        - gt
        - lt
        - gte
        - lte
        - contains
        - not_contains
        - starts_with
        - ends_with
        - includes
        - not_includes
        - exists
        - not_exists
        - is_true
        - is_false
      title: FilterClause
      description: >-
        How a filter compares an attribute's value. Each clause works only with
        the data types listed.


        - `eq`: Equals one of the values. `string` (ignores case), `integer`,
        `float`, `datetime`, `single_select`, `directory_id` (assets directly in
        the directory).

        - `neq`: Equals none of the values. Same types as `eq`.

        - `gt`: Greater than the value. `integer`, `float`, `datetime`.

        - `lt`: Less than the value. `integer`, `float`, `datetime`.

        - `gte`: Greater than or equal to the value. `integer`, `float`,
        `datetime`.

        - `lte`: Less than or equal to the value. `integer`, `float`,
        `datetime`.

        - `contains`: Contains one of the values, ignoring case. `string`.

        - `not_contains`: Contains none of the values, ignoring case. `string`.

        - `starts_with`: Starts with one of the values, ignoring case. `string`.

        - `ends_with`: Ends with one of the values, ignoring case. `string`.

        - `includes`: Has any of the values. `multi_select`, `user_id`,
        `person_id`, `object_id`, `directory_id` (assets anywhere under the
        directory).

        - `not_includes`: Has none of the values. Same types as `includes`.

        - `exists`: Has a value. Every type except `boolean` and `directory_id`.

        - `not_exists`: Has no value. Every type except `boolean` and
        `directory_id`.

        - `is_true`: Is true. `boolean`.

        - `is_false`: Is false. `boolean`.


        `neq`, `not_contains`, `not_includes`, and `is_false` also match assets
        with no value.
    VisualSearchMoment:
      properties:
        kind:
          type: string
          const: visual
          title: Kind
          description: What matched
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: The query that matched
        start_time:
          type: number
          title: Start Time
          description: Start of the match in seconds
        end_time:
          type: number
          title: End Time
          description: End of the match in seconds
      type: object
      required:
        - kind
        - start_time
        - end_time
      title: VisualSearchMoment
      description: A stretch of video or an image whose picture matched.
    TranscriptSearchMoment:
      properties:
        kind:
          type: string
          const: transcript
          title: Kind
          description: What matched
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: The query that matched
        start_time:
          type: number
          title: Start Time
          description: Start of the match in seconds
        end_time:
          type: number
          title: End Time
          description: End of the match in seconds
        evidence_text:
          anyOf:
            - $ref: '#/components/schemas/SearchEvidenceText'
            - type: 'null'
          title: Evidence Text
          description: The matching speech; null when no excerpt was found
      type: object
      required:
        - kind
        - start_time
        - end_time
      title: TranscriptSearchMoment
      description: A stretch of video or audio whose speech matched.
    DocumentSearchMoment:
      properties:
        kind:
          type: string
          const: document
          title: Kind
          description: What matched
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: The query that matched
        page:
          type: integer
          title: Page
          description: Page number, starting at 1
        evidence_text:
          anyOf:
            - $ref: '#/components/schemas/SearchEvidenceText'
            - type: 'null'
          title: Evidence Text
          description: The matching text; null when no excerpt was found
      type: object
      required:
        - kind
        - page
      title: DocumentSearchMoment
      description: A document page whose text matched.
    FilenameSearchMoment:
      properties:
        kind:
          type: string
          const: filename
          title: Kind
          description: What matched
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: The query that matched
      type: object
      required:
        - kind
      title: FilenameSearchMoment
      description: The asset's file name matched, so the match covers the whole asset.
    ConfidenceRating:
      type: string
      enum:
        - unknown
        - low
        - medium
        - high
      title: ConfidenceRating
      description: How strong a search match is.
    SearchEvidenceText:
      properties:
        excerpt:
          type: string
          title: Excerpt
          description: A short excerpt of the matching text
      type: object
      required:
        - excerpt
      title: SearchEvidenceText
      description: Text that matched the search.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Aspect API key (sk_...) in Authorization header. 'Bearer ' optional.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.