Create support tickets from your app with a REST API
Turn bug reports, failed payments and in-app feedback into support tickets automatically. A step-by-step guide with curl and JavaScript examples.
Uplio team·Published ·2 min read
Your product often knows about a problem before your customer writes in. A payment fails, a sync job errors out, a user taps “Report a problem”. If those events land in the same queue as customer emails, your team has one place to look, and customers get help before they have to ask.
This guide shows how to create support tickets from your own code with the Uplio REST API.
What you need
- An Uplio account with a workspace
- An API key, created in your account settings
- Your workspace ID, shown in the dashboard with a copy button
Create a ticket with curl
The API speaks JSON over HTTPS and authenticates with a Bearer token:
curl -X POST "https://app.uplio.io/api/v1/tickets?workspaceId=YOUR_WORKSPACE_ID" \
-H "Authorization: Bearer $UPLIO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Payment failed for order #1042",
"description": "Stripe returned card_declined during checkout.",
"priority": "high",
"userId": "customer@example.com"
}'
Only title is required. userId is the email (or user ID) of the person the ticket is about, and priority is low, normal or high. The new ticket appears in the “Open” column of your board, and your workspace managers get an email alert.
Create a ticket from JavaScript
The same request from a Node.js backend:
async function createTicket({ title, description, email, priority = "normal" }) {
const res = await fetch(
`https://app.uplio.io/api/v1/tickets?workspaceId=${process.env.UPLIO_WORKSPACE_ID}`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.UPLIO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ title, description, priority, userId: email }),
},
);
if (!res.ok) throw new Error(`Uplio API error: ${res.status}`);
return res.json();
}
Keep the API key on your server. Never ship it in browser or mobile code; send in-app reports to your own backend first and create the ticket from there.
Three patterns worth copying
1. The in-app “Report a problem” button
Collect a short description in your UI, add context the user would never type themselves (account ID, app version, current page) and create a ticket with it. Your team starts with everything they need.
2. Automatic escalation of failures
When a background job fails in a way that affects a customer, open a high priority ticket. Support can reach out proactively, which customers notice and appreciate.
3. Keep your own form design
If you already have a carefully designed contact form, keep it. Send its submissions to the API instead of an email address, and they arrive as structured tickets.
Next steps
Tickets also support messages: you can add a message to a ticket with POST /api/v1/tickets/{id}/messages, and update status or priority with PATCH /api/v1/tickets/{id}. The full list of endpoints and schemas is in the interactive API reference.