---
title: "Send a message to a conversation."
method: POST
path: "/api/v1/projects/{projectId}/conversations/{sessionId}/messages"
tags: ["Conversations"]
---

# Send a message to a conversation.

`POST /api/v1/projects/{projectId}/conversations/{sessionId}/messages`

Send a message to a conversation within an agent (formerly known as project) identified by its unique projectId and sessionId. This endpoint enables you to send a new message to a specific conversation, facilitating seamless communication and collaboration within the agent. By providing the projectId and sessionId, you can target the desired conversation and contribute to the ongoing discussion. This API endpoint supports real-time streaming, allowing for instant message delivery and dynamic updates which enables efficient and interactive communication between the user and agent.
Here is an example to send a message to a conversation: [API](https://github.com/Poll-The-People/customgpt-cookbook/blob/main/examples/Create_a_new_conversation_and_send_a_message_to_the_conversation.ipynb) [SDK](https://github.com/Poll-The-People/customgpt-cookbook/blob/main/examples/SDK_Create_a_new_conversation_and_send_a_message_to_the_conversation.ipynb).

## Path parameters

- `projectId` integer, required
- `sessionId` string, required

## Query parameters

- `stream` boolean
- `lang` string
- `external_id` string

## Request body

- object
  - `prompt` string — Prompt to send to OpenAI
  - `custom_persona` string, nullable — Custom persona to use for the conversation
  - `chatbot_model` 'gpt-4-o' | 'gpt-4-1' | 'gpt-4o-mini' | 'gpt-4-1-mini' | 'claude-3-sonnet' | 'claude-3.5-sonnet' | 'gpt-o4-mini-low' | 'gpt-o4-mini-medium' | 'gpt-o4-mini-high', nullable — Agent model to use for the conversation
  - `response_source` 'default' | 'own_content' | 'openai_content', nullable — By default, we ask ChatGPT to use only your content in its response (recommended). If you wish ChatGPT to improvise and use its own knowledgebase as well, you can set this to "openai_content".

## Response `200`

Send a message to a conversation

- object
  - `status` 'error' | 'success' — The status of the response
  - `data` PromptHistory
    - `id` integer — The unique identifier of the prompt history.
    - `user_id` integer — The unique identifier of the user.
    - `user_query` string — The user prompt query.
    - `openai_response` string — The OpenAI response to the user prompt query.
    - `created_at` string, date-time — The date and time the prompt history was created.
    - `updated_at` string, date-time — The date and time the prompt history was last updated.
    - `conversation_id` integer — The unique identifier of the conversation.
    - `citations` integer[] — The citations for the prompt history.
    - `metadata` object
      - `user_ip` string — The IP address of the user.
      - `user_agent` string — The user agent of the user.
      - `external_id` string — The external ID of the prompt history.
      - `request_source` string — The source of the request.
    - `response_feedback` object
      - `created_at` string, date-time — The timestamp when the feedback was created
      - `updated_at` string, date-time — The timestamp when the feedback was last updated
      - `user_id` integer, nullable — The ID of the user who provided the feedback
      - `reaction` string — The reaction provided by the user

## Other responses

- `400` — Bad Argument
- `401` — API Token is either missing or invalid
- `404` — Agent not found
- `429` — Resource Exhausted when sending a message to a conversation
- `500` — Internal Server Error

---

[API](https://skmtc.net/poll-the-people/apis/customgpt-ai.md) · [All operations](https://skmtc.net/poll-the-people/apis/customgpt-ai/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/poll-the-people/customgpt-ai/revisions/b80e6dfcf78d/schema)
