Stream Chat
Start a streaming chat session with the Greenflash AI agent.
Requires a Growth or Enterprise plan.
The response is a Server-Sent Events (SSE) stream (Content-Type: text/event-stream).
Each event follows the format:
Event types:
tool_call— The agent is invoking a tool. Data:{"step": 1, "toolName": "...", "displayName": "..."}tool_result— A tool returned its result. Data:{"step": 1, "toolName": "...", "displayName": "..."}. FordraftTicketandcreateTicket, the event also includes anoutputfield with the tool’s payload (see Ticket creation below).text_delta— A chunk of the agent’s text response. Concatenate all deltas to build the full message. Data:{"text": "..."}done— The stream completed successfully. Data:{"conversationId": "...", "status": "complete", "usage": {"toolCalls": N, "tools": ["..."]}}error— An error occurred during processing. Data:{"error": "...", "code": "..."}
Multi-turn conversations: Pass previous messages in the messages array and reuse the conversationId returned in the done event.
Rate limits: This endpoint is rate-limited per tenant (requests/hour) and subject to token usage limits.
Ticket creation (two-step draft → confirm)
When the tenant has an active ticket-provider connection (e.g. Linear), the agent may emit a draftTicket tool call. The tool_result event includes an output field shaped like:
API consumers should render this draft to the end user. To confirm (optionally with edits), send a follow-up user message asking the agent to call createTicket with the final payload. The createTicket tool_result event contains:
status is "created" on success, "already_exists" when deduplication matched an existing ticket (the existing providerIdentifier / providerTicketUrl are returned), or the event may carry an error field (e.g. "provider_needs_setup").
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The current user question to send to the AI agent.
1 - 4000Prior conversation history (NOT including the current question). Used for multi-turn context.
50Stable identifier for multi-turn conversations. If omitted, a new ID is generated.
128Free-form hint injected into the system prompt for this turn only.
2000Scope the chat to a specific product. If omitted, the agent can access all products.
Response
SSE stream of chat events (text/event-stream). See endpoint description for event format.
Example SSE stream:

