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

# Get user message history

> Get a user's campaign and user journey message history with cursor-based pagination.

> [!NOTE]
>
> **Cursor-based pagination**
>
> This API uses cursor-based pagination. To retrieve the next page, pass the response's `next_cursor` value as the `cursor` parameter in the next request. A `null` value for `next_cursor` indicates the last page.

> [!NOTE]
>
> **Common event names**
>
> | Event name | Description |
> | - | - |
> | `send_success` | Message sent successfully |
> | `send_failure` | Message send failed |
> | `push_click` | Push notification clicked |
> | `push_delivered` | Push notification delivered |
> | `in_app_message_show` | In-app popup displayed |
> | `in_web_message_show` | Web popup displayed |
> | `main_button_click` | Main button clicked |
> | `close_button_click` | Close button clicked |
> | `failover_text_message_send_success` | Failover text message sent successfully |
> | `failover_text_message_send_failure` | Failover text message send failed |
>
> Additional events may be available for each channel.

> [!WARNING]
>
> **Date filter requirements**
>
> When you use `start_date` and `end_date`, you must also pass the `timezone` parameter. Always use `start_date` and `end_date` together.


## OpenAPI

````yaml /en/api-reference/openapi.yaml get /projects/{projectId}/users/{userId}/message-history
openapi: 3.0.3
info:
  title: Notifly API
  version: 1.0.0
  contact:
    email: contact@notifly.tech
servers:
  - url: https://api.notifly.tech
    description: Notifly API server
security: []
tags:
  - name: catalog
    x-group: Catalogs
paths:
  /projects/{projectId}/users/{userId}/message-history:
    get:
      summary: get-user-message-history
      operationId: getUserMessageHistory
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{32}$
          description: Project ID as a 32-character hexadecimal string.
        - name: userId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
          description: The user's `external_user_id`.
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: Page size from 1 to 100. The default is 20.
        - name: cursor
          in: query
          required: false
          schema:
            type: string
          description: The `next_cursor` value from the previous response.
        - name: channel
          in: query
          required: false
          schema:
            type: string
            enum:
              - push-notification
              - web-push-notification
              - email
              - text-message
              - kakao-alimtalk
              - kakao-friendtalk
              - kakao-brand-message
              - line
              - in-app-message
              - in-web-message
              - webhook
          description: Filter by channel.
        - name: resource_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - campaign
              - user_journey
          description: Resource type. Use `campaign` or `user_journey`.
        - name: resource_id
          in: query
          required: false
          schema:
            type: string
          description: Resource ID. If you set this, also set `resource_type`.
        - name: start_date
          in: query
          required: false
          schema:
            type: string
            format: date
          description: >-
            Inclusive start date in `YYYY-MM-DD` format. Use with `end_date` and
            `timezone`.
          example: '2026-03-01'
        - name: end_date
          in: query
          required: false
          schema:
            type: string
            format: date
          description: >-
            Inclusive end date in `YYYY-MM-DD` format. Use with `start_date` and
            `timezone`.
          example: '2026-03-31'
        - name: timezone
          in: query
          required: false
          schema:
            type: string
          description: IANA time zone used to interpret dates, for example `Asia/Seoul`.
          example: Asia/Seoul
      responses:
        '200':
          description: Message history retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      message_history:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Record ID.
                            event_name:
                              type: string
                              description: Event name.
                            channel:
                              type: string
                              nullable: true
                              description: Channel.
                            resource_id:
                              type: string
                              nullable: true
                              description: Campaign ID or user journey ID.
                            sub_resource_id:
                              type: string
                              nullable: true
                              description: A/B test variant ID or user journey node ID.
                            resource_type:
                              type: string
                              nullable: true
                              enum:
                                - campaign
                                - user_journey
                              description: Resource type.
                            created_at:
                              type: string
                              format: date-time
                              description: Creation time in ISO 8601 format, in UTC.
                            updated_at:
                              type: string
                              format: date-time
                              description: Last update time in ISO 8601 format, in UTC.
                      next_cursor:
                        type: string
                        nullable: true
                        description: >-
                          Cursor for the next page. The value is `null` on the
                          last page.
                  error:
                    type: string
                    nullable: true
              example:
                data:
                  message_history:
                    - id: abc123
                      event_name: send_success
                      channel: push-notification
                      resource_id: camp_001
                      sub_resource_id: var_001
                      resource_type: campaign
                      created_at: '2026-03-30T12:00:00.000Z'
                      updated_at: '2026-03-30T12:00:00.000Z'
                    - id: def456
                      event_name: push_click
                      channel: push-notification
                      resource_id: camp_001
                      sub_resource_id: var_001
                      resource_type: campaign
                      created_at: '2026-03-30T12:05:00.000Z'
                      updated_at: '2026-03-30T12:05:00.000Z'
                  next_cursor: eyJjcmVhdGVkX2F0IjoiMjAyNi0wMy0zMFQxMjowNTowMC4wMDBaIn0=
                error: null
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    nullable: true
                  error:
                    type: string
              example:
                data: null
                error: Invalid project ID
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    nullable: true
                  error:
                    type: string
              example:
                data: null
                error: 'Unauthorized: Invalid Authorization Token'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    nullable: true
                  error:
                    type: string
              example:
                data: null
                error: 'Internal Server Error: some-error-message'
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Pass the token issued by `POST /authenticate` as a bearer token.

````

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