---
title: "Search media by tags (optionally scoped to an entity)"
method: GET
path: "/media/search"
tags: ["Media"]
---

# Search media by tags (optionally scoped to an entity)

`GET /media/search`

## Request

- Base URL: `https://api.faireplace.com/api`
- URL: `https://api.faireplace.com/api/media/search`
- Auth: HTTP bearer

Searches on tags (TEXT[] + GIN). `match_all=true` (default) requires that all tags match.
Can be restricted to an entity.

## Query parameters

- `tags` string
- `match_all` boolean
- `entity_type` 'PLACE' | 'ESTATE' | 'ROOM' | 'EQUIPMENT' | 'LEASE' | 'OWNER' | 'CONTACT' | 'LESSEE' | 'CONDITION_REPORT' | 'LEASE_NOTICE' | 'MANDATE': Business entity type supported for media
- `entity_id` string, uuid

## Response `200`

OK

- Media[]
  - `id` string, uuid, nullable
  - `url` string, nullable
  - `media_type` string, nullable: MIME type (e.g. application/pdf, image/jpeg)
  - `file_size` integer, nullable
  - `security_level` 'STANDARD' | 'SENSITIVE' | 'CRITICAL': Security/encryption level. CRITICAL and SENSITIVE may trigger SSE-C encrypted storage; STANDARD is unencrypted.
  - `encryption_key_id` string, nullable: SSE-C key identifier if the media is encrypted (secure mode)
  - `checksum` string, nullable: SHA-256 of the source content for integrity verification
  - `tags` string[], nullable: Tags normalized to lowercase; max 32 tags; each tag <= 64 chars, [a-z0-9_-]
  - `roles` MediaRole[], nullable: Roles associated with this media for different entities
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable

## Other responses

- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/faireplace/apis/faireplace-property-management-api.md) · [All operations](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/revisions/69de39762919?raw)
