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

# Receive images

> Retrieves images sent to an assistant since a given timestamp. Optionally filters by sender. The receiver's token is passed in the body.



## OpenAPI

````yaml api-reference/openapi.json post /receive-image
openapi: 3.0.0
info:
  title: Cati Main Server API
  version: 1.0.0
  description: >-
    API for managing Cati assistant users, app users, contacts, media,
    notifications and preferences.
servers:
  - url: /
security: []
paths:
  /receive-image:
    post:
      tags:
        - Media
      summary: Receive images (for assistant device)
      description: >-
        Retrieves images sent to an assistant since a given timestamp.
        Optionally filters by sender. The receiver's token is passed in the
        body.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReceiveMediaRequest'
      responses:
        '200':
          description: List of received images.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MediaItem'
        '401':
          description: Token not found, invalid, or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Database or server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ReceiveMediaRequest:
      type: object
      required:
        - token
        - from_timestamp
      properties:
        token:
          type: string
          description: JWT Access Token of the receiver (assistant user).
          example: eyJ...
        from_timestamp:
          type: string
          format: date-time
          description: >-
            Timestamp (UTC) from which to retrieve new media (YYYY-MM-DD
            HH:MM:SS).
          example: '2024-01-01 00:00:00'
        sender_user_id:
          type: integer
          nullable: true
          description: 'Optional: Filter media by a specific sender user ID.'
          example: 201
    MediaItem:
      type: object
      properties:
        media_id:
          type: integer
          example: 1
        sender_id:
          type: integer
          example: 201
        receiver_id:
          type: integer
          nullable: true
          example: 101
        media_path:
          type: string
          example: http://example.com/media/image1.jpg
        sent_at:
          type: string
          format: date-time
          description: Local time (Europe/Madrid).
          example: '2024-06-21 15:30:00'
        sender_name:
          type: string
          example: Mobile User One
        sender_image:
          type: string
          nullable: true
          example: http://example.com/mobile_user_image.jpg
        type:
          type: string
          enum:
            - audio
            - image
          example: image
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          example: error
        message:
          type: string
          example: Database connection failed

````