Login

Developers Documentation

Integrate BlueTickets with your stack using our stable REST APIs.

Overview

Our REST APIs let you create tickets, list existing ones, update statuses, and pull analytics. The endpoints are stable and versioned, and every request must be authenticated via an API key.

  • Base URL: https://www.bluetickets.app/api
  • Authentication: Bearer token using your workspace API key (format: Bearer qt_<your-api-key>)
  • Content-Type: application/json for all POST/PUT/PATCH requests

Authentication

All API requests require authentication using an API key. API keys are scoped to your organization and can be generated from Developers → API Keys from the side menu.

Include your API key in the Authorization header:

Authorization: Bearer qt_your_api_key_here

API keys must start with the 'qt_' prefix. Keep your keys secure and never expose them in client-side code.

Rate Limiting

To ensure fair usage and system stability, all API endpoints are rate limited. Rate limits are applied per API key.

API Endpoints

All API endpoints have a rate limit of 100 requests per minute per API key. This limit applies to all endpoints combined.

Limit: 100 requests
Window: 1 minute
Scope: Per API key

Rate Limit Headers

Every API response includes rate limit information in the response headers:

X-RateLimit-Limit: Maximum requests allowed
X-RateLimit-Remaining: Remaining requests in current window
X-RateLimit-Reset: Unix timestamp when limit resets
Retry-After: Seconds to wait (only on 429 responses)

Rate Limit Exceeded

When the rate limit is exceeded, the API returns a 429 status code with the following response:

{
  "error": "RATE_LIMIT_EXCEEDED",
  "message": "Rate limit exceeded. Maximum 100 requests per minute.",
  "retryAfter": 45
}

Wait for the time specified in the Retry-After header before making additional requests. Implement exponential backoff in your client to handle rate limits gracefully.

API Endpoints

Use the endpoints below to automate ticket creation, syncing, and reporting. Replace YOUR_API_KEY with the key generated in Settings → API.

Create Ticket

Create a new support ticket programmatically. Use this from your backend when you need to log issues automatically.

POST /api/tickets(Required (API key))

Request Body

FieldTypeRequiredDescription
titlestringYesBrief summary of the issue (max 255 characters)
bodystringYesDetailed description of the issue, steps to reproduce, or any relevant context
requesterEmailstringYesEmail address of the person requesting support (must be valid email format)
requesterNamestringNoFull name of the requester (optional, but recommended for better ticket management)
prioritynumberNoPriority level: 0 (Low), 1 (Medium), 2 (High). Default: 0
urgentbooleanNoMark ticket as urgent. Default: false
sourcestringNoSource of the ticket: 'app', 'web', 'email', or 'agent'. Default: 'app'

Example Request

curl -X POST https://www.bluetickets.app/api/tickets \
  -H "Authorization: Bearer qt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Login button not working",
    "body": "When users tap the login button, nothing happens. This occurs on iOS 17.2.",
    "requesterEmail": "[email protected]",
    "requesterName": "John Doe",
    "priority": 2,
    "urgent": false,
    "source": "app"
  }'

Success Response (201 Created)

{
  "ok": true,
  "ticket": {
    "id": "clx1234567890",
    "title": "Login button not working",
    "status": "pending",
    "priority": 2,
    "urgent": false,
    "source": "app",
    "requesterEmail": "[email protected]",
    "requesterName": "John Doe",
    "createdAt": "2025-11-18T13:50:00.000Z"
  }
}

List Tickets

Fetch tickets with filters for requester email, keywords, status, source, assignee, and urgency. Results are paginated so you can stream them into your stack.

GET /api/tickets(Required (API key))

Query Parameters

NameTypeDescription
pagenumberPage number (default: 1)
pageSizenumberItems per page, max 100 (default: 25)
statusstringComma-separated list of statuses (e.g., pending,processing)
sourcestringFilter by source: app, web, email, agent
requesterEmailstringMatch requester email (case-insensitive contains)
requesterNamestringMatch requester name (case-insensitive contains)
keywordsstringSearch across title, body, requester name/email
assigneestringFilter by assigned agent email, name, id, or use 'unassigned'
urgentbooleanSet to true or false to filter by urgent flag

Example Request

curl "https://www.bluetickets.app/api/tickets?page=1&pageSize=25&status=pending,processing&assignee=unassigned" \
  -H "Authorization: Bearer qt_YOUR_API_KEY"

Success Response (200 OK)

{
  "ok": true,
  "pagination": {
    "page": 1,
    "pageSize": 25,
    "totalResults": 58,
    "totalPages": 3
  },
  "tickets": [
    {
      "id": "clx123",
      "title": "Login button not working",
      "status": "pending",
      "priority": 2,
      "urgent": false,
      "source": "web",
      "requester": {
        "email": "[email protected]",
        "name": "John Doe"
      },
      "assignedTo": null,
      "messagesCount": 4,
      "createdAt": "2025-11-18T13:50:00.000Z",
      "updatedAt": "2025-11-18T14:10:00.000Z"
    }
  ]
}

