Skip to Content
Server-Side SDKCreate Support Ticket

Create Support Ticket

Create support tickets programmatically for server-side integrations. This API endpoint allows your backend to submit support requests on behalf of users, automatically handling user creation and management.

Server-Side Only: This endpoint is designed for server-side use with API keys. For client-side integrations, use the built-in support form in the Customer Portal.

Overview

The Create Support Ticket API allows you to:

  • Submit tickets programmatically - Create support tickets from your server
  • Automatic user management - Users are created automatically if they don’t exist
  • No prior authentication required - Users don’t need to be logged in beforehand
  • Rate limiting - Built-in protection against abuse (max 2 tickets per user per day)
  • Custom metadata support - Attach user metadata for context

API Reference

Endpoint

POST https://appbox.space/api/v1/paywall/{paywallId}/create-ticket

Authentication

Include your API key in the request header:

x-api-key: your-secret-api-key

Step 1: Get Your API Key

API Key Location

Step 2: Find Your Paywall ID

Get your paywall ID from the paywall settings page URL:

Paywall ID location

Step 3: Make API Request

Send a POST request with the user’s email, subject, message, and optional metadata:

Request Parameters

URL Parameters

ParameterTypeRequiredDescription
paywallIdstringYesYour paywall identifier

Request Body

FieldTypeRequiredDescription
emailstringYesUser’s email address
subjectstringYesTicket subject (3-200 characters)
messagestringYesTicket message content (1-5000 characters)
userMetaobjectNoCustom metadata linked to user

Example Request Body

{ "email": "user@example.com", "subject": "Cannot access premium features", "message": "I purchased a subscription yesterday but still can't access premium features. My order ID is #12345.", "userMeta": { "my-user-uuid": "pojfoih27938y50ujtb4ip1n2b", "plan": "premium" } }

Implementation Examples

const paywallId = '123'; const apiKey = 'your-secret-api-key'; const response = await fetch(`https://appbox.space/api/v1/paywall/${paywallId}/create-ticket`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey }, body: JSON.stringify({ email: 'user@example.com', subject: 'Cannot access premium features', message: 'I purchased a subscription but still cannot access premium features.', userMeta: { "my-user-uuid": "pojfoih27938y50ujtb4ip1n2b" } }) }); const data = await response.json(); if (response.ok) { console.log('Ticket created:', data.ticket); // { id: 42, status: 'open' } } else { console.error('Error:', data); }

Response Format

Success Response

{ "ticket": { "id": 42, "status": "open" } }

Error Responses

Status CodeError TypeDescription
400Bad RequestMissing or invalid parameters (email, subject, message)
401UnauthorizedInvalid or missing API key
403ForbiddenAPI key owner does not match paywall owner
429Too Many RequestsRate limit exceeded (max 2 tickets per user per day)
500Internal Server ErrorServer-side error occurred

Use Cases

In-App Support Form

Build a custom support form in your application and submit tickets from your server:

// Express.js example app.post('/support', async (req, res) => { const { subject, message } = req.body; const response = await fetch( `https://appbox.space/api/v1/paywall/${process.env.PAYWALL_ID}/create-ticket`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': process.env.API_KEY }, body: JSON.stringify({ email: req.user.email, subject, message, userMeta: { user_id: req.user.id } }) } ); const data = await response.json(); res.json({ ticketId: data.ticket.id }); });

Security Guidelines

  1. Store API keys securely - Never expose API keys in client-side code
  2. Validate user input - Sanitize subject and message before sending
  3. Use HTTPS - Always use encrypted connections
  4. Implement your own rate limiting - Add additional rate limiting on your server if needed

Next Steps