Ticket Workflow API

POST Ticket Workflow API

/api/v1/ai/ticket-workflow

Analyze a customer support ticket and context to determine the next automated workflow action, priority, and routing destination.

Request Body Parameters

Field Type Required Description
ticket string Required The customer support ticket message text (Max: 20,000 characters).
subject string Optional Optional ticket subject header.
customer_context string Optional Optional customer account details context.
product_context string Optional Optional product details context.
business_context string Optional Optional support operational policies or rules context.
previous_messages array Optional Optional array of previous messages in conversation thread.
available_departments array Optional Optional list of available departments to restrict routing decisions.
model string Optional Optional AI model to use.

Example Request

This example demonstrates how to evaluate a ticket to resolve the next workflow state.

JSON Request
{
  "ticket": "My payment was deducted but my subscription is still not active.",
  "customer_context": "Billing database shows payment pending verification.",
  "available_departments": ["technical_support", "billing", "sales"]
}
cURL
curl -X POST https://rsflowhub.com/api/v1/ai/ticket-workflow \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ticket": "My payment was deducted but my subscription is still not active.",
    "customer_context": "Billing database shows payment pending verification.",
    "available_departments": ["technical_support", "billing", "sales"]
  }'

Example Response

The response returns workflow decisions, department routing, safety flags, and details on any missing inputs required from the user.

JSON Response
{
  "success": true,
  "data": {
    "result": {
      "decision": "REQUEST_MORE_INFO",
      "priority": "high",
      "route_to": "billing",
      "requires_human": true,
      "reason": "Payment deduction occurred but subscription not active. System is waiting for user transaction receipt verification details.",
      "can_auto_reply": true,
      "required_information": [
        "transaction_receipt_id"
      ]
    }
  },
  "meta": {
    "credits_used": 3,
    "credits_remaining": 992
  }
}

API Request Example

Use the cURL snippet below to test the endpoint.

cURL
curl -X POST 'https://rsflowhub.com/api/v1/ai/ticket-workflow' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "ticket": "My payment was deducted but my subscription is still not active.",
    "customer_context": "Billing database shows payment pending verification.",
    "available_departments": [
        "technical_support",
        "billing",
        "sales"
    ]
}'

Ready to build?

Create your free account and make your first API call in minutes.