> ## 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 WhatsApp channel's history sync settings and latest run



## OpenAPI

````yaml get /v1/channels/{id}/whatsapp/history-sync
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/channels/{id}/whatsapp/history-sync:
    get:
      tags:
        - ChannelWhatsappHistorySync
      summary: Get a WhatsApp channel's history sync settings and latest run
      operationId: channelWhatsappHistorySync.show
      parameters:
        - name: id
          in: path
          required: true
          description: The channel identifier
          schema:
            type: integer
        - 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: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      configured:
                        type: boolean
                      settings:
                        type: object
                        properties:
                          enabled:
                            type: boolean
                          period_days:
                            type: integer
                          contact_scope:
                            type: string
                          new_contact_type:
                            type: string
                          name_strategy:
                            type: string
                        required:
                          - enabled
                          - period_days
                          - contact_scope
                          - new_contact_type
                          - name_strategy
                      latest:
                        anyOf:
                          - $ref: '#/components/schemas/WhatsappHistorySyncResource'
                          - type: 'null'
                    required:
                      - configured
                      - settings
                      - latest
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    WhatsappHistorySyncResource:
      type: object
      properties:
        id:
          type: integer
        channel_id:
          type: integer
        trigger:
          $ref: '#/components/schemas/WhatsappHistorySyncTrigger'
        status:
          $ref: '#/components/schemas/WhatsappHistorySyncStatus'
        since:
          type:
            - string
            - 'null'
          format: date-time
        pass:
          type: integer
        progress_percent:
          type:
            - integer
            - 'null'
        provider_total:
          type:
            - integer
            - 'null'
        processed:
          type: integer
        imported:
          type: integer
        skipped:
          type: object
          properties:
            unknown_contact:
              type: integer
            deleted_contact:
              type: integer
            lid_unresolved:
              type: integer
            group:
              type: integer
            failed:
              type: integer
          required:
            - unknown_contact
            - deleted_contact
            - lid_unresolved
            - group
            - failed
        settings:
          type: object
          properties:
            enabled:
              type: boolean
            period_days:
              type: integer
            contact_scope:
              type: string
            new_contact_type:
              type: string
            name_strategy:
              type: string
          required:
            - enabled
            - period_days
            - contact_scope
            - new_contact_type
            - name_strategy
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        finished_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - channel_id
        - trigger
        - status
        - since
        - pass
        - progress_percent
        - provider_total
        - processed
        - imported
        - skipped
        - settings
        - started_at
        - finished_at
        - created_at
      title: WhatsappHistorySyncResource
    WhatsappHistorySyncTrigger:
      type: string
      description: >-
        Why a WhatsApp history sync started.

        | |

        |---|

        | `initial` <br/> The line was paired for the first time; the chosen
        period is copied. |

        | `reconnect` <br/> The line came back after being down; only the gap
        since it went down is copied. |

        | `manual` <br/> A user asked for it from the channel settings. |
      enum:
        - initial
        - reconnect
        - manual
      title: WhatsappHistorySyncTrigger
    WhatsappHistorySyncStatus:
      type: string
      description: |
        Where a WhatsApp history sync run stands.
      enum:
        - pending
        - running
        - completed
        - failed
        - cancelled
      title: WhatsappHistorySyncStatus
  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://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.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.