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

# Search Media

> Full-text search across images, videos, and files in an app, matching title, alt_text, description, and translations. The response also includes the attribute facets available on the matching media, with distinct-item counts and active flags reflecting `attributes=` filters. Per-template exclusion: when computing facet counts, filters on the same template_key are ignored while filters on other templates still apply (OR-within-template, AND-across-template).



## OpenAPI

````yaml /swagger/dam-api.json get /api/v1/{app_id}/media/search
openapi: 3.0.0
info:
  contact:
    email: support@enad.io
    name: API Support
  description: This is the swagger for Enads Digital Assets Management service
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  termsOfService: http://enad.io/terms
  title: Digital Assets Management
  version: '1.0'
servers:
  - url: //dam.enad.io
security: []
paths:
  /api/v1/{app_id}/media/search:
    get:
      tags:
        - Media
      summary: Search Media
      description: >-
        Full-text search across images, videos, and files in an app, matching
        title, alt_text, description, and translations. The response also
        includes the attribute facets available on the matching media, with
        distinct-item counts and active flags reflecting `attributes=` filters.
        Per-template exclusion: when computing facet counts, filters on the same
        template_key are ignored while filters on other templates still apply
        (OR-within-template, AND-across-template).
      parameters:
        - description: App ID
          in: path
          name: app_id
          required: true
          schema:
            type: string
        - description: Search query
          in: query
          name: q
          required: true
          schema:
            type: string
        - description: 'Page number (default: 1)'
          in: query
          name: page
          schema:
            type: integer
        - description: 'Items per page (default: 20, max: 100)'
          in: query
          name: per_page
          schema:
            type: integer
        - description: 'Filter by type: image, video, file, all (default: all)'
          in: query
          name: type
          schema:
            type: string
        - description: >-
            Sort field: name, created_at, updated_at, type, rank (default:
            created_at). 'rank' orders by full-text relevance against `q`.
          in: query
          name: sort_by
          schema:
            type: string
        - description: 'Sort order: asc, desc (default: desc)'
          in: query
          name: sort_order
          schema:
            type: string
        - description: >-
            Filter by attribute(s). Repeat the query parameter once per filter,
            each in the form template_key/attribute_key. Filters sharing the
            same template_key combine with OR; distinct template_keys combine
            with AND. Example:
            ?attributes=color/red&attributes=color/blue&attributes=size/large
          in: query
          name: attributes
          explode: true
          schema:
            items:
              type: string
            type: array
      responses:
        '200':
          description: Search results with facets
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkResponseMediaSearch'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    OkResponseMediaSearch:
      properties:
        data:
          items:
            $ref: '#/components/schemas/internal_pkg_webserver_v1.MediaItemResponse'
          type: array
        facets:
          items:
            $ref: '#/components/schemas/FolderFacetResponse'
          type: array
        pagination:
          $ref: '#/components/schemas/internal_pkg_webserver_v1.PageInfo'
        success:
          type: boolean
      type: object
    ErrorResponse:
      properties:
        details:
          items:
            type: string
          type: array
        error:
          type: string
      type: object
    internal_pkg_webserver_v1.MediaItemResponse:
      properties:
        alt_text:
          type: string
        attributes:
          items:
            $ref: '#/components/schemas/AttributeResponse'
          type: array
        blurhash:
          type: string
        copyright:
          type: string
        created_at:
          type: string
        custom:
          items:
            type: integer
          type: array
        description:
          type: string
        file_type:
          type: string
        folder:
          $ref: '#/components/schemas/FolderRef'
        id:
          type: string
        status:
          type: string
        title:
          type: string
        translations:
          additionalProperties:
            type: string
          type: object
        type:
          type: string
        updated_at:
          type: string
        url:
          type: string
        variants:
          items:
            $ref: '#/components/schemas/VideoVariantResponse'
          type: array
      type: object
    FolderFacetResponse:
      properties:
        active:
          type: boolean
        count:
          type: integer
        description:
          type: string
        filter_key:
          type: string
        key:
          type: string
        name:
          type: string
        template_key:
          type: string
        values:
          items:
            $ref: '#/components/schemas/FolderFacetValueResponse'
          type: array
      type: object
    internal_pkg_webserver_v1.PageInfo:
      properties:
        page:
          type: integer
        per_page:
          type: integer
        total_items:
          type: integer
        total_pages:
          type: integer
      type: object
    AttributeResponse:
      properties:
        description:
          type: string
        id:
          type: string
        key:
          type: string
        name:
          type: string
        values:
          additionalProperties:
            items:
              $ref: '#/components/schemas/AttributeValueResponse'
            type: array
          type: object
      type: object
    FolderRef:
      properties:
        id:
          type: string
        name:
          type: string
        public:
          type: boolean
        slug:
          type: string
      type: object
    VideoVariantResponse:
      properties:
        created_at:
          type: string
        format:
          type: string
        height:
          type: integer
        id:
          type: string
        updated_at:
          type: string
        url:
          type: string
        width:
          type: integer
      type: object
    FolderFacetValueResponse:
      properties:
        count:
          type: integer
        type:
          type: string
        value:
          type: string
      type: object
    AttributeValueResponse:
      properties:
        type:
          type: string
        value:
          type: string
      type: object

````