---
updatedAt: 2026-09-06T12:07:28.000Z
agentTools:
  projectIndex: https://developers.trengo.com/llms.txt
---

# List all messages

Show all messages for a ticket

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "trengo",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://app.trengo.com/api/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/tickets/{ticket_id}/messages": {
      "get": {
        "summary": "List all messages",
        "description": "Show all messages for a ticket",
        "operationId": "list-all-messages",
        "parameters": [
          {
            "name": "ticket_id",
            "in": "path",
            "description": "The ticket id",
            "schema": {
              "type": "integer",
              "format": "int32"
            },
            "required": true
          },
          {
            "name": "page",
            "in": "query",
            "description": "Pagination",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {
                      "data": [
                        {
                          "id": 1,
                          "ticket_id": 2,
                          "type": "INBOUND",
                          "body_type": "TEXT",
                          "message": "Hi, I saw your ad",
                          "file_name": null,
                          "file_caption": null,
                          "created_at": "2023-02-17 16:06:02",
                          "updated_at": "2023-02-17 16:06:03",
                          "contact": {
                            "id": 1,
                            "full_name": "John Doe",
                            "email": null,
                            "phone": "+16315551234"
                          },
                          "agent": null,
                          "referral": {
                            "source_url": "https://www.facebook.com/trengo/posts/1234567890123456",
                            "source_id": "120212345678901234",
                            "source_type": "ad",
                            "headline": "Chat with our support team on WhatsApp",
                            "body": "Questions about your order? Message us on WhatsApp.",
                            "media_type": "image",
                            "image_url": "https://scontent.xx.fbcdn.net/v/t45.1600-4/123456789_120212345678901234_n.jpg",
                            "ctwa_clid": "AffnTeEfGrJdH9ZQIXV3LmnkOXuq3Z1t7Y-Kc0NcQ2x5OQvCbq9bXNiLAWk1Oz0tRjq"
                          }
                        }
                      ],
                      "links": {
                        "first": "https://app.trengo.com/api/v2/tickets/2/messages?page=1",
                        "last": null,
                        "prev": null,
                        "next": null
                      },
                      "meta": {
                        "current_page": 1,
                        "from": 1,
                        "path": "https://app.trengo.com/api/v2/tickets/2/messages",
                        "per_page": 20,
                        "to": 1
                      }
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer",
                            "example": 1,
                            "default": 0,
                            "description": "The id of the message."
                          },
                          "ticket_id": {
                            "type": "integer",
                            "example": 2,
                            "default": 0,
                            "description": "The id of the ticket that contains the message."
                          },
                          "type": {
                            "type": "string",
                            "example": "OUTBOUND",
                            "description": "The direction of the message: INBOUND, OUTBOUND or NOTE.",
                            "enum": [
                              "INBOUND",
                              "OUTBOUND",
                              "NOTE"
                            ]
                          },
                          "body_type": {
                            "type": "string",
                            "example": "TEXT",
                            "description": "The body type of the message, for example TEXT, IMAGE, FILE, LOCATION or CALL_LOG.",
                            "enum": [
                              "TEXT",
                              "IMAGE",
                              "VIDEO_GIF",
                              "AUDIO",
                              "FILE",
                              "BUTTONS",
                              "CARDS",
                              "EMAIL_CAPTURE",
                              "IG_STORY",
                              "EXTERNAL_LINK",
                              "CALL_LOG",
                              "VIDEO",
                              "GIF",
                              "LOCATION",
                              "COMPONENTS",
                              "FACEBOOK",
                              "IG_SHARE"
                            ]
                          },
                          "message": {
                            "type": "string",
                            "example": "Hello",
                            "description": "The text content of the message. For email messages this is the stripped text. Use the Fetch an email message endpoint to get the full email body."
                          },
                          "file_name": {
                            "description": "The file name of the attachment. Null when the message has no attachment.",
                            "type": "string"
                          },
                          "file_caption": {
                            "description": "The caption of the attachment. Null when there is no caption.",
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "example": "2023-02-17 16:06:02",
                            "description": "The date and time the message was created."
                          },
                          "updated_at": {
                            "type": "string",
                            "example": "2023-02-17 16:06:03",
                            "description": "The date and time the message was last updated."
                          },
                          "contact": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 1,
                                "default": 0,
                                "description": "The id of the contact."
                              },
                              "full_name": {
                                "type": "string",
                                "example": "John Doe",
                                "description": "The full name of the contact."
                              },
                              "email": {
                                "type": "string",
                                "example": "test@test.com",
                                "description": "The email address of the contact. Null when unknown."
                              },
                              "phone": {
                                "description": "The phone number of the contact. Null when unknown.",
                                "type": "string"
                              }
                            },
                            "description": "The contact of the ticket."
                          },
                          "agent": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer",
                                "example": 1,
                                "default": 0,
                                "description": "The id of the agent."
                              },
                              "full_name": {
                                "type": "string",
                                "example": "Jane Doe",
                                "description": "The full name of the agent."
                              },
                              "email": {
                                "type": "string",
                                "example": "jane@doe.com",
                                "description": "The email address of the agent."
                              }
                            },
                            "description": "The agent who sent the message. Null for inbound messages."
                          },
                          "referral": {
                            "type": "object",
                            "properties": {},
                            "description": "Provider tracking data as a key-value object. Only set for WhatsApp messages that start from a click-to-WhatsApp ad, and for TikTok messages that start from a referral. The keys depend on the provider. Null for all other messages."
                          }
                        }
                      },
                      "description": "The messages of the ticket on the requested page."
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "first": {
                          "type": "string",
                          "example": "https://app.trengo.com/api/v2/tickets/1/messages?page=1",
                          "description": "The URL of the first page."
                        },
                        "last": {
                          "description": "The URL of the last page. Null when unknown.",
                          "type": "string"
                        },
                        "prev": {
                          "description": "The URL of the previous page. Null on the first page.",
                          "type": "string"
                        },
                        "next": {
                          "description": "The URL of the next page. Null on the last page.",
                          "type": "string"
                        }
                      },
                      "description": "The pagination links."
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "current_page": {
                          "type": "integer",
                          "example": 1,
                          "default": 0,
                          "description": "The number of the current page."
                        },
                        "from": {
                          "type": "integer",
                          "example": 1,
                          "default": 0,
                          "description": "The index of the first message on this page."
                        },
                        "path": {
                          "type": "string",
                          "example": "https://app.trengo.com/api/v2/tickets/1/messages",
                          "description": "The base URL of the endpoint."
                        },
                        "per_page": {
                          "type": "integer",
                          "example": 20,
                          "default": 0,
                          "description": "The number of messages per page."
                        },
                        "to": {
                          "type": "integer",
                          "example": 2,
                          "default": 0,
                          "description": "The index of the last message on this page."
                        }
                      },
                      "description": "The pagination metadata."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```