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

# Get a chat

> Returns every message in a chat with Ask's replies and proposals. While `retry_after_ms` is set, Ask is still working; read the chat again after that many milliseconds.



## OpenAPI

````yaml /partner-openapi.gen.json get /partner/v0.1/chats/{chat_id}
openapi: 3.1.0
info:
  title: Circuit partner API
  version: '0.1'
servers:
  - url: https://api.circuit.org
security: []
paths:
  /partner/v0.1/chats/{chat_id}:
    get:
      summary: Get a chat
      description: >-
        Returns every message in a chat with Ask's replies and proposals. While
        `retry_after_ms` is set, Ask is still working; read the chat again after
        that many milliseconds.
      operationId: getChat
      parameters:
        - name: chat_id
          in: path
          required: true
          example: chat_7d3e1a90-4b2c-4e5f-8a6b-1c2d3e4f5a6b
          schema:
            type: string
            examples:
              - chat_7d3e1a90-4b2c-4e5f-8a6b-1c2d3e4f5a6b
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: A chat between the user and Ask Circuit.
                type: object
                properties:
                  id:
                    description: The chat's id, starting with `chat_`.
                    type: string
                  messages:
                    description: Every message in the chat, oldest first.
                    type: array
                    items:
                      $ref: '#/components/schemas/Message'
                  retry_after_ms:
                    description: >-
                      While Ask is working, how many milliseconds to wait before
                      reading the chat again. Null once Ask is done.
                    type:
                      - integer
                      - 'null'
                    format: uint64
                    minimum: 0
                required:
                  - id
                  - messages
        default:
          description: Failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerFailure'
      security:
        - permit: []
components:
  schemas:
    Message:
      description: One message in a chat and Ask's reply to it.
      type: object
      properties:
        id:
          description: The message's id, starting with `msg_`.
          type: string
        chat:
          description: >-
            The chat it belongs to, starting with `chat_`. Null for a message
            sent before the user linked your app; those messages stand alone.
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/MessageStatus'
        text:
          description: What the user wrote. Null when Circuit followed up on its own.
          type:
            - string
            - 'null'
        reply:
          description: Ask's reply in Markdown. Null while Ask is still working.
          type:
            - string
            - 'null'
        proposals:
          description: >-
            Trades, agent starts and top-ups that Ask proposed in this reply.
            Each needs your approval.
          type: array
          items:
            $ref: '#/components/schemas/PartnerProposal'
      required:
        - id
        - status
        - proposals
    PartnerFailure:
      description: >-
        A failed call. Handle it by HTTP status and `code`, and show `error` to
        the user.
      type: object
      properties:
        error:
          description: A message you can show the user.
          type: string
        code:
          description: >-
            A stable code such as `BAD_REQUEST`, `NOT_FOUND`, `CONFLICT` or
            `UNAUTHORIZED`. New codes can appear.
          type: string
      required:
        - error
        - code
    MessageStatus:
      oneOf:
        - description: Ask is still writing its reply.
          type: string
          const: working
        - description: The reply is complete.
          type: string
          const: done
        - description: Ask could not answer. `reply` says why.
          type: string
          const: failed
    PartnerProposal:
      description: >-
        Something Ask proposed, such as a trade or an agent start, that waits
        for your approval.
      type: object
      properties:
        id:
          description: The proposal's id, starting with `prop_`.
          type: string
        title:
          description: >-
            What it does, starting with a verb, such as "Buy 0.04 ETH on
            Lighter" or "Start Macro Trend".
          type: string
        status:
          $ref: '#/components/schemas/PartnerProposalStatus'
        error:
          description: Why it failed when `status` is `failed`. Null otherwise.
          type:
            - string
            - 'null'
        session:
          description: >-
            The session it started or changed, starting with `ses_`. Null for
            trades.
          type:
            - string
            - 'null'
      required:
        - id
        - title
        - status
    PartnerProposalStatus:
      oneOf:
        - description: Waiting for you to approve or decline it.
          type: string
          const: review
        - description: Approved, and Circuit is carrying it out.
          type: string
          const: processing
        - description: Carried out.
          type: string
          const: done
        - description: Declined, or it expired before anyone approved it.
          type: string
          const: declined
        - description: It could not be carried out. `error` says why.
          type: string
          const: failed
  securitySchemes:
    permit:
      description: The permit the user approved for your app.
      type: http
      scheme: bearer

````

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