Submitting a ticket triggers the full AI pipeline synchronously: GPT-4o-mini classifies the problem and generates a suggested response, a hybrid RAG search retrieves the most relevant knowledge base articles, and GraphRAG pulls in related graph entities to enrich the response. The assembled ticket is persisted to PostgreSQL and returned in theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/yocxy2/2a/llms.txt
Use this file to discover all available pages before exploring further.
201 response. After the response is sent, entity extraction for GraphRAG is queued as a background job and does not block the caller.
Request
POST /api/v1/tickets
Body Parameters
The customer’s problem description. This string is passed directly to GPT-4o-mini for classification and is also used as the query for both hybrid RAG search and GraphRAG context retrieval. Cannot be empty or omitted.
Example
Response (201 Created)
Returns the fully populated ticket object created in the database.Auto-incremented ticket ID assigned by the database. Use this value in subsequent
GET /api/v1/tickets/:id or PATCH /api/v1/tickets/:id calls.The description submitted in the request body, stored verbatim.
AI-assigned support category. One of:
Billing, Technical, Shipping, Returns, Account, or Other.The AI-generated response, enhanced with snippets from relevant knowledge base articles (up to the first 100 characters each) and a list of related graph entities extracted by GraphRAG.
Float between
0.0 and 1.0 representing GPT-4o-mini’s classification confidence. Tickets with a score ≥ 0.7 are automatically set to ai_resolved.ai_resolved when confidence_score >= 0.7; otherwise pending_agent.ISO 8601 UTC timestamp recording when the ticket was inserted into the database.
ISO 8601 UTC timestamp of the most recent update to this ticket. Equals
created_at on initial creation.Example Response
Error Responses
| HTTP Status | Condition |
|---|---|
400 Bad Request | user_description is missing or empty in the request body. Response: {"error": "user_description is required"} |
500 Internal Server Error | Database write failed, AI service returned an unexpected error, or another unhandled exception occurred. Response: {"error": "Internal server error"} |
GraphRAG entity extraction is asynchronous. After the
201 response is returned, the controller enqueues a background job (via BullMQ) to extract named entities from user_description and store them in the entities and entity_relations tables. This enriches future GraphRAG lookups but does not affect the current response. If the queue is unavailable the ticket is still created successfully — only the entity job is skipped.