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

# Get a lead's notification history

> The notification history of the lead's patient, the same list as the customer endpoint.
A lead that has no patient yet has no notifications and returns an empty list.



## OpenAPI

````yaml get /v1/leads/{id}/notifications
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/leads/{id}/notifications:
    get:
      tags:
        - Lead
        - LeadNotification
      summary: Get a lead's notification history
      description: >-
        The notification history of the lead's patient, the same list as the
        customer endpoint.

        A lead that has no patient yet has no notifications and returns an empty
        list.
      operationId: leadNotification.index
      parameters:
        - name: id
          in: path
          required: true
          description: The lead identifier
          schema:
            type: integer
        - name: type
          in: query
          description: Filter by notice kind.
          schema:
            anyOf:
              - $ref: '#/components/schemas/CustomerNotificationType'
              - type: 'null'
        - name: status
          in: query
          description: Filter by send status.
          schema:
            anyOf:
              - $ref: '#/components/schemas/CustomerNotificationStatus'
              - type: 'null'
        - name: channel_type
          in: query
          description: Filter by the channel type the notice went out on.
          schema:
            anyOf:
              - $ref: '#/components/schemas/ChannelType'
              - type: 'null'
        - name: created_at_from
          in: query
          description: Filter notices created at or after this timestamp (tenant timezone).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: created_at_to
          in: query
          description: >-
            Filter notices created at or before this timestamp (tenant
            timezone).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: sent_at_from
          in: query
          description: Filter notices sent at or after this timestamp (tenant timezone).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: sent_at_to
          in: query
          description: Filter notices sent at or before this timestamp (tenant timezone).
          schema:
            type:
              - string
              - 'null'
            format: date-time
        - name: sort_by
          in: query
          description: The field to sort by.
          schema:
            type:
              - string
              - 'null'
            enum:
              - created_at
              - sent_at
              - type
              - status
              - null
        - name: sort_order
          in: query
          description: The sort direction (asc or desc).
          schema:
            type:
              - string
              - 'null'
            enum:
              - asc
              - desc
              - null
        - name: per_page
          in: query
          description: The number of items per page.
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
            maximum: 100
        - name: page
          in: query
          description: The page number.
          schema:
            type:
              - integer
              - 'null'
            minimum: 1
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      responses:
        '200':
          description: Paginated set of `CustomerNotificationResource`
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/CustomerNotificationResource'
                  links:
                    type: object
                    properties:
                      first:
                        type:
                          - string
                          - 'null'
                      last:
                        type:
                          - string
                          - 'null'
                      prev:
                        type:
                          - string
                          - 'null'
                      next:
                        type:
                          - string
                          - 'null'
                    required:
                      - first
                      - last
                      - prev
                      - next
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                        minimum: 1
                      from:
                        type:
                          - integer
                          - 'null'
                        minimum: 1
                      last_page:
                        type: integer
                        minimum: 1
                      links:
                        type: array
                        description: Generated paginator links.
                        items:
                          type: object
                          properties:
                            url:
                              type:
                                - string
                                - 'null'
                            label:
                              type: string
                            active:
                              type: boolean
                          required:
                            - url
                            - label
                            - active
                      path:
                        type:
                          - string
                          - 'null'
                        description: Base path for paginator generated URLs.
                      per_page:
                        type: integer
                        description: Number of items shown per page.
                        minimum: 0
                      to:
                        type:
                          - integer
                          - 'null'
                        description: Number of the last item in the slice.
                        minimum: 1
                      total:
                        type: integer
                        description: Total number of items being paginated.
                        minimum: 0
                    required:
                      - current_page
                      - from
                      - last_page
                      - links
                      - path
                      - per_page
                      - to
                      - total
                required:
                  - data
                  - links
                  - meta
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                    const: RESOURCE_NOT_FOUND
                  message:
                    type: string
                  errors:
                    type: 'null'
                  data:
                    type: 'null'
                required:
                  - success
                  - error_code
                  - message
                  - errors
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
        '428':
          description: >-
            Mandatory setup is incomplete. Finish the setup wizard first;
            `data.next_step` names the step to continue with.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  error_code:
                    type: string
                    enum:
                      - SETUP_REQUIRED
                    examples:
                      - SETUP_REQUIRED
                  message:
                    type: string
                    examples:
                      - Complete the required setup steps to continue.
                  data:
                    type: object
                    properties:
                      next_step:
                        type:
                          - string
                          - 'null'
                        examples:
                          - clinic_info
                    required:
                      - next_step
                required:
                  - success
                  - error_code
                  - message
                  - data
