Support

Read Support Ticket

Introduction

Read the messages of a support ticket.

Description

To get the hash of your tickets, use the /organizations/support/tickets/list endpoint.

Request

The organization and the ticket to read. The /organizations/support/tickets/read API accepts requests in the following format:

ReadSupportTicketRequest Model - Request body to read a support ticket.
organizationId string
required
example: 5cad178b20a1d52567b534553413b691

Id of the organization.
hash string
required

Id of the ticket.
Example
{
  "organizationId": "5cad178b20a1d52567b534553413b691",
  "hash": "string"
}

Responses

The /organizations/support/tickets/read API provides a response in the following format:

200 Success

SupportTicketMessagesResponse Model - Response from reading a support ticket.
messages SupportTicketMessage Array
Messages of the ticket.
success boolean
Indicate if the API request was successful.
errors string Array
List of errors with the API call.
Example
{
  "messages": [
    {
      "message": "string",
      "name": "string",
      "profile": "string",
      "time": "September 29, 2026 - 18:00",
      "myself": true
    }
  ],
  "success": true,
  "errors": [
    "string"
  ]
}
SupportTicketMessage Model - A message in a support ticket.
message string
HTML body of the message.
name string
Name of the author.
profile string
URL of the profile image of the author.
time string
example: September 29, 2026 - 18:00

Time the message was sent.
myself boolean
True if you wrote the message.
Example
{
  "message": "string",
  "name": "string",
  "profile": "string",
  "time": "September 29, 2026 - 18:00",
  "myself": true
}

401 Authentication Error

UnauthorizedError Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.
www_authenticate string
Header

Examples

The following example demonstrates checking the ticket quota of your support seat, listing the support tickets of your organization, reading the messages of an open ticket, and opening a new ticket with an attached project, backtest, live deployment, and AI conversation through the cloud API.

from base64 import b64encode
from hashlib import sha256
from time import time
from requests import get, post
BASE_URL = 'https://www.quantconnect.com/api/v2/'

# You need to replace these with your actual credentials.
# You can request your credentials at https://www.quantconnect.com/settings/
# You can find our organization ID at https://www.quantconnect.com/organization/ 
USER_ID = 0
API_TOKEN = '____'
ORGANIZATION_ID = '____'

def get_headers():
    # Get timestamp
    timestamp = f'{int(time())}'
    time_stamped_token = f'{API_TOKEN}:{timestamp}'.encode('utf-8')

    # Get hased API token
    hashed_token = sha256(time_stamped_token).hexdigest()
    authentication = f'{USER_ID}:{hashed_token}'.encode('utf-8')
    authentication = b64encode(authentication).decode('ascii')

    # Create headers dictionary.
    return {
        'Authorization': f'Basic {authentication}',
        'Timestamp': timestamp
    }

# Authenticate to verify credentials
response = post(f'{BASE_URL}/authenticate', headers = get_headers())
print(response.json())

# --------------------


### Check Ticket Quota
# Send a POST request to the /organizations/support/tickets/list endpoint to get the ticket quota and the tickets
response = post(f'{BASE_URL}/organizations/support/tickets/list', headers=get_headers(), json={
    "organizationId": ORGANIZATION_ID,
    "closedPage": 0  # Page of 10 closed tickets, starting at 0
})
# Parse the JSON response into python managable dict
result = response.json()
# Print the number of new tickets you can open. Every ticket you opened in the last month counts, even if it's closed
remaining = result['remaining'] if result['success'] else 0
print(f"Remaining tickets: {remaining} of {result.get('allowance')}")

### List Support Tickets
# The same response contains the open tickets and the requested page of closed tickets
open_tickets = result.get('open', [])
for ticket in open_tickets:
    print(ticket['data']['external_id'], ticket['status'], ticket['title'])

### Read Support Ticket
if open_tickets:
    # Send a POST request to the /organizations/support/tickets/read endpoint to read the first open ticket
    response = post(f'{BASE_URL}/organizations/support/tickets/read', headers=get_headers(), json={
        "organizationId": ORGANIZATION_ID,
        "hash": open_tickets[0]['hash']
    })
    # Parse the JSON response into python managable dict
    result = response.json()
    # Check if the request was successful and print the messages
    if result['success']:
        for message in result['messages']:
            print(message['time'], message['name'], message['message'])

### Create Support Ticket (only when the quota has tickets left)
if remaining > 0:
    # Send a POST request to the /organizations/support/tickets/create endpoint to open a new ticket
    # Each new ticket uses one ticket from the quota of your support seat
    response = post(f'{BASE_URL}/organizations/support/tickets/create', headers=get_headers(), json={
        "organizationId": ORGANIZATION_ID,
        "subject": "Backtest orders don't fill at the expected price",
        "message": "<p>The market orders in the attached backtest fill at the previous close.</p>",
        "projectId": 12345678,             # Optional. Gives the Support Team permission to view the project
        "backtestId": "1c991c7eec8a7bd3b4bfc7e18a376fa6",  # Optional. Backtest of the attached project
        "deployId": "L-141106d80de1da9a9f85ea07c06bf7b6",  # Optional. Stopped live deployment of the attached project
        "agentDeploymentId": "A-3306e3e787f321efadf5c4392861d68d"  # Optional. AI conversation of the attached project
    })
    # Parse the JSON response into python managable dict
    result = response.json()
    # Keep the hash of the new ticket to find it and comment on it
    ticket_hash = result['hash']

    ### Get the Id of the New Support Ticket
    # Send a POST request to the /organizations/support/tickets/list endpoint to find the new ticket
    response = post(f'{BASE_URL}/organizations/support/tickets/list', headers=get_headers(), json={
        "organizationId": ORGANIZATION_ID
    })
    # Parse the JSON response into python managable dict
    result = response.json()
    # Print the Id to mention when you contact our Support Team about the ticket
    ticket = next(t for t in result['open'] if t['hash'] == ticket_hash)
    print(f"Ticket Id: {ticket['data']['external_id']}")

    ### Comment on Support Ticket
    # Send a POST request to the /organizations/support/tickets/create endpoint with the hash to comment on the ticket
    response = post(f'{BASE_URL}/organizations/support/tickets/create', headers=get_headers(), json={
        "organizationId": ORGANIZATION_ID,
        "hash": ticket_hash,
        "message": "<p>The issue is resolved. Thank you.</p>",
        "close": True  # Close the ticket after you add the comment
    })
    # Parse the JSON response into python managable dict
    result = response.json()
    print(result)

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: