Post Message
Send a message to an existing conversation. The AI agent will respond based on the conversation context and your codebase knowledge graph.
Use Cases
- Ask questions about your codebase
- Request debugging assistance
- Get explanations of code functionality
- Ask for code improvements or refactoring suggestions
- Inquire about code relationships and dependencies
Authentication
This endpoint requires API key authentication via thex-api-key header.
Request & Response
Request & Response
| Location | Field | Type | Required | Default | Description |
|---|---|---|---|---|---|
| Path | conversation_id | string | required | - | The unique identifier of the conversation (obtained from Create Conversation endpoint) |
| Query | stream | boolean | optional | true | Stream response in real-time. Set to false for complete response. |
| Query | session_id | string | optional | null | Session ID for reconnection to existing streaming session |
| Query | prev_human_message_id | string | optional | null | Previous message ID for deterministic session handling |
| Query | cursor | string | optional | null | Stream cursor position for replay functionality |
| Form | content | string | required | - | Your message or question. Cannot be empty or whitespace-only. |
| Form | node_ids | string | optional | - | JSON-encoded array of NodeContext objects to reference specific code nodes |
| Form | tunnel_url | string | optional | - | VS Code extension tunnel URL for local server routing |
| Form | attachment_ids | string | optional | - | JSON-encoded array of pre-uploaded attachment ID strings to include with your message |
| Response | message | string | - | - | AI agent’s response content |
| Response | citations | array[string] | - | - | Source code references used in the response |
| Response | tool_calls | array | - | - | Tool invocations made by the agent during response generation |
Node Context
Providingnode_ids helps the agent focus on specific parts of your codebase. Because the endpoint uses multipart/form-data, pass node_ids as a JSON-encoded string in the form field:
Error Responses
400 Bad Request
400 Bad Request
- Empty string provided in
contentfield - Whitespace-only content
- Missing
contentfield entirely
401 Unauthorized
401 Unauthorized
402 Payment Required
402 Payment Required
- Message limit exceeded for your current plan
- Subscription has expired
404 Not Found
404 Not Found
- Invalid
conversation_idin URL path - Conversation was deleted
- You don’t have access to this conversation
500 Internal Server Error
500 Internal Server Error
- Celery worker unavailable for message processing
- Database connection failures
- Invalid node IDs or attachment IDs
Complete Workflow
Message Types
Different message patterns for different tasks:Question & Answer
Debugging
Code Review
Response Streaming
Whenstream=true (the default), the endpoint returns a streaming response via Server-Sent Events. Each event chunk contains a partial or complete agent response. When stream=false, the endpoint returns a single JSON object with the complete response:
Authorizations
API key authentication. Get your key from potpie settings page
Path Parameters
The conversation ID to send the message to
Query Parameters
Whether to stream the response
Body
Your message or question. Cannot be empty or whitespace-only.
1JSON-encoded array of NodeContext objects to reference specific code nodes. Example: [{"node_id":"node_123","name":"AuthService"}]
VS Code extension tunnel URL for local server routing
Image attachments to include with your message