components:
  schemas:
    CustomerNotificationType:
      type: string
      description: >
        The automated notices a patient receives from the clinic. Conversational
        auto-replies (media acknowledgements, form links, AI agent messages) are
        not notifications and are not recorded.
      enum:
        - appointment_created
        - appointment_updated
        - appointment_reminder
        - cancellation_follow_up
        - session_confirmation
        - reschedule_confirmation
        - ticket_resolved
        - blocked_notice
        - data_erasure_verification
      title: CustomerNotificationType
    CustomerNotificationStatus:
      type: string
      enum:
        - queued
        - sent
        - failed
      title: CustomerNotificationStatus
    ChannelType:
      type: string
      enum:
        - whatsapp
        - instagram
        - website
        - telegram
      title: ChannelType
    CustomerNotificationResource:
      type: object
      properties:
        id:
          type: integer
        customer_id:
          type:
            - integer
            - 'null'
        type:
          type: string
          description: >-
            The notice kind: `appointment_created`, `appointment_updated`,
            `appointment_reminder`, `cancellation_follow_up`,
            `session_confirmation`, `reschedule_confirmation`,
            `ticket_resolved`, `blocked_notice` or `data_erasure_verification`.
        template_name:
          type:
            - string
            - 'null'
          description: The message template the notice was rendered from.
        status:
          type: string
          description: '`queued` while the send is in progress, then `sent` or `failed`.'
        error:
          type:
            - string
            - 'null'
          description: >-
            Why the notice was not delivered; `null` unless `status` is
            `failed`.
        can_retry:
          type: string
          description: >-
            Whether the viewer may send the failed notice again (`POST
            /customer-notifications/{id}/retry`): the notice failed for a reason
            other than an erased patient or a block, it is not a block notice or
            an erasure verification, what it was about still stands (an
            upcoming, not cancelled appointment; a reminder that is approved and
            not expired; a ticket that is still resolved), and the viewer holds
            the permission and token scope that send this kind of notice.
            Whether a channel is reachable now is checked by the retry itself.
        channel_type:
          type:
            - string
            - 'null'
          description: >-
            The channel type the notice went out on (e.g. `whatsapp`); `null`
            when no channel could be chosen.
        channel:
          anyOf:
            - $ref: '#/components/schemas/RelatedChannelResource'
            - type: 'null'
        message:
          type:
            - string
            - 'null'
          description: >-
            The text the patient received, as plain text; `null` when the notice
            failed before it was rendered for a channel, or when the viewer may
            not read conversations (`View:Conversation` and the
            `conversations:read` scope).
        conversation_id:
          type:
            - integer
            - 'null'
        chat_log_id:
          type:
            - integer
            - 'null'
        appointment_id:
          type:
            - integer
            - 'null'
        appointment_reminder_id:
          type:
            - integer
            - 'null'
        ticket_id:
          type:
            - integer
            - 'null'
        sent_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the notice was handed to the channel; `null` unless `status` is
            `sent`.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - customer_id
        - type
        - template_name
        - status
        - error
        - can_retry
        - channel_type
        - message
        - conversation_id
        - chat_log_id
        - appointment_id
        - appointment_reminder_id
        - ticket_id
        - sent_at
        - created_at
      title: CustomerNotificationResource
    RelatedChannelResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          $ref: '#/components/schemas/ChannelType'
        address:
          type: string
      required:
        - id
        - name
        - type
        - address
      title: RelatedChannelResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.flextell.ai/oauth/authorize
          tokenUrl: https://app.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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