# List chat completion messages
URL: https://docs.munito.ai/api/listChatCompletionMessages

GET /chat/completions/{completion_id}/messages

Lists the request messages of a completion that was created with `store: true`, in the order of the request by default. A message with a list of content parts keeps the list in `content_parts`, and `content` holds its text.

```json
{
  "operationId": "listChatCompletionMessages",
  "summary": "List chat completion messages",
  "tags": [
    "Completions"
  ],
  "description": "Lists the request messages of a completion that was created with `store: true`, in the order of the request by default. A message with a list of content parts keeps the list in `content_parts`, and `content` holds its text.",
  "parameters": [
    {
      "name": "completion_id",
      "in": "path",
      "required": true,
      "description": "The completion id.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "after",
      "in": "query",
      "description": "The id of the last message of the previous page.",
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "limit",
      "in": "query",
      "description": "The number of messages to return, from 1 to 100.",
      "schema": {
        "type": "integer",
        "default": 20
      }
    },
    {
      "name": "order",
      "in": "query",
      "description": "Sort by the position in the request.",
      "schema": {
        "type": "string",
        "enum": [
          "asc",
          "desc"
        ],
        "default": "asc"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "A page of the request messages.",
      "content": {
        "application/json": {
          "example": {
            "object": "list",
            "data": [
              {
                "id": "chatcmpl-7f3c1a-0",
                "role": "user",
                "content": "Why does data residency matter?",
                "name": null,
                "content_parts": null
              }
            ],
            "first_id": "chatcmpl-7f3c1a-0",
            "last_id": "chatcmpl-7f3c1a-0",
            "has_more": false
          }
        }
      }
    },
    "400": {
      "description": "`limit` or `order` is not valid."
    },
    "404": {
      "description": "No completion with this id is stored in your workspace."
    }
  }
}
```

# Shared API schemas
{
  "securitySchemes": {
    "BearerAuth": {
      "type": "http",
      "scheme": "bearer",
      "description": "Your Munito API key."
    },
    "ApiKeyAuth": {
      "type": "apiKey",
      "in": "header",
      "name": "x-api-key",
      "description": "Your Munito API key."
    }
  }
}