Update Ticket Status

Update the status of an existing ticket. Authenticate with your API key to keep automations simple while preserving the audit trail.

POST /api/tickets/{ticketId}/status(Required (API key))

Request Body

FieldTypeRequiredDescription
statusstringYesNew status value (see Status Values section below)
reasonstringYesReason for the status change (required for audit trail)

Example Request

curl -X POST https://www.bluetickets.app/api/tickets/clx1234567890/status \
  -H "Authorization: Bearer qt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "processing",
    "reason": "Agent assigned and starting investigation"
  }'

Success Response (200 OK)

{
  "ok": true
}

Ticket Statistics

Quickly retrieve counts by status plus roll-ups for open, closed, and urgent tickets. Perfect for dashboards or alerting.

GET /api/tickets/stats(Required (API key))

Success Response (200 OK)

{
  "ok": true,
  "stats": {
    "total": 132,
    "open": 87,
    "closed": 45,
    "urgent": 5,
    "byStatus": {
      "pending": 41,
      "processing": 18,
      "completed": 45,
      "urgent": 5,
      "escalated": 3
    }
  }
}

Ticket Messages & Replies

Sync conversations or send outbound replies without leaving your tooling. Replies trigger customer emails automatically.

List Messages

GET /api/tickets/{ticketId}/messages

curl "https://www.bluetickets.app/api/tickets/clx123/messages" \
  -H "Authorization: Bearer qt_YOUR_API_KEY"
{
  "ok": true,
  "messages": [
    {
      "id": "cm_1",
      "body": "Hi, can you share a screenshot?",
      "isFromCustomer": false,
      "author": {
        "id": "user_123",
        "name": "Support Bot",
        "email": "[email protected]"
      },
      "createdAt": "2025-11-18T14:00:00.000Z"
    }
  ]
}

Reply to Ticket

POST /api/tickets/{ticketId}/messages

curl -X POST https://www.bluetickets.app/api/tickets/clx123/messages \
  -H "Authorization: Bearer qt_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "We pushed a fix. Can you try again?",
    "notifyRequester": true
  }'
{
  "ok": true,
  "message": {
    "id": "cm_9",
    "body": "We pushed a fix. Can you try again?",
    "isFromCustomer": false,
    "author": {
      "id": "api-org",
      "name": "API Automation",
      "email": "[email protected]"
    },
    "createdAt": "2025-11-18T15:00:00.000Z",
    "notifiedRequester": true
  }
}

Ticket Status Values

The following status values are available for tickets:

pending

Ticket is waiting to be picked up by an agent. This is the default status for newly created tickets.

processing

Ticket is being actively worked on by an agent.

completed

Ticket has been resolved and closed. The issue has been addressed.

reopened

Ticket was previously completed but has been reopened, typically because the issue recurred or the solution didn't work.

urgent

Ticket requires immediate attention due to high priority or critical impact.

escalated

Ticket has been escalated to a higher level of support or management for resolution.

on_hold

Ticket is temporarily paused, waiting for external information or customer response.

Ticket Source Values

The following source values indicate where the ticket originated:

app

Ticket created from a mobile application

web

Ticket created from the web interface

email

Ticket created from an inbound email

agent

Ticket created manually by an agent

Priority Levels

Priority levels indicate the importance of a ticket:

0LowLow priority - can be handled during normal business hours
1MediumMedium priority - should be addressed within a reasonable timeframe
2HighHigh priority - requires prompt attention

Error Codes

The API may return the following error codes:

400 Bad Request

Invalid request data. Check that all required fields are present and properly formatted.

401 Unauthorized

Missing or invalid API key. Check your Authorization header format: Bearer qt_<your-api-key>

403 Forbidden

You don't have permission to perform this action, or your email is not verified.

500 Internal Server Error

An unexpected error occurred on the server. Please try again later or contact support.

Error Response Examples

401 Unauthorized

{
  "error": "UNAUTHORIZED",
  "message": "Missing or invalid Authorization header. Use: Authorization: Bearer <api-key>"
}

400 Bad Request (Validation Error)

{
  "error": "VALIDATION_ERROR",
  "message": "Field 'title' is required"
}

400 Bad Request (Invalid Email)

{
  "error": "VALIDATION_ERROR",
  "message": "Field 'requesterEmail' must be a valid email address"
}

500 Internal Server Error

{
  "error": "INTERNAL_ERROR",
  "message": "An unexpected error occurred"
}

Best Practices

  • Rotate API keys periodically and scope them per automation or application.
  • Use pagination when listing tickets or messages to avoid timeouts and large payloads.
  • Retry POST requests on 5xx responses with exponential backoff (e.g., 1s, 2s, 4s, 8s).
  • Store ticket IDs to correlate future updates or webhook notifications.
  • Validate email addresses before sending requests to avoid validation errors.
  • Include requesterName when available for better ticket management and personalization.
  • Use appropriate priority levels and urgent flags to help agents prioritize work.
  • Always include a reason when updating ticket status for audit trail purposes.