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

# Mark Chat Read

> Mark a regular WhatsApp chat as read in Timelines and on WhatsApp, the same way opening the chat does.



## OpenAPI

````yaml post /chats/{chat_id}/read
openapi: 3.0.3
info:
  title: Timelines Public API
  description: >
    # Timelines Public API


    _Some API calls may utilize message sending quota or be subject to message
    sending rate limits as described below._


    ### Credit Utilization 
      - Sending a message via API consumes 1 credit from message sending quota.
      - Sending a message with non-empty text and attachment consumes 2 credits from message sending quota.
      - If a message cannot be sent (invalid or not connected to WhatsApp number, WhatsApp server error), message sending quota will be restored (usually within a couple of hours).
    ### Message sending rate
      - Messages will be sent with random delay of about 2 seconds between each two messages (to avoid WhatsApp spam detection mechanisms). Contact support@timelines.ai if you want to modify delay for your workspace (available on Business plan only).
      - If you exceed message sending frequency, messages be queued and sent out with delay. Each queued message will consume a message sending credit, so the number of queued messages cannot exceed the available quota.
      
    ### Authorization:
      - Copy API token from [Public API page](https://app.timelines.ai/integrations/api/) in your TimelinesAI account.
      - Put the token in *Authorization* header of request as follows:
      ```
      Authorization: Bearer 4d2d0239-e28c-4f4a-8a4d-3a3ca40056b8
      ```
            
    ### Message formatting:
      - use "\n" for line breaks

    ### Input strings:
      - String fields must not contain the NUL character (U+0000).
  version: 1.3.0
servers:
  - url: https://app.timelines.ai/integrations/api
    description: Public API root URL
security:
  - bearerAuth: []
paths:
  /chats/{chat_id}/read:
    post:
      summary: Mark a chat as read.
      description: >
        Marks a regular WhatsApp chat as read, as opening the chat in the web
        app does. The Timelines read flag is the inbox; the WhatsApp read status
        is what the other person sees. `PATCH /chats/{chat_id}` with `read`
        changes only the Timelines flag. This endpoint marks the chat read in
        Timelines and, when the workspace sends read receipts, marks the
        incoming messages read on WhatsApp the same way opening the chat does.
        When the workspace does not send read receipts, only the Timelines flag
        changes. A group chat gets the read receipt opening that chat sends.
        Calling it on a chat that is already read returns success. The request
        has no body. Requires the `chats:write` scope.


        **Errors**


        Checks run in this order and the first one that fails is returned. A
        refused call leaves the chat as it was.


        | Order | `error_code` | HTTP | `message` | When |

        |---|---|---|---|---|

        | 1 | `not_found` | 404 | `Chat not found.` | No such chat in this
        workspace, or the token cannot open it |

        | 2 | `not_supported` | 405 | `This is a WABA chat. Use the /waba/chats
        and /waba/messages endpoints instead.` | The chat is a WABA chat |

        | 3 | `account_inactive` | 409 | `This chat is not connected to a
        WhatsApp account.` | The chat's WhatsApp account is gone |

        | 4 | `account_inactive` | 409 | `This WhatsApp account is suspended.` |
        The account is suspended (Paused or Sync paused on the accounts page) |

        | 5 | `account_inactive` | 409 | `This WhatsApp account is
        disconnected.` | The account is disconnected, paused, banned, blocked,
        needs payment, or in any other inactive state |


        An account that is `active`, `online`, or `offline` is not refused.
      parameters:
        - $ref: '#/components/parameters/chat_id'
      responses:
        '200':
          description: Success. `data` is the chat, with `read` true.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatInfoResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '404':
          $ref: '#/components/responses/NotFound'
        '405':
          description: The chat is a WABA chat.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: error
                message: >-
                  This is a WABA chat. Use the /waba/chats and /waba/messages
                  endpoints instead.
                error_code: not_supported
        '409':
          description: The chat's WhatsApp account cannot send a read status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: error
                message: This WhatsApp account is disconnected.
                error_code: account_inactive
components:
  parameters:
    chat_id:
      in: path
      name: chat_id
      schema:
        type: integer
      required: true
      description: >-
        an id of the chat as appears in TimelinesAI (can be found in the URL of
        the chat page, or in the payload of outbound webhook). _Supports sending
        messages to a group._
  schemas:
    ChatInfoResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          example: ok
          enum:
            - ok
            - error
        data:
          $ref: '#/components/schemas/ChatInfo'
    ErrorResponse:
      required:
        - message
        - status
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          example: error
          enum:
            - ok
            - error
        error_code:
          type: string
          description: >-
            Stable, machine-readable error code. Use this for branching in
            client integrations.
          example: validation_error
          enum:
            - missing_credentials
            - invalid_token
            - member_not_found
            - permission_denied
            - insufficient_scope
            - plan_feature_unavailable
            - quota_exceeded
            - rate_limit_exceeded
            - validation_error
            - not_found
            - account_inactive
            - template_not_approved
            - template_wrong_waba
            - template_variables_mismatch
            - service_window_closed
            - not_supported
            - internal_error
            - account_already_connected
            - member_has_connected_account
            - member_has_phone_link_in_progress
            - number_pairing_in_progress
            - member_has_qr_connection_in_progress
            - connected_accounts_limit_reached
            - user_id_required
            - number_not_allowed
        errors:
          type: array
          description: >-
            Per-field validation diagnostics for request-schema (body/params)
            validation failures. Present only when the request failed schema
            validation; absent on business-rule `validation_error` rejections
            (which carry `message` and `error_code` only) and on
            auth/authorization/quota errors.
          items:
            $ref: '#/components/schemas/ValidationError'
    ChatInfo:
      type: object
      required:
        - id
        - name
        - jid
        - is_group
        - closed
        - read
        - labels
        - chatgpt_autoresponse_enabled
        - chat_sync
        - whatsapp_account_id
        - chat_url
        - created_timestamp
        - unattended
        - photo
      properties:
        id:
          example: '1000001'
          type: integer
        name:
          example: John Doe
          type: string
        phone:
          example: '+972501111111'
          type: string
          description: >
            Contact's phone number in international format. `null` for group
            chats.
        jid:
          example: 14840000000@s.whatsapp.net
          type: string
          description: >
            WhatsApp-native identifier for the contact or group, structured as
            `<id>@<server>` — e.g. `14840000000@s.whatsapp.net` for a contact
            (the `id` part is the phone number) or `<id>@g.us` for a group. Use
            this value with JID-addressed endpoints.
        is_group:
          example: false
          type: boolean
        closed:
          example: false
          type: boolean
        read:
          example: true
          type: boolean
        labels:
          example:
            - label1
            - label2
            - label3
          type: array
          items:
            type: string
        chatgpt_autoresponse_enabled:
          type: boolean
          example: true
          description: >-
            Whether the AI Agent (ChatGPT autoresponse) is currently enabled for
            this chat.
        chat_sync:
          type: boolean
          nullable: true
          example: true
          description: >
            Message Sync for this chat, the in-app **Message Sync** switch.
            `false`: new incoming WhatsApp messages are not saved to the chat.
            `null`: the chat is not linked to a WhatsApp chat, so it has no
            Message Sync.
        responsible_email:
          example: kate.smitch@acme.com
          type: string
          description: >
            Registration email of the team member responsible for the chat;
            `null` if the chat is unassigned.
        responsible_name:
          example: Kate Smith
          type: string
        whatsapp_account_id:
          example: 972502222222@s.whatsapp.net
          type: string
        chat_url:
          example: https://app.timelines.ai/chat/1000001/messages/
          type: string
        created_timestamp:
          example: 2024-01-08 10:35:18 +0200
          type: string
          description: >
            Chat creation time in the workspace timezone, formatted `YYYY-MM-DD
            HH:MM:SS ±ZZZZ`.
        last_message_uid:
          example: 4f43a9a0-b87e-4667-adfd-689674c3326c
          type: string
        last_message_timestamp:
          example: 2024-01-29 13:55:04 +0200
          type: string
        last_message:
          $ref: '#/components/schemas/MessageSummary'
        unattended:
          example: false
          type: boolean
          description: >
            `true` when the AI Agent / autoresponder has flagged the chat as an
            **unattended customer** — an inbound message went unanswered and
            tripped the not-attended flow; cleared once the chat is handled.
            (Same underlying value as the webhook field `unattended_customer`.)
        photo:
          example: https://acme.com/logo.png
          type: string
        group_members:
          description: Only in the specific-chat response; the chat lists omit it.
          type: array
          items:
            type: object
            properties:
              name:
                example: John Doe
                type: string
              phone:
                type: string
                example: '+972502222222'
              role:
                type: string
                example: admin
              chat_id:
                type: integer
                example: 123456
                description: >
                  TimelinesAI chat ID of this member's one-on-one chat, if such
                  a chat exists; otherwise `null`.
        is_allowed_to_message:
          example: true
          type: boolean
          description: >
            Whether messages can currently be sent into this chat via the API.
            `false` means sends to this chat will be rejected — common reasons
            are: the chat is a WhatsApp  **broadcast list** (`@broadcast` JID)
            or a **channel/newsletter** (`@newsletter` JID), or the  **WhatsApp
            account that owns the chat is currently disconnected**.  `true` for
            normal one-on-one and group chats whose WhatsApp account is
            connected.
    ValidationError:
      type: object
      required:
        - fields
        - msg
      properties:
        fields:
          type: array
          items:
            type: string
          description: >-
            Path of the offending field, as a list of keys/indexes from the
            request root.
          example:
            - url
        msg:
          type: string
          description: Validator message for that field.
          example: must be a valid http(s) URL
    MessageSummary:
      type: object
      description: >
        Same shape as MessageInfo, with the `reactions` key omitted. Used for
        the `last_message` field on chat list/detail responses.
      required:
        - uid
        - chat_id
        - timestamp
        - received_timestamp
        - sender_phone
        - sender_name
        - recipient_phone
        - recipient_name
        - from_me
        - status
        - origin
        - has_attachment
        - message_type
        - data
        - created_by
      properties:
        uid:
          type: string
          example: de919486-0c93-409d-ae66-c2bbb544faca
        chat_id:
          example: '1000001'
          type: integer
        timestamp:
          description: message creation timestamp, WhatsApp message time
          example: 2023-06-18 15:19:23 +0300
          type: string
        received_timestamp:
          description: >-
            message creation timestamp in TimelinesAI, in ISO format with
            timezone
          example: 2023-06-18 14:39:25 +0300
          type: string
        sender_phone:
          example: '+972540000001'
          type: string
        sender_name:
          example: John Doe
          type: string
        recipient_phone:
          example: '+972540000002'
          type: string
        recipient_name:
          example: Kate Smith
          type: string
        from_me:
          example: true
          type: boolean
        text:
          example: Hello, Kate👍
          type: string
          description: >
            Message body text. `null` for attachment-only messages and for call
            / event messages. For a transcribed voice note, `text` carries the
            transcript and `text_is_transcript` is true — a non-null `text` no
            longer means the message has no audio.
        text_is_transcript:
          type: boolean
          description: >
            True when `text` is a voice-note transcript. False for every other
            message. Omitted while WhatsApp calling is off for the workspace.
          example: false
        attachment_url:
          example: https://acme.com/logo.png
          type: string
        attachment_filename:
          example: logo.png
          type: string
        status:
          example: Read
          type: string
          description: >
            Delivery status, one of: `Sending`, `Sent`, `Delivered`, `Read`,
            `Failed`, `Pending`. For call messages, a call status (e.g.
            `answered`, `missed`) is returned instead.
        origin:
          example: Public API
          type: string
          description: >
            Human-readable origin of the message, e.g. `Public API`, `Shared
            Inbox`, `Mass Messaging`, `Chrome Extension`, `synced from
            WhatsApp`, `Webhook`. Additional values are possible (e.g. from OIDC
            / connected third-party apps), so treat this as an open-ended,
            display-only string rather than an exhaustive enum.
        has_attachment:
          example: true
          type: boolean
        message_type:
          example: Note
          type: string
          description: >
            Type of message: one of `whatsapp`, `whatsapp_call`, `note`,
            `email`, `summary`.
        data:
          example:
            key1: value1
            key2: value2
          type: object
          description: >
            Free-form metadata object whose contents vary by `message_type` (for
            example, call status, or scheduled-event start/end times). Shape is
            not stable across message types.
        created_by:
          example: Kate Smith
          type: string
          description: >
            Display name of the team member who created the message; empty
            string for messages not created by a member (e.g. synced or inbound
            messages).
  responses:
    BadRequestError:
      description: Invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedError:
      description: Access token is missing or invalid
    AccessDenied:
      description: Access denied
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Specified entities not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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