---
title: "Get Open Tickets from the Freshworks API Using Python"
description: "Learn how to fetch open support tickets using the Freshworks API. Step-by-step guide covering authentication, endpoints, common pitfalls, FAQs, and best practices for production-ready integrations."
source_url: "https://www.getknit.dev/blog/get-open-tickets-from-the-freshworks-api-using-python"
page_type: "blog"
---

_This is an educational blog post from Knit's blog: “Get Open Tickets from the Freshworks API Using Python”._

# Get Open Tickets from the Freshworks API Using Python

## Introduction

This article is part of an ongoing series that breaks down the [**Freshworks API**](https://www.getknit.dev/blog/full-list-of-knits-crm-api-guides) in a practical, use-case–driven way. This piece focuses specifically on retrieving **open tickets**, one of the most common operational needs for support analytics, workflow automation, and reporting.

## Prerequisites

Before making any API calls, ensure the following are in place:

*   **API Key**  
    Generate your API key from **Profile Settings → API Settings** in your Freshworks account.
*   **Bundle Alias**  
    This is the unique identifier for your Freshworks account and is required to construct the correct API base URL. You’ll find it in the same API Settings section.

## API Endpoints

Freshworks exposes simple REST endpoints for querying tickets by status.

*   **Get open tickets for a single customer**

```
GET /api/tickets?filter=open&customer_id={customer_id}
```

*   **Get open tickets across all customers**

```
GET /api/tickets?filter=open
```

Both endpoints return JSON responses and support additional parameters such as pagination and embedded fields if needed.

### Step 1: Authentication

Freshworks uses token-based authentication. Your API key must be passed in the request headers.

```
headers = {
    "Authorization": "Token token=your_api_key",
}
```

### Step 2: Fetch Open Tickets for One Customer

Replace `{customer_id}` with the actual customer identifier from your Freshworks account.

```
import requests

url = "https://yourdomain.myfreshworks.com/api/tickets?filter=open&customer_id={customer_id}"
response = requests.get(url, headers=headers)

print(response.json())
```

Use this approach when you’re building customer-specific views or syncing ticket status into account-level workflows.

### Step 3: Fetch Open Tickets for All Customers

If you want a global view of unresolved tickets, use the endpoint without a customer filter.

```
import requests

url = "https://yourdomain.myfreshworks.com/api/tickets?filter=open"
response = requests.get(url, headers=headers)

print(response.json())
```

In production scenarios, this is almost always combined with pagination handling to avoid partial data pulls.

## Common Pitfalls

This is where most integrations break down. Avoid these mistakes upfront:

1.  **Incorrect API key**  
    Expired or copied-with-whitespace keys will fail silently with authentication errors.
2.  **Missing or incorrect bundle alias**  
    A wrong subdomain means your request never reaches the right account.
3.  **Invalid customer ID**  
    Freshworks does not auto-correct or infer customer identifiers.
4.  **Ignoring pagination**  
    Large ticket volumes require explicit handling to avoid truncated datasets.
5.  **Hitting rate limits**  
    High-frequency polling without backoff logic will get throttled.
6.  **Malformed headers**  
    Authentication headers must follow the exact token format.
7.  **Using deprecated API versions**  
    Older endpoints may work today and fail tomorrow, always check versioning.

## Frequently Asked Questions

**How do I find my API key?**  
Go to **Profile Settings → API Settings** in your Freshworks dashboard.

**What exactly is a bundle alias?**  
It’s the unique identifier for your Freshworks account and forms part of the API base URL.

**Can I filter tickets by other statuses?**  
Yes. The `filter` parameter supports values like `open`, `closed`, and others depending on your Freshworks configuration.

**Is there a limit to how many tickets I can fetch?**  
Yes. Freshworks enforces pagination and rate limits. Always consult the official API documentation for current thresholds.

**How should I handle API errors?**  
Check HTTP status codes, log error responses, and implement retry logic with exponential backoff.

**Can I fetch additional ticket details in the same call?**  
Yes. Use the `include` parameter to embed related resources where supported.

**What should I check if authentication fails?**  
Confirm the API key, ensure it’s active, and verify that it’s passed exactly as required in the headers.

## Knit for Freshworks API Integration

If you don’t want to manage authentication quirks, pagination logic, rate limits, and long-term API maintenance yourself, **Knit** provides a cleaner abstraction.

Integrate with Knit once, and it handles authentication, authorization, version changes, and operational overhead for the Freshworks API behind the scenes. The result: faster implementation, fewer edge-case failures, and a more resilient integration layer that scales as your usage grows.


## Related pages

- [How Knit works](https://md.getknit.dev/how-knit-works)
- [Unified API product](https://md.getknit.dev/products/unified-api)
