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

# Update Chat

> Update chat's name, assign responsible, or close/re-open a chat.



## OpenAPI

````yaml patch /chats/{chat_id}
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.global 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.global/integrations/api/) in your Timelines Global 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
  version: 1.3.0
servers:
  - url: https://app.timelines.global/integrations/api
    description: Production
  - url: https://staging.app.timelines.global/integrations/api
    description: Staging
security:
  - bearerAuth: []
paths:
  /chats/{chat_id}:
    patch:
      summary: Update chat
      description: Update chat's name, assign responsible (by email) or close / re-open
      parameters:
        - $ref: '#/components/parameters/chat_id'
      requestBody:
        description: ''
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatDetails'
      responses:
        '200':
          description: Success
          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'
components:
  parameters:
    chat_id:
      in: path
      name: chat_id
      schema:
        type: integer
      required: true
      description: >-
        an id of the chat as appears in Timelines Global (can be found in the
        URL of the chat page, or in the payload of outbound webhook). _Supports
        sending messages to a group._
  schemas:
    ChatDetails:
      type: object
      properties:
        name:
          type: string
          description: Chat's name (must be unique in workspace)
          example: John Doe
        responsible:
          type: string
          description: >-
            Assign team member as responsible (specified by registration email
            in Timelines Global) or unassign a chat from responsible by
            supplying an empty string ("").
          example: john.doe@acme.com
        closed:
          type: boolean
          description: Is the chart closed (true) or open (false)
          example: false
        read:
          type: boolean
          description: Is the chat read (true) or unread (false)
          example: true
        chatgpt_autoresponse_enabled:
          type: boolean
          description: >-
            Is the ChatGPT autoresponse enabled (true) or disabled (false) for
            the chat
          example: true
    ChatInfoResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: string
          example: ok
          enum:
            - ok
            - error
        data:
          $ref: '#/components/schemas/ChatInfo'
    ChatInfo:
      type: object
      required:
        - id
        - name
        - jid
        - is_group
        - closed
        - read
        - labels
        - chatgpt_autoresponse_enabled
        - 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
        jid:
          example: 14840000000@s.whatsapp.net
          type: string
        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:
          example: true
          type: boolean
        responsible_email:
          example: kate.smitch@acme.com
          type: string
        responsible_name:
          example: Kate Smith
          type: string
        whatsapp_account_id:
          example: 972502222222@s.whatsapp.net
          type: string
        chat_url:
          example: https://app.timelines.global/chat/1000001/messages/
          type: string
        created_timestamp:
          example: 2024-01-08 10:35:18 +0200
          type: string
        last_message_uid:
          example: 4f43a9a0-b87e-4667-adfd-689674c3326c
          type: string
        last_message_timestamp:
          example: 2024-01-29 13:55:04 +0200
          type: string
        unattended:
          example: false
          type: boolean
        photo:
          example: https://acme.com/logo.png
          type: string
        group_members:
          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
        is_allowed_to_message:
          example: true
          type: boolean
    ErrorResponse:
      required:
        - message
        - status
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          example: error
          enum:
            - ok
            - error
  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

````