Tickets
Create a ticket on behalf of one of your customers — typically in response to a business event (failed payment, stuck order, broken integration).
Endpoint
Section titled “Endpoint”POST /tickets/api-create| Field | Type | Required | Description |
|---|---|---|---|
customerExternalId | string | ✅ | Customer’s externalId |
subject | string | ✅ | Ticket subject |
description | string | ✅ | Description (Markdown supported) |
priority | LOW | MEDIUM | HIGH | URGENT | CRITICAL | — | Default: MEDIUM |
category | string | — | Free-form category |
metadata | object | — | Free-form data (orderId, errorCode, etc.) |
tagIds | string[] | — | Tag IDs (UUID) to attach |
The channel field is automatically set to API.
Example
Section titled “Example”curl -X POST https://supportdesk.innovartx.com/api/v1/tickets/api-create \ -H "X-API-Key: $SUPPORTDESK_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "customerExternalId": "user_42", "subject": "Payment failed for order #12345", "description": "Payment attempt failed with CARD_DECLINED. Customer has been notified by email.", "priority": "HIGH", "metadata": { "orderId": "12345", "amount": 99.9 } }'await fetch('https://supportdesk.innovartx.com/api/v1/tickets/api-create', { method: 'POST', headers: { 'X-API-Key': process.env.SUPPORTDESK_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ customerExternalId: 'user_42', subject: 'Payment failed for order #12345', description: 'Payment attempt failed…', priority: 'HIGH', metadata: { orderId: '12345', amount: 99.9 }, }),});import os, requests
requests.post( 'https://supportdesk.innovartx.com/api/v1/tickets/api-create', headers={'X-API-Key': os.environ['SUPPORTDESK_API_KEY']}, json={ 'customerExternalId': 'user_42', 'subject': 'Payment failed for order #12345', 'description': 'Payment attempt failed…', 'priority': 'HIGH', 'metadata': {'orderId': '12345', 'amount': 99.9}, },)$ch = curl_init('https://supportdesk.innovartx.com/api/v1/tickets/api-create');curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode([ 'customerExternalId' => 'user_42', 'subject' => 'Payment failed for order #12345', 'description' => 'Payment attempt failed…', 'priority' => 'HIGH', 'metadata' => ['orderId' => '12345', 'amount' => 99.9], ]), CURLOPT_HTTPHEADER => [ 'X-API-Key: ' . getenv('SUPPORTDESK_API_KEY'), 'Content-Type: application/json', ], CURLOPT_RETURNTRANSFER => true,]);curl_exec($ch);curl_close($ch);Response
Section titled “Response”{ "success": true, "data": { "id": "clyyyyy", "ticketNumber": "INV-1042", "subject": "Payment failed for order #12345", "status": "IN_PROGRESS", "priority": "HIGH", "channel": "API", "customer": { "id": "clxxxxxx", "externalId": "user_42", "email": "john@acme.com" }, "assignedAgent": { "id": "…", "name": "Agent N1", "email": "agent@acme.com" }, "createdAt": "2026-04-18T10:00:00Z" }, "timestamp": "2026-04-18T10:00:00Z"}If an N1 agent is available, the ticket is auto-assigned and the agent receives an email + real-time dashboard notification.
Errors
Section titled “Errors”| HTTP code | Business code | Cause |
|---|---|---|
400 | VALIDATION_ERROR | Invalid or missing fields |
403 | PLAN_LIMIT_REACHED | Monthly ticket quota reached on your plan |
404 | CUSTOMER_NOT_FOUND | externalId matches no customer in your app |
See Errors.