---
title: "Get Open Tickets from Pipedrive API"
description: "Learn how to retrieve open tickets from the Pipedrive API using step-by-step instructions, key endpoints, best practices, common pitfalls, and FAQs for seamless integration."
source_url: "https://www.getknit.dev/blog/get-open-tickets-from-pipedrive-api"
page_type: "blog"
---

_This is an educational blog post from Knit's blog: “Get Open Tickets from Pipedrive API”._

# Get Open Tickets from Pipedrive API

## Introduction

This article is part of a broader series covering the [Pipedrive](https://md.getknit.dev/mcp-servers/pipedrive-mcp-server) API in depth. It focuses specifically on retrieving open tickets from [Pipedrive](https://md.getknit.dev/mcp-servers/pipedrive-mcp-server) using its API.

If you're looking for a complete breakdown of authentication, rate limits, and other capabilities, refer to the full guide [here](https://www.getknit.dev/blog/pipedrive-api-directory).

At a practical level, this guide shows how to extract open tickets (deals) both at a customer level and across your entire account, using a structured, repeatable approach.

## Pre-requisites

Before you start, ensure the following are in place:

*   Access to a Pipedrive account with API permissions
*   A valid API token for authentication
*   Python environment set up with required libraries (e.g., `requests`)

## API Endpoints

*   **Get Deals**  
    `GET https://api.pipedrive.com/v1/deals`
*   **Get Deal Details**  
    `GET https://api.pipedrive.com/v1/deals/{id}`

### 1\. Authenticate with Pipedrive API

```
import requests
api_token = 'your_api_token'
base_url = 'https://api.pipedrive.com/v1/'
headers = {'Authorization': f'Bearer {api_token}'}
```

### 2\. Retrieve All Open Deals

Use the deals endpoint and filter by status to fetch open tickets.

```
response = requests.get(f'{base_url}deals', headers=headers, params={'status': 'open'})
deals = response.json().get('data', [])
```

### 3\. Filter Deals for a Specific Customer

If you need customer-level visibility, filter using the customer identifier.

```
customer_id = 'specific_customer_id'
customer_deals = [deal for deal in deals if deal['person_id'] == customer_id]
```

### 4\. Retrieve Deal Details

Fetch granular details for each deal where deeper context is required.

```
for deal in customer_deals:
    deal_id = deal['id']
    deal_details = requests.get(f'{base_url}deals/{deal_id}', headers=headers).json()
```

## Common Pitfalls

1.  **Ignoring rate limits**  
    Pipedrive enforces request caps. Without throttling, your integration will break under scale.
2.  **Skipping pagination handling**  
    The API does not return all records in one call. Missing pagination means incomplete data.
3.  **Using invalid or expired tokens**  
    Authentication failures are silent productivity killers. Always validate upfront.
4.  **Assuming consistent data structure**  
    Not all deals will have a `person_id`. Build for variability, not ideal cases.
5.  **Not validating API responses**  
    Blind parsing leads to runtime failures. Always check for null or malformed responses.
6.  **No retry or error handling**  
    Network instability is real. Production-grade integrations must include retries.
7.  **Hardcoding logic against static endpoints**  
    APIs evolve. Build with flexibility to accommodate parameter and structure changes.

## Frequently Asked Questions

**1\. How do I get my API token?**  
You can find your API token in your Pipedrive account settings under the API section.

**2\. What is the rate limit for Pipedrive API?**  
Typically, 100 requests per 10 seconds. Design your integration to stay within limits.

**3\. Can I filter deals beyond status?**  
Yes. The API supports multiple query parameters for granular filtering.

**4\. What happens if the API token is invalid?**  
You will receive a 401 Unauthorized response.

**5\. How do I handle pagination effectively?**  
Use the `start` and `limit` parameters to iterate through all results systematically.

**6\. How should I test API requests before production use?**  
Use tools like Postman to validate endpoints and responses before coding.

**7\. Can deal data be updated via API?**  
Yes. Use the `PUT /deals/{id}` endpoint to update deal information.

## Knit for Pipedrive API Integration

If your goal is speed and reliability, building and maintaining direct integrations is not the best use of engineering bandwidth.

[Knit API](https://www.getknit.dev/integration/pipedrive) abstracts the complexity. A single integration gives you standardized access to Pipedrive while handling:

*   Authentication and authorization
*   Data normalization
*   Ongoing API maintenance

Net result: faster implementation, lower operational overhead, and fewer points of failure.


## Related pages

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