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

# Tail function logs

> Fetch invocation logs for a function. Logs are paginated via `nextToken`. Pass `startTime` / `endTime` (Unix epoch milliseconds) to bound the window, or `filterPattern` to filter messages.



## OpenAPI

````yaml /openapi.json get /v1/functions/{functionId}/logs
openapi: 3.0.3
info:
  title: Zavu Unified Messaging Layer API
  version: 0.2.0
  description: >
    Unified multi-channel messaging API for Zavu.


    Supported channels:

    - **SMS**: Simple text messages

    - **WhatsApp**: Rich messaging with media, buttons, lists, CTA URL buttons,
    and templates

    - **Telegram**: Bot messaging with text, media, and interactive elements

    - **Email**: Transactional emails via Amazon SES


    Design goals:

    - Simple `send()` entrypoint for developers

    - Project-level authentication via Bearer token

    - Support for all WhatsApp message types (text, image, video, audio,
    document, sticker, location, contact, buttons, list, cta_url, reaction,
    template)

    - If a non-text message type is sent, WhatsApp channel is used automatically

    - 24-hour WhatsApp conversation window enforcement

    - Universal `to` field accepts phone numbers (E.164), email addresses, or
    numeric chat IDs (Telegram/Instagram)
servers:
  - url: https://api.zavu.dev
security:
  - bearerAuth: []
paths:
  /v1/functions/{functionId}/logs:
    get:
      tags:
        - Functions
      summary: Tail function logs
      description: >-
        Fetch invocation logs for a function. Logs are paginated via
        `nextToken`. Pass `startTime` / `endTime` (Unix epoch milliseconds) to
        bound the window, or `filterPattern` to filter messages.
      operationId: tailFunctionLogs
      parameters:
        - $ref: '#/components/parameters/FunctionIdParam'
        - name: limit
          in: query
          schema:
            type: integer
            default: 100
            minimum: 1
            maximum: 1000
        - name: nextToken
          in: query
          schema:
            type: string
        - name: startTime
          in: query
          description: Start of the log window in Unix epoch milliseconds.
          schema:
            type: integer
            format: int64
        - name: endTime
          in: query
          description: End of the log window in Unix epoch milliseconds.
          schema:
            type: integer
            format: int64
        - name: filterPattern
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Log events.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FunctionLogsResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Function not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  parameters:
    FunctionIdParam:
      name: functionId
      in: path
      required: true
      description: Zavu Function ID.
      schema:
        type: string
  schemas:
    FunctionLogsResponse:
      type: object
      required:
        - events
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/FunctionLogEvent'
        nextToken:
          type: string
          nullable: true
          description: Pass to the next request to fetch the following page of logs.
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalid_request
        message:
          type: string
          example: Phone number is invalid
        details:
          type: object
          additionalProperties: true
    FunctionLogEvent:
      type: object
      required:
        - timestamp
        - message
      properties:
        timestamp:
          type: string
          format: date-time
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````